/* ============================================================================
   pages.css — blocks that appear on one page each, plus shared form styling.
   ========================================================================= */

/* =========================================================== home: hero ===

   Full-height photo with the names set over it. The overlay scrim is doing
   accessibility work, not decoration: it guarantees the display type keeps
   its contrast whatever engagement photo lands underneath.

   The photo is portrait with the couple standing dead centre, faces at about
   half height. So the type is laid out around them, never across the middle:
   - narrow: names up in the arch above their heads, date and venue down on
     the floor below their feet, faces clear in between;
   - wide (56rem+): everything stacked in the empty stone column on the left,
     aligned with the wordmark in the masthead.
   If hero.jpg is swapped for a differently composed photo, revisit this.   */

.hero{
  position:relative;
  min-height:min(88vh,46rem);
  /* Phones: exactly the screen left under the header (--masthead-h plus its
     1px rule), so "The details" sits just above the bottom edge instead of
     hanging off it. svh is the height with the browser's toolbars showing;
     plain vh assumes they are hidden and overshoots. Older browsers keep
     the line above. */
  min-height:min(calc(100svh - var(--masthead-h) - 1px),46rem);
  display:grid;
  overflow:hidden;
  background:var(--photo-ground);
}
.hero__media{position:absolute;inset:0}
.hero__media .frame{height:100%;border-radius:0;aspect-ratio:auto}
.hero__media .frame__ph::before{inset:1.5rem}

/* Everywhere else the placeholder caption is centred in its own empty box.
   In the hero it shares that box with the names, and centred it lands right
   on top of them. Move it into the top-left corner and shrink it: it only
   shows while the photo loads, and it should not compete with the names. */
.hero__media .frame__ph{
  justify-content:flex-start;
  align-items:flex-start;
  text-align:left;
  padding:clamp(1.75rem,4vw,3rem);
  gap:.35rem;
}
.hero__media .frame__ph-mark{width:1.6rem;height:1.6rem;font-size:.62rem}
/* Narrow: dark at the top and bottom where the type sits, clear through the
   middle band so the faces are not dimmed. */
.hero__scrim{
  position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(
    to bottom,
    color-mix(in srgb,var(--inverse) 62%,transparent) 0%,
    color-mix(in srgb,var(--inverse) 30%,transparent) 30%,
    color-mix(in srgb,var(--inverse) 0%,transparent) 46%,
    color-mix(in srgb,var(--inverse) 0%,transparent) 60%,
    color-mix(in srgb,var(--inverse) 55%,transparent) 80%,
    color-mix(in srgb,var(--inverse) 80%,transparent) 100%
  );
}
.hero__inner{
  position:relative;
  max-width:var(--page);width:100%;
  margin-inline:auto;
  padding:var(--space-m) var(--gutter) var(--space-m);
  color:var(--on-inverse);
  text-align:center;
  display:flex;flex-direction:column;align-items:center;
}
/* Names at the top, date and venue pushed to the bottom. */
.hero__meta{margin-top:auto}
.hero__names{
  font-size:var(--step-5);
  color:var(--on-inverse);
  margin-bottom:0;
}
.hero__names .amp{
  display:block;
  font-size:.42em;
  font-style:italic;
  color:var(--ornament);
  margin-block:.12em;
}
.hero__meta{
  font-family:var(--font-ui);
  font-size:var(--step--1);
  letter-spacing:.24em;
  text-transform:uppercase;
  color:color-mix(in srgb,var(--on-inverse) 88%,transparent);
  line-height:2.2;
}
.hero__date,.hero__place{display:block}
.hero__date{margin-bottom:.9em}
.hero__scroll{
  display:inline-flex;flex-direction:column;align-items:center;gap:.5rem;
  margin-top:var(--space-m);
  font-family:var(--font-ui);font-size:.62rem;letter-spacing:.2em;text-transform:uppercase;
  color:color-mix(in srgb,var(--on-inverse) 70%,transparent);
  text-decoration:none;
}
.hero__scroll::after{
  content:"";width:1px;height:2.2rem;
  background:linear-gradient(to bottom,var(--ornament),transparent);
}
/* Phones: the hero is only as tall as the screen, and the photo scales with
   it, but this bottom block does not. At full spacing it reached up over the
   couple's waists. Tighter lines and a shorter cue bring the date down to
   about knee height, keeping "The details". */
