/* =========================================================
   PHEAN.PARIS — responsive.css
   Mobile + tablet overrides for shared desktop pages
   (day, people, map, rsvp, gifts, mailbox, stay, gallery).
   Loaded AFTER styles.css + page.css so it wins specificity.
   ========================================================= */

/* ------------- Global sanity ------------- */
html, body{ overflow-x: hidden; }
img, iframe{ max-width: 100%; }

/* ------------- MEDIUM (≤ 960px) ------------- */
@media (max-width: 960px){
  :root{ --pad-x: clamp(14px, 4vw, 28px); }

  /* Window chrome */
  .gf-stage{ padding: 60px var(--pad-x) 96px; }
  .gf-win__body{ padding: clamp(20px, 4vw, 36px); }
  .gf-head{ gap: 12px; }
  .gf-head__title{ font-size: clamp(34px, 7vw, 56px); }
  .gf-head__folio{ display: none; }

  /* Menubar: hide secondary items */
  .menubar{ padding: 8px 14px; }
  .menubar__item{ font-size: 11px; }

  /* Hero split stacks */
  .gf-hero{ grid-template-columns: 1fr !important; }
  .gf-hero__art{ min-height: 220px; padding: 24px; }

  /* Steps: stack */
  .gf-steps{ grid-template-columns: 1fr !important; gap: 12px; }

  /* Footer */
  .gf-foot{ flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Day cards */
  .w-day{ grid-template-columns: 1fr !important; }

  /* Story split */
  .w-story{ grid-template-columns: 1fr !important; gap: 20px; }

  /* Party grid */
  .w-party__grid{ grid-template-columns: repeat(3, 1fr) !important; gap: 20px 14px !important; }
  .w-party__intro .lede{ text-align: left !important; font-size: clamp(20px, 5vw, 26px); }
}

/* ------------- SMALL (≤ 720px) ------------- */
@media (max-width: 720px){
  /* Hide the floating dock — duplicates mobile tab bar; desktop page only */
  body:not(.no-dock) .dock{ display: none !important; }

  /* Menubar: tighten */
  .menubar{
    padding: 8px 12px;
    font-size: 11px;
  }
  .menubar__mark{ font-size: 13px; }
  .menubar__clock{ font-size: 10px; }
  /* Collapse "◉ page" indicator into just the bullet */
  .menubar__right .menubar__item{
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Window shell: less chrome */
  .gf-stage{ padding: 56px 12px 80px; }
  .gf-win{ border-radius: 4px; }
  .gf-win__chrome{ padding: 8px 12px; }
  .gf-win__path{
    position: static; text-align: left;
    padding-left: 10px;
    font-size: 9.5px;
    letter-spacing: .12em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .gf-win__body{ padding: 20px 16px 24px; }

  .gf-head{
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 12px; margin-bottom: 18px;
  }
  .gf-head__num{ font-size: 10px; }
  .gf-head__title{ font-size: clamp(40px, 11vw, 56px); }
  .gf-head__folio{ display: none; }

  .gf-deck{
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 22px;
  }

  /* Hero block: smaller padding, tighter type */
  .gf-hero__text{ padding: 22px; gap: 14px; }
  .gf-hero__title{ font-size: clamp(30px, 8vw, 40px); }
  .gf-hero__blurb{ font-size: 15px; }
  .gf-hero__art{ min-height: 180px; padding: 20px; }
  .gf-hero__mono{ font-size: clamp(36px, 10vw, 52px); }
  .gf-hero__row{ gap: 8px; }
  .gf-btn{ padding: 12px 16px; font-size: 10px; letter-spacing: .18em; }

  /* Steps block */
  .gf-step{ padding: 18px; }
  .gf-step__t{ font-size: 20px; }

  /* Party grid: 2 cols */
  .w-party__grid{ grid-template-columns: repeat(2, 1fr) !important; gap: 18px 12px !important; }
  .portrait__name{ font-size: 15px; }
  .portrait__desc{ font-size: 12px; }

  /* Day cards */
  .day-card{ padding: 18px; min-height: 0; }
  .day-card h3{ font-size: clamp(28px, 8vw, 40px); }

  /* Map */
  .mp__frame{ aspect-ratio: 4/5; }
  .mp__cap{
    left: 10px; bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 10px 12px 12px;
  }
  .mp__cap-t{ font-size: 22px; }
  .mp__bar{
    flex-direction: column; align-items: stretch; gap: 14px;
    padding: 14px;
  }
  .mp__legend{ gap: 12px 16px; font-size: 11px; }
  .mp__cta{ text-align: center; font-size: 11px; padding: 12px 16px; }

  /* Mailbox pop-art — let page.css rule handle, tighten further */
  .mb-pop{ padding: 22px 18px 22px; }
  .mb-pop__env{ width: 120px; }
  .mb-pop__title{ font-size: 34px; }
  .mb-pop__sub{ font-size: 14px; margin-bottom: 18px; }
  .mb-pop__cta{ font-size: 10.5px; padding: 11px 16px; }
  .mb-pop__pow{ width: 78px; height: 78px; top: 10px; right: 10px; }

  .mb-alt{ padding: 14px 16px; flex-direction: column; gap: 6px; }
  .mb-alt__k{ font-size: 9.5px; }
  .mb-alt__b{ font-size: 15px; }

  /* Footer */
  .gf-foot{ margin-top: 24px; }
  .gf-foot__note{ font-size: 14px; }
  .gf-foot__back{ font-size: 10px; letter-spacing: .18em; padding: 8px 12px; }

  /* Embeds */
  .gf-embed__frame{ height: 640px; }
  .gf-embed__head{ padding: 10px 14px; }
  .gf-embed__head .mono,
  .gf-embed__open{ font-size: 9.5px; letter-spacing: .16em; }
}

/* ------------- VERY SMALL (≤ 420px) ------------- */
@media (max-width: 420px){
  .gf-stage{ padding: 52px 10px 72px; }
  .gf-win__body{ padding: 16px 12px 20px; }

  .gf-head__title{ font-size: clamp(36px, 12vw, 48px); }

  .w-party__grid{ grid-template-columns: repeat(2, 1fr) !important; gap: 14px 10px !important; }

  .gf-hero__text{ padding: 18px; }
  .gf-hero__title{ font-size: 26px; }

  .gf-btn{ width: 100%; justify-content: center; }
  .gf-hero__row{ flex-direction: column; align-items: stretch; }

  .mb-pop__title{ font-size: 30px; }
}

/* ------------- GALLERY specifics ------------- */
@media (max-width: 720px){
  .gal-stage{ padding: 56px 12px 80px; }
  .gal-win__body{ padding: 20px 14px; }
  .gal-head{ grid-template-columns: 1fr; gap: 6px; }
  .gal-head__title{ font-size: clamp(40px, 11vw, 56px); }
  .gal-head__folio{ display: none; }
}

/* ------------- INDEX stage — tighten for tablet ------------- */
@media (max-width: 960px) and (min-width: 761px){
  .stage{ padding: 80px var(--pad-x) 40px; height: auto; min-height: 100vh; }
  .row{
    grid-template-columns: auto 1fr auto;
    min-height: 96px;
    flex: 0 0 auto;
    padding: 22px 12px;
  }
  .row__cap{ display: none; }
  .row__name{ font-size: clamp(32px, 6vw, 52px); }
  .row__num{ font-size: clamp(22px, 4vw, 36px); }
}

/* ------------- INDEX stage — phone (≤760px): tight, no dead space ------------- */
@media (max-width: 760px){
  .stage{
    padding: 56px 22px 12px;
    height: auto;
    min-height: 0;
    gap: 10px;
  }
  /* constrain grid tracks so the strip can't push past the stage padding */
  .stage > .strip{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .strip__side{ font-size: 9.5px; letter-spacing: .12em; gap: 2px; min-width: 0; }
  .strip__line{ font-size: 14px; }

  .rows{ margin: 4px auto 0; min-width: 0; }

  .row{
    flex: 0 0 auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px 10px;
    min-width: 0;
  }
  .row__name{ min-width: 0; overflow-wrap: break-word; }
  .row__num{ font-size: 20px; }
  .row__name{ font-size: 30px; line-height: 1.1; }
  .row__cap{ display: none; }
  .row__arrow{ font-size: 22px; }

  /* bottom strip: stack onto a single right-aligned line to save space */
  .stage > .strip:not(.strip--top){ grid-template-columns: 1fr; }
  .stage > .strip:not(.strip--top) .strip__side{ flex-direction: row; justify-content: flex-end; gap: 12px; }
  .stage > .strip:not(.strip--top) .strip__side:first-child{ display: none; }

  /* after-stage section: tighten bottom padding (dock is hidden on phone) */
  .after{ padding: 36px 0 24px !important; }
}

/* ------------- INDEX countdown tape — phone layout ------------- */
@media (max-width: 760px){
  .tape{
    grid-template-columns: 1fr;
    padding: 20px 18px;
    gap: 14px;
  }
  .tape__nums{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex-wrap: nowrap;
  }
  .tape__cell{ align-items: flex-start; gap: 4px; }
  .tape__val{ font-size: clamp(28px, 10vw, 44px); }
  .tape__lbl{ font-size: 9px; letter-spacing: .18em; }
  .tape__side{
    font-size: 15px;
    max-width: none;
    line-height: 1.35;
  }
}