@media (max-width:39.99rem){
  .hero__inner{padding-bottom:max(var(--space-s),env(safe-area-inset-bottom))}
  .hero__meta{line-height:1.8}
  .hero__date{margin-bottom:.5em}
  .hero__scroll{margin-top:var(--space-s);gap:.35rem}
  .hero__scroll::after{height:1.4rem}
}

/* Wide: the hero box is landscape here, so the photo fills the width and the
   couple occupies roughly the middle third, from 37% to 63% across.
   Everything moves into the left third, vertically centred, and the scrim
   darkens from the left instead of from the bottom.

   Height is capped at 46rem, but grows with the width past ~1840px (40vw).
   With a flat 46rem cap the visible band of the photo kept thinning as
   screens widened, until at 2560px it was a chest-up strip that cut off the
   bouquet. 40vw holds the band at no thinner than 2.5:1.

   The photo itself is hero-wide here (the <picture> in index.html switches
   at this same 56rem): the middle 58% of the same photo's height, at higher
   resolution. See assets/img/README.md. Its crop is symmetric about the
   centre, so the default centred object-position frames it exactly as it
   frames hero.jpg. */
@media (min-width:56rem){
  .hero{min-height:min(88vh,max(46rem,40vw))}
  .hero__scrim{
    background:
      linear-gradient(
        to right,
        color-mix(in srgb,var(--inverse) 72%,transparent) 0%,
        color-mix(in srgb,var(--inverse) 50%,transparent) 26%,
        color-mix(in srgb,var(--inverse) 0%,transparent) 44%
      ),
      linear-gradient(
        to bottom,
        transparent 70%,
        color-mix(in srgb,var(--inverse) 35%,transparent) 100%
      );
  }
  .hero__inner{
    /* Full height, content centred inside it, so .hero__scroll below can
       anchor to the banner's bottom edge. */
    align-self:stretch;
    justify-content:center;
    align-items:flex-start;
    text-align:left;
    padding-block:var(--space-l);
    /* The text lines up with the masthead wordmark, which follows the
       centred 72rem page column. The couple does not: they stay at 37-63% of
       the viewport. Past ~1970px the column has drifted far enough right
       that "Quang" crowds the groom's face (and on ultrawide screens would
       cross it), so from there the text holds at 24% of the width instead.
       Below that width this resolves to exactly the wordmark's edge. */
    max-width:none;
    padding-left:min(max(var(--gutter),(100% - var(--page))/2 + var(--gutter)),24vw);
  }
  .hero__names{margin-bottom:.35em}
  .hero__names .amp{margin-left:.15em}
  .hero__meta{margin-top:0}
  /* The link stays centred across the whole banner, pinned near its bottom
     edge rather than stacked under the left-hand text. */
  .hero__scroll{
    position:absolute;left:50%;bottom:var(--space-s);
    transform:translateX(-50%);
    margin-top:0;
  }
}

/* ===================================================== interior page head */

.pagehead{
  padding-block:var(--space-l) var(--space-m);
  border-bottom:var(--rule) solid var(--hair);
}
.pagehead__inner{max-width:var(--page);margin-inline:auto;padding-inline:var(--gutter)}
.pagehead h1{margin-bottom:var(--space-s);max-width:28ch}
.pagehead .lede{max-width:var(--measure-wide)}
.pagehead__meta{
  margin-top:var(--space-m);
  display:flex;flex-wrap:wrap;gap:.6rem 1.4rem;
  font-family:var(--font-ui);font-size:var(--step--1);
  letter-spacing:.14em;text-transform:uppercase;color:var(--ink-muted);
}

/* Travel's page head: a small trees-and-mountain mark on a hairline
   instead of the bottom border. */
.pagehead--travel{border-bottom:0;padding-bottom:0}
.pagehead--travel+.section{padding-top:var(--space-l)}

.landmark{
  display:flex;align-items:center;gap:1.25rem;
  margin-top:var(--space-l);
  color:var(--ornament);
}
.landmark::before,.landmark::after{content:"";flex:1;height:1px;background:var(--hair-ornate)}
.landmark svg{
  width:4.5rem;height:auto;flex:none;
  fill:none;stroke:currentColor;stroke-width:1.1;stroke-linecap:round;stroke-linejoin:round;
}

/* ============================================================ home blocks */

/* Link-out cards. Three while RSVP is closed, four once Who's Coming is
   switched back on (see the RSVP switch in base.css). On desktop every
   VISIBLE card shares one row, whatever the count — a card hidden with
   display:none creates no column — so the switch needs no layout change. */
.homecards{grid-template-columns:1fr}
@media (min-width:40rem){.homecards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:64rem){.homecards{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}}

.invite{text-align:center}
.invite :where(p,.countdown,.flourish){margin-inline:auto}
.invite__date{
  font-family:var(--font-display);
  font-size:var(--step-2);
  line-height:1.3;
  color:var(--ink);
  max-width:28ch;
  text-wrap:balance;
  margin-inline:auto;
}
.invite__where{
  font-family:var(--font-ui);font-size:var(--step--1);
  letter-spacing:.2em;text-transform:uppercase;color:var(--ink-muted);
  margin-top:var(--space-s);line-height:2;
}

/* Engagement carousel — a filmstrip rather than a slideshow.

   Every slide shares one height and each photo keeps its own shape, so
   portrait and landscape shots sit side by side without being cropped to
   match. The track starts on the page's left content edge but runs off the
   right edge of the screen, so the next photo always peeks in: that is the
   cue that there is more. Plain scroll-snap underneath, so swipe, trackpad,
   shift-wheel and the arrow keys (track is focusable) all work without JS. */
.carousel{--slide-h:clamp(17rem,62vw,34rem);overflow:hidden}
.carousel__track{
  list-style:none;margin:0;max-width:none;   /* base.css caps ul at --measure */
  display:flex;gap:clamp(.9rem,2.4vw,1.75rem);
  overflow-x:auto;overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory;
  /* Line the first photo up with .wrap content; let the strip bleed right. */
  --edge:calc(max(0px,(100% - var(--page)) / 2) + var(--gutter));
  padding:.5rem var(--edge) 1.5rem;       /* room for the mat's shadow */
  scroll-padding-inline:var(--edge);
}
.carousel__track:focus-visible{outline-offset:-2px}
.carousel__slide{flex:none;scroll-snap-align:start;max-width:86vw}
.carousel__slide .frame{height:var(--slide-h);width:auto;max-width:86vw}
/* Captions wrap to the photo's width instead of stretching the slide. */
.carousel__slide .figcap{contain:inline-size}
/* The reel sits about two screens down, but it is close enough that the
   browser's own lazy loading would fetch its first photos straight away,
   sharing a slow connection with the hero. So its photos stay out of layout
   until site.js adds .is-near, a screen before the reel comes into view.
   nojs.css shows them when there is no script to do it.
   It hides each photo's <picture>, not the img: Chrome fetches a lazy image
   at once when the image itself is display:none, but never fetches one whose
   wrapper is hidden. That wrapper is the only reason these <picture>s exist. */
.carousel:not(.is-near) .frame picture{display:none}
/* Once site.js is driving it the strip is a rolling reel moved by a
   transform, not a scroller: .carousel clips it, sideways drags are
   handled in JS, vertical swipes still scroll the page. */
.carousel.is-enhanced .carousel__track{
  overflow:visible;scroll-snap-type:none;
  touch-action:pan-y;user-select:none;-webkit-user-select:none;
  cursor:grab;will-change:transform;
}
.carousel.is-dragging .carousel__track{cursor:grabbing}
@media (prefers-reduced-motion:no-preference){
  .carousel__track{scroll-behavior:smooth}
}

.carousel__bar{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  margin-top:var(--space-s);
}
.carousel__bar[hidden]{display:none}
.carousel__count{
  font-family:var(--font-ui);font-size:var(--step--1);
  letter-spacing:.2em;color:var(--ink-muted);margin:0;
}
.carousel__count [data-carousel-now]{color:var(--ink)}
.carousel__nav{display:flex;gap:.6rem}
.carousel__btn{
  width:2.75rem;height:2.75rem;display:grid;place-items:center;
  background:none;color:var(--ink);cursor:pointer;
  border:var(--rule) solid var(--hair-strong);border-radius:50%;
  font-size:1.05rem;line-height:1;
  transition:border-color .2s,color .2s,opacity .2s;
}
.carousel__btn:hover:not(:disabled){border-color:var(--ornament);color:var(--ornament-ink)}
.carousel__btn:disabled{opacity:.35;cursor:default}
.carousel__btn[hidden]{display:none}
.carousel__icon{width:.8rem;height:.8rem;fill:currentColor}
.carousel__icon--play,
.carousel.is-stopped .carousel__icon--pause{display:none}
.carousel.is-stopped .carousel__icon--play{display:block}

/* Card rail — a row of text cards that scrolls sideways, one card per
   snap. Deliberately NOT the engagement carousel: text has to hold still to
   be read, so this one never moves on its own. Without JS it is a plain
   scrolling row with a visible scrollbar; site.js adds the arrow buttons
   (borrowed from the carousel) and hides the scrollbar. */
/* The arrows sit beside the heading, and drop under it (still right-aligned)
   when the heading's text needs the full width. */
.cardrail__head{
  display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:var(--space-s);
  margin-bottom:var(--space-m);
}
.cardrail__head>:first-child{flex:1 1 20rem}
.cardrail__head .carousel__nav{flex:none;margin-left:auto}
.cardrail__head .carousel__nav[hidden]{display:none}
/* Phones (the one-card-at-a-time layout below): the arrows go under the
   cards instead, still right-aligned, so the heading leads straight into
   the first card and the arrows sit where the thumb already is. The head
   steps aside (display:contents) so its two children can be ordered
   around the track; the note under "What to do" stays last. The markup is
   unchanged, so screen readers and keyboards still meet the arrows before
   the cards, as on larger screens. */
@media (max-width:39.99rem){
  .cardrail{display:flex;flex-direction:column}
  .cardrail__head{display:contents}
  .cardrail__head>:first-child{flex:none;margin-bottom:var(--space-m)}
  .cardrail__head .carousel__nav{order:1;margin-top:var(--space-s)}
  .cardrail>.todo-note{order:2}
}
.cardrail__track{
  --rail-gap:var(--space-m);
  list-style:none;margin:0;padding:0 0 .25rem;
  max-width:none;            /* base.css caps every list at --measure */
  display:flex;gap:var(--rail-gap);
  overflow-x:auto;overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory;
}
.cardrail__track:focus-visible{outline-offset:4px}
.cardrail.is-enhanced .cardrail__track{scrollbar-width:none}
.cardrail.is-enhanced .cardrail__track::-webkit-scrollbar{display:none}
@media (prefers-reduced-motion:no-preference){.cardrail__track{scroll-behavior:smooth}}

/* Phones see one card and the edge of the next, which says "swipe". */
.cardrail__slide{flex:0 0 85%;scroll-snap-align:start;display:flex}
@media (min-width:40rem){.cardrail__slide{flex-basis:calc((100% - var(--rail-gap)) / 2)}}
@media (min-width:64rem){.cardrail__slide{flex-basis:calc((100% - 2 * var(--rail-gap)) / 3)}}
.cardrail__slide>.panel{flex:1;display:flex;flex-direction:column}
.panel__foot{margin-top:auto;padding-top:.7rem}
/* Category label above a rail card's title. Same .tag as the Getting here
   cards, spaced the same way. */
.cardrail__cat{margin-bottom:var(--space-s)}
.cardrail__cat + h3{margin-bottom:.6rem}

/* A small aside under the Travel "what to do" rail: no box, just a brass
   rule, so it reads as a footnote to the cards rather than a seventh one. */
.todo-note{
  margin-top:var(--space-l);
  max-width:34rem;
  padding-left:var(--space-s);
  border-left:2px solid var(--ornament);
}
.todo-note .tag{display:block;margin:0 0 .4rem}
.todo-note p.small{margin:0;color:var(--ink-muted)}

.letter{max-width:var(--measure);margin-inline:auto}
.letter p{max-width:none}
.letter__sign{
  margin-top:var(--space-m);
  font-family:var(--font-display);
  font-size:var(--step-1);
  font-style:italic;
  color:var(--ink-soft);
}

/* ========================================================= travel: blocks

   Getting here and Where to stay use the same flat card as the "Six ways"
   rail: .panel (surface, hairline border, near-square corners, no shadow).
   Every piece of text uses an existing type role (.eyebrow, h3, h4, .lede,
   body copy, .small, .fine, .tag), so do not add font faces in this block. */

/* Section head: eyebrow, then either a short brass rule or a heading, then
   the lede. Left-aligned like every other section head on the site. */
.sechead{margin-bottom:var(--space-l)}
.sechead .lede{max-width:var(--measure-wide)}
.sechead h2+.lede{margin-top:var(--space-s)}
/* Side note under a section intro: smaller and muted, close to the lede. */
.sechead .lede:has(+ .sechead__note){margin-bottom:.6rem}
.sechead__note{margin:0;max-width:var(--measure-wide)}

/* Card label: small uppercase UI type in the accent colour, with an
   optional leading icon. */
.tag{
  display:inline-flex;align-items:center;gap:.6rem;
  font-family:var(--font-ui);font-size:.66rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--accent);
}

/* Line icons. Brass, because they are ornament next to text that already
   says the same thing. */
.ico{
  width:1.15rem;height:1.15rem;flex:none;
  fill:none;stroke:var(--ornament-ink);stroke-width:1.4;
  stroke-linecap:round;stroke-linejoin:round;
}

/* Travel card: a .panel with a little more room inside, label / title /
   copy stacked. Columns stretch, so cards in a row share one height. */
.tcard{
  display:flex;flex-direction:column;
  padding:clamp(1.5rem,3vw,2.25rem);
}
.tcard__tag{margin-bottom:var(--space-s)}
.tcard__tag .ico{width:1rem;height:1rem}
.tcard h3{margin-bottom:.6rem}
.tcard p.small{margin-bottom:0}

/* --------------------------------------------------------- getting here */

.routes{display:grid;gap:var(--space-m)}
@media (min-width:44rem){.routes{grid-template-columns:1fr 1fr}}

/* --------------------------------------------------------- where to stay */

.stays{display:grid;gap:var(--space-m)}
@media (min-width:60rem){.stays{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Side by side, each card's five parts (label, name, drive time, copy,
   hotels) share rows with its neighbours, so the drive times and the hotel
   dividers line up across all three even when one name wraps. */
@media (min-width:60rem){
  @supports (grid-template-rows:subgrid){
    .stays{row-gap:0}
    .stay{display:grid;grid-row:span 5;grid-template-rows:subgrid;align-content:start}
    .stay>*{align-self:start}
    .stay .stay__hotels{margin-top:0}
  }
}

/* Drive time: the one fact guests compare across cards, so it sits right
   under the name, in UI type, with the car icon. */
.stay__drive{
  display:flex;align-items:center;gap:.5rem;
  margin:0 0 var(--space-s);
  font-family:var(--font-ui);font-size:var(--step--1);letter-spacing:.02em;
  color:var(--ink-soft);
}
.stay__drive .ico{width:1rem;height:1rem}

/* Hotels sit on the card's bottom edge behind a hairline, so they line up
   across all three cards however long the description runs. */
.stay__hotels{
  margin-top:auto;
  padding-top:var(--space-s);
}
.stay p.small{margin-bottom:var(--space-s)}
.stay__hotels{border-top:var(--rule) solid var(--hair)}
.stay__label{
  margin:0 0 .5rem;
  font-family:var(--font-ui);font-size:.66rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--ink-muted);
}
.stay__hotels ul{list-style:none;margin:0;padding:0}
.stay__hotels li{
  font-size:var(--step--1);line-height:1.45;color:var(--ink-soft);
  padding:.3rem 0;
}
.stay__hotels li+li{border-top:var(--rule) dotted var(--hair)}

/* ---------------------------------------------------------------- shared */

/* Blush band under a section's cards: heading, then one short paragraph. */
.callout{
  margin-top:var(--space-m);
  padding:var(--space-m) clamp(1.5rem,3vw,2.25rem);
  background:var(--accent-wash);
  border:var(--rule) solid var(--hair);
  border-radius:var(--radius);
}
.callout h4{margin-bottom:.4rem}
.callout p{margin:0;max-width:var(--measure-wide);color:var(--ink-soft)}


/* =================================================== program: before you come */

/* Three things guests must not miss: numbered, full-weight panels. */
.musts{counter-reset:must}
.musts>.panel{counter-increment:must}
.musts>.panel::before{
  content:counter(must,decimal-leading-zero);
  display:block;margin-bottom:var(--space-s);
  font-family:var(--font-display);font-size:.9rem;letter-spacing:.08em;
  color:var(--ornament-ink);
}
.musts h3{font-size:var(--step-2);margin-bottom:.5rem}
.musts p{color:var(--ink-soft)}

/* Everything else: smaller heading, quiet panels. */
.helpful-head{font-size:var(--step-2);margin:var(--space-xl) 0 var(--space-m)}
.helpful h3{font-size:var(--step-1);margin-bottom:.4rem}

/* ===================================================================== faq */

/* The Expand all row, the heading over each group of questions, and the
   space between one group and the next heading. */
.faq-tools{justify-content:flex-end;margin-bottom:var(--space-m)}
.faq-title{margin-bottom:var(--space-s)}
.faq+.faq-title{margin-top:var(--space-xl)}

/* ============================================================ rsvp: states */

.soon{
  position:relative;
  padding:var(--space-l) var(--space-m);
  border:var(--rule) solid var(--hair-ornate);
  border-radius:var(--radius);
  background:var(--surface);
  text-align:center;
}
.soon :where(p,ul,ol){margin-inline:auto}
.soon__mark{
  width:3.2rem;height:3.2rem;margin:0 auto var(--space-s);
  border:1px solid var(--ornament);border-radius:50%;
  display:grid;place-items:center;
  font-family:var(--font-display);font-size:1.1rem;color:var(--ornament);
}
/* The heading is a sentence, so let it break into two even lines on wide
   screens rather than one long line or a lone last word. */
.soon h1{max-width:13em;margin-inline:auto;text-wrap:balance}
/* Second, quieter paragraph: one size down and muted. */
.soon__aside{margin-top:var(--space-m);max-width:32rem;color:var(--ink-muted)}

/* The form styles live in internal.css: the RSVP is a Google Form linked
   from this page, so only the private editors still use them. */
