/* ==========================================================================
   Fonts — self-hosted, supplied by Ellie
   ========================================================================== */
@font-face {
  font-family: 'Golden Reverie';
  src: url('../assets/brand/fonts/GoldenReverie-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Golden Reverie';
  src: url('../assets/brand/fonts/GoldenReverie-AlternateBold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* Noto Serif, variable — Ellie's spec from Figma: Weight 330 / Width 72.
   Loaded as a variable font and locked to that exact instance via
   font-variation-settings (see --font-display/--font-body below),
   rather than a fixed Google Fonts weight/width that doesn't match. */
@font-face {
  font-family: 'Noto Serif Variable';
  src: url('../assets/brand/fonts/NotoSerif-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Noto Serif Variable';
  src: url('../assets/brand/fonts/NotoSerif-Variable-Italic.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-style: italic;
  font-display: block;
}

/* ==========================================================================
   Design tokens — Ellie's brand
   Sampled directly from the mobile mockup. This is the one place to retune
   if a color/spacing value needs adjusting.
   ========================================================================== */
:root {
  /* Colors */
  --color-espresso: #31140c;       /* primary dark bg + ink on cream */
  --color-espresso-soft: #45221a;  /* lighter espresso for hover/elevation */
  --color-olive: #a09b4a;          /* secondary bg + heading text on espresso */
  --color-olive-deep: #6b5f2c;     /* muted olive for borders/shadows */
  --color-cream: #e3e0d1;          /* card / light bg */
  --color-ivory: #ece9da;          /* brighter cream for text on dark */
  --color-rust: #d1582f;           /* Friday accent */
  --color-sky: #a7c5d0;            /* Sunday accent */
  --color-error: #b3261e;
  --color-success: #4a6b2c;

  /* Typography */
  --font-display: 'Noto Serif Variable', Georgia, 'Times New Roman', serif;
  --font-body: 'Noto Serif Variable', Georgia, 'Times New Roman', serif;
  --font-variation: 'wght' 330, 'wdth' 72;
  --font-form: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-script: 'Golden Reverie', cursive;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-xs: 0.75rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 2rem;
  --font-size-xxl: clamp(2.5rem, 7vw, 3.5rem);

  /* Spacing (4/8px rhythm) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* Layout */
  --max-width: 1040px;
  --max-width-narrow: 640px;
  --radius: 4px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-weight: 330;
  font-stretch: 72%;
  font-variation-settings: var(--font-variation);
  background: var(--color-espresso);
  color: var(--color-ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 330;
  font-stretch: 72%;
  font-variation-settings: var(--font-variation);
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
}

p {
  margin: 0 0 var(--space-sm);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

svg {
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header
   One logo, continuously resized by scroll position (see site.js) —
   big on first load, shrinking smoothly into its docked size as you
   scroll, then staying there. position: sticky so it reserves its own
   space in the flow (no overlap/spacer hacks) and pins at top:0 once
   reached. No background strip — fully transparent, logo floats
   directly over whatever is behind it.
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: transparent;
  padding: var(--space-sm) 0;
  text-align: center;
}

.wordmark {
  display: block;
}

.wordmark img {
  /* JS sets an inline width on scroll; this is just the first-paint size. */
  width: clamp(280px, 78vw, 440px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

/* Anchor targets should clear the sticky header */
#weekend,
#accommodation {
  scroll-margin-top: 3.5rem;
}

/* Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: var(--space-xs) var(--space-lg);
  background: var(--color-espresso);
  color: var(--color-ivory);
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), opacity 150ms var(--ease);
}

.btn:hover {
  box-shadow: 0 8px 20px -8px rgba(49, 20, 12, 0.55);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-rust);
  outline-offset: 2px;
}

/* Image-based RSVP CTA (Ellie's button graphic) — now a real button that
   opens the RSVP dialog, styled to look exactly like the plain link did. */
.rsvp-cta {
  display: block;
  width: clamp(125px, 31vw, 168px);
  margin: 4rem auto 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 150ms var(--ease), opacity 150ms var(--ease);
}

.rsvp-cta:hover {
  transform: translateY(-1px);
}

.rsvp-cta img {
  width: 100%;
  height: auto;
}

/* Sections
   ========================================================================== */
.section {
  padding: var(--space-xl) 0;
}

.section-olive {
  background: var(--color-olive);
  color: var(--color-espresso);
}

.section-espresso {
  background: var(--color-espresso);
  color: var(--color-ivory);
}

/* Text selection swaps the two section colours: green highlight with
   brown text everywhere by default (the brown sections), brown with
   green text on the green section. */
::selection {
  background: var(--color-olive);
  color: var(--color-espresso);
}

.section-olive ::selection {
  background: var(--color-espresso);
  color: var(--color-olive);
}

/* Story photo — straddles the brown/olive boundary, its vertical
   center pinned exactly on the seam between the two sections. */
.story {
  position: relative;
  min-height: 100vh;
}

.polaroid-plain {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(180px, 46vw);
  height: auto;
  z-index: 30;
}

/* Hero
   ========================================================================== */
.hero {
  text-align: center;
  padding: var(--space-sm) 0 11rem;
}

.hero-frame {
  width: min(340px, 78vw);
  margin: 0 auto var(--space-lg);
}

.hero-frame img {
  width: 100%;
  height: auto;
}

.invite {
  position: relative;
  padding: 3.5rem var(--space-md) 0;
}

.invite-star {
  position: absolute;
  height: auto;
}

.invite-star--a {
  width: clamp(64px, 18vw, 100px);
  top: -0.25rem;
  left: 0.25rem;
}

.invite-star--b {
  width: clamp(72px, 20vw, 120px);
  right: 0.25rem;
  bottom: 0.5rem;
}

/* One rule for all four invite lines, so the gap between every pair is
   governed by the exact same margin value — no mixing line-height-based
   leading with margin-based paragraph spacing, which is what made the
   gaps uneven. */
.invite-line {
  font-family: var(--font-display);
  font-weight: 380;
  font-stretch: 72%;
  font-variation-settings: 'wght' 380, 'wdth' 72;
  color: var(--color-olive);
  font-size: 1.512rem;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0 0 -0.15rem;
}

/* The script spans inside this line are much taller than the plain
   text, and since "Alice"/"David" have no descenders, that extra
   height sits almost entirely above the baseline — which left visibly
   more empty space below this line than above it. Pull the next line
   up further to compensate so the gap matches the others. */
.invite-line:has(.script) {
  margin-bottom: -0.5rem;
}

.invite-line:last-child {
  margin-bottom: 0;
}

.invite-line .script {
  font-family: var(--font-script);
  font-weight: 400;
  letter-spacing: 0;
  font-size: 1.4583em;
  line-height: 1;
  vertical-align: middle;
}

/* Our Story polaroid
   ========================================================================== */
.polaroid {
  text-align: center;
  padding: var(--space-xl) 0;
}

.polaroid img {
  width: min(280px, 70vw);
  margin: 0 auto;
}

/* The Weekend
   No separate logo here — it's the same single sticky logo already
   pinned at the top of the whole page (.site-header). .weekend-pin
   (header + card stack together) is pinned as one unit by GSAP
   ScrollTrigger (see site.js) directly below that logo for the whole
   card-flicking sequence, then — this being a single pinned unit
   rather than a separately-sticky header plus a separately-pinned
   stack — both release and scroll away together the instant the
   sequence ends, with no lag where the header stays stuck and the
   last card disappears behind it.
   ========================================================================== */
/* Pure spacer — exists only so the pin's scroll-activation point (and
   the photo doesn't read as "underneath" it) isn't reached until the
   photo has scrolled out of view. Keeping this separate from
   weekend-header's own padding means the gap above "THE WEEKEND"
   stays tight once pinned, regardless of how much clearance the photo
   needs beforehand. */
.story-spacer {
  height: 9rem;
}

.weekend-header {
  background: var(--color-olive);
  text-align: center;
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.weekend-header h2 {
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  margin: 0;
}

/* The Details
   Same header size/treatment as "THE WEEKEND", on the brown section.
   .details-spacer mirrors .story-spacer — plain brown clearance so
   the sticky logo lands on brown and has room to sit above "THE
   DETAILS" rather than overlapping it.

   No min-height here on purpose — the "let us know" note
   (.rsvp-note-wrap) always follows immediately after with its own
   small fixed gap, whatever this section's real height ends up
   being. A min-height floor tall enough to make brown fill the
   screen when the accordions are closed is far taller than almost
   any single opened panel, so it previously left a large gap before
   the note that had nothing to do with what was actually open —
   big when closed, not shrinking properly as panels opened. Content
   alone decides the height now, so the gap stays the same small size
   regardless of accordion state. */
.details {
  position: relative;
  text-align: center;
  padding: 0 var(--space-md) var(--space-xl);
}

.details-spacer {
  height: 9rem;
}

.details-header h2 {
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  color: var(--color-olive);
  margin: 0;
}

.accordion {
  width: min(560px, 100%);
  margin: var(--space-lg) auto 0;
  text-align: left;
}

.accordion-item {
  border-bottom: 1px solid var(--color-ivory);
}

/* A plain button + JS-toggled panel (see site.js) rather than native
   <details>/<summary> — the native disclosure marker proved impossible
   to fully suppress across engines, and Ellie wants a plus/minus
   instead of any triangle anyway. The plus/minus is drawn from two
   CSS lines. */
.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  border: 0;
  background: none;
  padding: var(--space-sm) 0;
  font-family: var(--font-body);
  color: var(--color-ivory);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  text-align: left;
  cursor: pointer;
}

.accordion-icon {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
}

.accordion-icon::before,
.accordion-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 350ms var(--ease);
}

.accordion-icon::before {
  width: 100%;
  height: 1.5px;
}

.accordion-icon::after {
  width: 1.5px;
  height: 100%;
}

/* Plus to minus: the whole icon spins half a turn while its vertical
   bar folds flat onto the horizontal one; closing plays it in reverse. */
.accordion-icon {
  transition: transform 350ms var(--ease);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.accordion-panel {
  padding: 0 0 var(--space-md);
}

.accordion-panel[hidden] {
  display: none;
}

.accordion-panel p {
  font-family: var(--font-body);
  color: var(--color-ivory);
  opacity: 0.85;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin: 0;
}

.accordion-panel p + p {
  margin-top: var(--space-sm);
}

.accordion-panel ul {
  margin: var(--space-sm) 0;
  padding-left: 1.1rem;
  list-style: disc;
}

.accordion-panel li {
  font-family: var(--font-body);
  color: var(--color-ivory);
  opacity: 0.85;
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.accordion-panel li strong {
  font-weight: 600;
  opacity: 1;
}

.accordion-panel .panel-subhead {
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: var(--space-md);
}

.panel-subhead + ul {
  margin-top: var(--space-xs);
}

.accordion-panel a {
  color: var(--color-ivory);
  text-underline-offset: 2px;
}

/* The RSVP button's stepped frame (assets/brand/rsvp-button.png)
   rebuilt in CSS so it can carry any label: olive outer shape, cream
   inner shape inset by the frame thickness, same notch proportions as
   the graphic at the RSVP button's 60px height. */
.frame-button {
  --nx: 16px;
  --ny: 15px;
  --frame: 4.5px;
  --frame-shape: polygon(
    var(--nx) 0, calc(100% - var(--nx)) 0,
    calc(100% - var(--nx)) var(--ny), 100% var(--ny),
    100% calc(100% - var(--ny)), calc(100% - var(--nx)) calc(100% - var(--ny)),
    calc(100% - var(--nx)) 100%, var(--nx) 100%,
    var(--nx) calc(100% - var(--ny)), 0 calc(100% - var(--ny)),
    0 var(--ny), var(--nx) var(--ny)
  );
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 2.6rem;
  margin-top: var(--space-md);
  border: 0;
  background: var(--color-olive);
  clip-path: var(--frame-shape);
  font-family: var(--font-display);
  font-weight: 330;
  font-stretch: 72%;
  font-variation-settings: var(--font-variation);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--color-espresso);
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms var(--ease);
}

.frame-button::before {
  content: '';
  position: absolute;
  inset: var(--frame);
  z-index: -1;
  background: var(--color-ivory);
  clip-path: var(--frame-shape);
}

.accordion-panel .frame-button {
  color: var(--color-espresso);
  text-decoration: none;
}

.frame-button:hover {
  transform: translateY(-1px);
}

.frame-button.is-disabled {
  cursor: default;
  opacity: 0.6;
}

.frame-button.is-disabled:hover {
  transform: none;
}

.accordion-panel .frame-button-note {
  margin-top: var(--space-xs);
  font-size: 0.8rem;
  opacity: 0.6;
}

.accordion-panel .panel-lead {
  font-family: var(--font-script);
  font-size: 1.3rem;
  opacity: 1;
  margin-bottom: var(--space-sm);
}

/* The Details sit on the olive section under the day-cards, so the
   accordion swaps its ivory-on-brown colouring for espresso-on-olive. */
.weekend-details {
  text-align: center;
  padding: var(--space-xl) var(--space-md) 0;
}

.weekend-details .details-header h2 {
  color: var(--color-espresso);
}

.weekend-details .accordion-item {
  border-bottom-color: var(--color-espresso);
}

.weekend-details .accordion-trigger,
.weekend-details .accordion-panel p,
.weekend-details .accordion-panel li,
.weekend-details .accordion-panel a {
  color: var(--color-espresso);
}

.weekend-details .accordion-panel p,
.weekend-details .accordion-panel li {
  opacity: 0.9;
}

/* What to wear: one block per event, each edged in its day-card's
   accent colour so the dress codes read as separate events rather
   than one run of paragraphs. */
.wear-event {
  border-left: 3px solid var(--accent-color);
  padding-left: var(--space-sm);
  margin-top: var(--space-xl);
}

.wear-event:first-child {
  margin-top: var(--space-xs);
}

.wear-event--rust {
  --accent-color: var(--color-rust);
}

.wear-event--olive {
  --accent-color: var(--color-olive-deep);
}

.wear-event--sky {
  --accent-color: var(--color-sky);
}

.wear-heading {
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--color-espresso);
  margin: 0 0 var(--space-xs);
}

.wear-event .style-carousel {
  margin-bottom: var(--space-sm);
}

.accordion-panel .wear-weather {
  margin-top: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 1px solid currentColor;
  font-style: italic;
}

/* Infinite auto-panning strip of inspiration photos. The track holds
   the image set twice back-to-back; site.js drives its transform
   with a constant drift plus whatever extra the viewer scrolls in,
   wrapping the offset at the halfway point (one full set) so the
   loop never visibly resets. */
.style-carousel {
  overflow: hidden;
  width: 100%;
  margin-top: var(--space-md);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.style-carousel-track {
  display: flex;
  gap: var(--space-sm);
  width: max-content;
  will-change: transform;
}

.style-card {
  flex: 0 0 auto;
  width: 130px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* A plain (non-rotated) wrapper carries the brown background and a
   fixed gap above/below, so the note sits a consistent distance
   after .details regardless of that section's height. The rotation
   stays scoped to the text's own inline-block box, rather than
   including it so a tilted box edge doesn't show against the
   identically-coloured background around it. */
/* The rotate(-8deg) on .rsvp-note only affects painting, not layout —
   its parent's height is still based on the UNROTATED text box, so
   the rotated text's actual visual extent (taller/wider than that,
   trigonometrically) can spill past this wrapper's own bottom edge
   into whatever follows (the RSVP button straddling the seam below,
   then the footer photo) instead of properly pushing them down.
   Generous padding-bottom reserves enough room for that overflow. */
.rsvp-note-wrap {
  background: var(--color-espresso);
  text-align: center;
  padding: var(--space-xl) var(--space-md) 5.5rem;
}

.rsvp-note {
  display: inline-block;
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--color-olive);
  font-size: 2.2rem;
  line-height: 0.85;
  margin: 0;
  transform: rotate(-8deg);
}

/* Pinned by GSAP ScrollTrigger (see site.js): .weekend-pin gets
   position:fixed for the scroll duration — header included — while
   each card inside .weekend-stack-inner animates in turn, the current
   card shrinking and tilting away as the next slides up from below,
   matching the reference ScrollCards component. Height of the inner
   box is set in JS to the tallest card so nothing clips. */
.weekend-pin {
  position: relative;
  z-index: 19;
}

/* Sits after the pinned header+stack, still in normal (unpinned) flow
   within the olive section. Without it, the instant the pin/hold
   releases, the brown section below — completely offscreen up to
   that exact point — lands flush against the last card with no
   warning. With it, there's a fixed, constant gap between the last
   card and the brown section the whole time scrolling continues: the
   weekend header+card simply scroll away normally, with brown
   trailing at that same distance throughout, instead of visibly
   approaching to meet the card and then separating again. */
.weekend-trailing-gap {
  height: 6rem;
}

.weekend-stack {
  position: relative;
  padding: var(--space-lg) var(--space-md) var(--space-lg);
}

.weekend-stack-inner {
  position: relative;
  /* 100%, not a vw unit — .weekend-stack already has its own
     horizontal padding, so sizing against the viewport instead of
     the (narrower) padded content box let this overflow its
     container on mobile, shifted off-center to the right. */
  width: min(380px, 100%);
  margin: 0 auto;
}

/* The card's frame is a "spool" silhouette — narrow top/bottom caps,
   full-width through the middle — recreated in CSS (not a fixed-aspect
   background image) so each card can be exactly as tall as its own
   content. --notch is a single fixed px amount: both the cap height
   and the side inset, matching the reference shape's proportions. */
/* The card's frame is a "spool" silhouette — narrow top/bottom caps,
   full-width through the middle — recreated in CSS (not a fixed-aspect
   background image) so each card can be exactly as tall as its own
   content. --notch is a single fixed px amount: both the cap height
   and the side inset, matching the reference shape's proportions.
   Defined here (not on .day-card-face below) so this unclipped
   wrapper's own ::before shadow layer can share the exact same shape. */
.day-card {
  --notch: 34px;
  --card-shape: polygon(
    var(--notch) 0, calc(100% - var(--notch)) 0,
    calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%, var(--notch) 100%,
    var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)),
    0 var(--notch), var(--notch) var(--notch)
  );
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
}

/* A plain box-shadow (or filter: drop-shadow) on .day-card-face would
   either be clipped away by its own clip-path (box-shadow only paints
   inside that same clip) or, with drop-shadow, fail to render at all
   in WebKit when combined with clip-path + transform on one element.
   This sidesteps both: a separate, unclipped layer behind the card.
   Deliberately NOT shaped with the card's own notched silhouette —
   even blurred, that shape's straight edges/corners still read as
   sharp lines. Inset well past the notch depth (34px) instead, so a
   plain soft-cornered rectangle, blurred into a diffuse glow, never
   pokes out through the notch cutouts. */
.day-card::before {
  content: '';
  position: absolute;
  inset: 40px;
  border-radius: 12px;
  z-index: -3;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(40px);
  transform: translate(10px, 14px);
  transition: filter 200ms var(--ease), opacity 200ms var(--ease);
  opacity: 0.75;
}

/* On hover a card lifts to the front (see .day-card:hover below) —
   softening and growing its own shadow further at the same time
   (easing in rather than snapping) reinforces that it's rising up,
   not just reordering in the stack. */
.day-card:hover::before {
  filter: blur(50px);
  opacity: 0.9;
}

.day-card-face {
  position: relative;
  background: var(--color-cream);
  color: var(--color-espresso);
  padding: 3.5rem 3rem 3.25rem;
  text-align: center;
  clip-path: var(--card-shape);
}

/* The accent outline sits inset from the card's own edge (not flush
   against it), matching the mockup — a cream margin outside the line
   and another inside it. Built from two concentric clipped shapes
   (same --notch, so they stay parallel to the outer card edge): an
   accent-colored ring layer, then a cream fill on top of it that
   covers everything except a thin ring at the ring layer's edge. */
.day-card-face::before {
  content: '';
  position: absolute;
  inset: 14px;
  z-index: -2;
  background: var(--accent-color);
  clip-path: var(--card-shape);
}

.day-card-face::after {
  content: '';
  position: absolute;
  inset: 17px;
  z-index: -1;
  background: var(--color-cream);
  clip-path: var(--card-shape);
}

.day-card--rust {
  --accent-color: var(--color-rust);
}

.day-card--olive {
  --accent-color: var(--color-olive-deep);
}

.day-card--sky {
  --accent-color: var(--color-sky);
}

.day-card .horse-icon {
  width: 72px;
  height: auto;
  margin: 0 auto var(--space-xs);
  display: block;
}

/* Same width as the others renders taller than them (standing pose,
   similar aspect ratio to Welcome Party's but visually heavier) —
   sized down a touch to match. */
.day-card--sky .horse-icon {
  width: 62px;
}

/* This pose's natural aspect ratio (449×299) is much wider/flatter
   than the others' — the same width as them renders it noticeably
   shorter, so it needs a bigger width to match their visual size. */
.day-card--olive .horse-icon {
  width: 110px;
}

.day-card .day-date {
  font-family: var(--font-script);
  color: var(--color-espresso);
  font-size: 1.4rem;
  line-height: 1.2;
}

.day-card .day-label {
  font-family: var(--font-body);
  font-weight: 380;
  font-stretch: 72%;
  font-variation-settings: var(--font-variation);
  color: var(--color-espresso);
  font-size: 1.1rem;
  margin-top: 2px;
}

/* Every card's time/venue info lives in a .day-event block — just
   one for Welcome Party and Farewell Brunch, two (ceremony +
   reception) for Wedding Day — so all three cards share the exact
   same spacing and type treatment. Within a block the lines (event
   name if there is one, then time, then venue) sit flush with no
   gap between them; .day-event's own margin-top is what separates
   one block from the label above it or the next block below. */
.day-card .day-event {
  margin-top: var(--space-sm);
}

.day-card .day-event-title,
.day-card .day-meta {
  margin: 0;
}

.day-card .day-event-title {
  font-family: var(--font-body);
  font-weight: 380;
  font-stretch: 72%;
  font-variation-settings: var(--font-variation);
  color: var(--color-espresso);
  font-size: 1rem;
}

.day-card .day-meta {
  font-family: var(--font-body);
  color: var(--color-espresso);
  opacity: 0.7;
  font-size: var(--font-size-sm);
  line-height: 1.3;
}

.day-card .day-desc {
  font-family: var(--font-body);
  color: var(--color-espresso);
  opacity: 0.85;
  font-size: var(--font-size-sm);
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

.day-card .day-desc strong {
  opacity: 1;
  font-weight: 600;
}

/* RSVP modal
   Same stepped "spool" frame and accent-ring border as the day-cards
   (--notch / --card-shape, defined on .day-card), and the same cream
   + olive-deep colouring as the Wedding Day card — nearly full-screen
   with margin on all sides, backdrop blurred rather than just
   darkened. */
.rsvp-modal {
  --notch: 28px;
  --card-shape: polygon(
    var(--notch) 0, calc(100% - var(--notch)) 0,
    calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%, var(--notch) 100%,
    var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)),
    0 var(--notch), var(--notch) var(--notch)
  );
  border: none;
  margin: auto;
  padding: 0;
  background: var(--color-cream);
  color: var(--color-espresso);
  width: min(560px, calc(100vw - 48px));
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  /* dvh = the screen actually visible right now (phone toolbars
     showing or not); plain vh assumes the toolbars are hidden. */
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  clip-path: var(--card-shape);
  position: fixed;
  inset: 0;
}

.rsvp-modal::before {
  content: '';
  position: absolute;
  inset: 14px;
  z-index: -2;
  background: var(--color-olive-deep);
  clip-path: var(--card-shape);
}

.rsvp-modal::after {
  content: '';
  position: absolute;
  inset: 17px;
  z-index: -1;
  background: var(--color-cream);
  clip-path: var(--card-shape);
}

.rsvp-modal::backdrop {
  background: rgba(20, 10, 6, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Inset to sit strictly inside the border ring (which is itself
   inset 14-17px from the modal's own edge) rather than spanning the
   modal's full box — otherwise scrolled content, which paints above
   the border ring's negative z-index layers, slides straight through
   it as you scroll, instead of staying inside the lines. */
/* Clipped to the frame's own stepped shape, just inside the ring, so
   content scrolls under the lines at the corners instead of over them
   (a plain rectangle cuts across the stepped corners). */
.rsvp-modal-inner {
  position: absolute;
  inset: 19px;
  clip-path: var(--card-shape);
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--space-xl) var(--space-md) 4.5rem;
}

.rsvp-modal-close {
  position: absolute;
  top: 36px;
  right: 36px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-espresso);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

/* The dialog opens with focus on its content (autofocus in the markup),
   not the close button, so the × only gets a ring when tabbed to. */
.rsvp-modal-inner:focus {
  outline: none;
}

.rsvp-modal-close:focus-visible {
  outline: 2px solid var(--color-olive-deep);
  outline-offset: 2px;
}

.rsvp-intro {
  text-align: center;
  padding: 0 var(--space-md) var(--space-md);
}

.rsvp-intro h2 {
  color: var(--color-olive-deep);
  margin-bottom: var(--space-xs);
}

.rsvp-intro p {
  font-family: var(--font-form);
  opacity: 0.75;
  margin: 0;
}

.rsvp-card {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

/* Forms
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-sm);
}

label {
  display: block;
  font-family: var(--font-body);
  font-weight: 380;
  font-stretch: 72%;
  font-variation-settings: var(--font-variation);
  margin-bottom: var(--space-xs);
}

.hint {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-espresso);
  opacity: 0.7;
  font-weight: 400;
  font-family: var(--font-form);
  margin-top: 2px;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-xs) 0.75rem;
  font-size: var(--font-size-base);
  font-family: var(--font-form);
  border: 1px solid var(--color-olive-deep);
  border-radius: var(--radius);
  background: var(--color-ivory);
  color: var(--color-espresso);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-espresso);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-espresso);
}

/* A plain native dropdown arrow looked out of place against the
   rest of the form — swap it for a custom chevron and give the
   select its own cursor/affordance. */
select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%2331140c' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px;
}

select:focus {
  box-shadow: 0 0 0 2px rgba(49, 20, 12, 0.12);
}

textarea {
  min-height: 6rem;
  padding: 0.75rem;
  resize: vertical;
}

fieldset {
  border: 1px solid var(--color-olive-deep);
  border-radius: var(--radius);
  padding: var(--space-sm);
  margin: 0 0 var(--space-sm);
}

legend {
  font-family: var(--font-body);
  font-weight: 380;
  font-stretch: 72%;
  font-variation-settings: var(--font-variation);
  padding: 0 var(--space-xs);
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-family: var(--font-form);
}

.radio-group label,
.checkbox-group label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 var(--space-sm);
  font-weight: 500;
  margin-bottom: 0;
  border: 1px solid var(--color-olive-deep);
  border-radius: 999px;
  background: var(--color-ivory);
  cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease), color 150ms var(--ease);
}

.radio-group label:has(input:checked),
.checkbox-group label:has(input:checked) {
  border-color: var(--color-espresso);
  background: var(--color-espresso);
  color: var(--color-ivory);
}

/* Single-digit guest-count pills — keep all of them on one line even
   on narrow phones, rather than letting flex-wrap break them into
   rows. Fieldsets don't shrink below their content's natural width
   by default (even with nowrap children), so min-width:0 is needed
   on the fieldset itself too, not just the flex row inside it. */
.form-group.guest-count-group {
  min-width: 0;
}

.radio-group--inline {
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.radio-group--inline label {
  flex: 1 1 0;
  gap: 0.25rem;
  padding: 0 0.4rem;
  min-width: 0;
  min-height: 40px;
  justify-content: center;
}

/* No visible checkbox/tick box — the pills themselves are the
   buttons. The input stays in the DOM (visually hidden, not
   display:none) so it's still focusable and operable by keyboard;
   the label's own filled background is the only "selected" cue. */
.radio-group input,
.checkbox-group input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.form-status {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius);
  font-family: var(--font-form);
  display: none;
}

.form-status.visible {
  display: block;
}

.form-status.success {
  background: #e7ecdf;
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.form-status.error {
  background: #fbeceb;
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.field-error {
  color: var(--color-error);
  font-family: var(--font-form);
  font-size: var(--font-size-sm);
  margin-top: 2px;
  display: none;
}

.field-error.visible {
  display: block;
}

.field-hint {
  margin: 0 0 var(--space-xs);
}

.guest-block {
  margin-bottom: var(--space-lg);
}

.guest-block legend {
  font-size: var(--font-size-lg);
}

.rsvp-submit-wrap {
  text-align: center;
  margin-top: var(--space-lg);
}

.rsvp-submit {
  padding: 0 3.2rem;
  margin-top: 0;
}

.rsvp-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Full-panel thank-you that replaces the form once an RSVP is sent. */
.rsvp-thanks {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--space-sm) var(--space-xl);
}

.rsvp-thanks[hidden] {
  display: none;
}

.rsvp-thanks-horse {
  width: 130px;
  height: auto;
  margin-bottom: var(--space-md);
}

.rsvp-thanks-script {
  font-family: var(--font-script);
  font-size: 2.4rem;
  line-height: 1.1;
  color: var(--color-espresso);
  margin: 0 0 var(--space-sm);
}

.rsvp-thanks h2 {
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  color: var(--color-olive-deep);
  margin: 0 0 var(--space-sm);
}

.rsvp-thanks p:not(.rsvp-thanks-script) {
  font-family: var(--font-form);
  opacity: 0.8;
  margin: 0;
}

.rsvp-thanks .frame-button {
  margin-top: var(--space-lg);
}

/* Accommodation slider
   ========================================================================== */
.accommodation-heading {
  text-align: center;
  padding: 0 var(--space-md) var(--space-sm);
}

.accommodation-heading h2 {
  color: var(--color-espresso);
  font-size: var(--font-size-xl);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.accommodation-intro {
  text-align: center;
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-md);
  opacity: 0.85;
}

.slider-wrap {
  position: relative;
}

.slider {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem var(--space-md) var(--space-sm);
  margin: 0 calc(var(--space-md) * -1);
  scrollbar-width: thin;
  scrollbar-color: var(--color-olive-deep) transparent;
}

.hotel-card {
  flex: 0 0 auto;
  width: min(300px, 80vw);
  scroll-snap-align: start;
  background: var(--color-cream);
  color: var(--color-espresso);
  border: 1px solid var(--color-olive-deep);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
}

.hotel-tier {
  display: inline-block;
  font-family: var(--font-form);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-espresso);
  background: transparent;
  border: 1px solid var(--color-olive-deep);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin-bottom: var(--space-xs);
  align-self: flex-start;
}

.hotel-card h3 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.hotel-rating {
  font-family: var(--font-form);
  font-size: var(--font-size-sm);
  opacity: 0.7;
  margin-bottom: var(--space-xs);
}

.hotel-price {
  font-family: var(--font-form);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.hotel-card p {
  font-family: var(--font-form);
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

.hotel-card .btn {
  margin-top: auto;
  align-self: flex-start;
  padding: 0.5rem var(--space-md);
  min-height: 40px;
  font-size: var(--font-size-sm);
  font-family: var(--font-form);
  background: transparent;
  color: var(--color-espresso);
  border: 1px solid var(--color-espresso);
  box-shadow: none;
}

.hotel-card .btn:hover {
  background: var(--color-espresso);
  color: var(--color-ivory);
}

.slider-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.slider-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-espresso);
  background: var(--color-cream);
  color: var(--color-espresso);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms var(--ease);
}

.slider-btn:hover {
  background: var(--color-ivory);
}

.slider-btn svg {
  width: 20px;
  height: 20px;
}

.accommodation-note {
  font-family: var(--font-form);
  font-size: var(--font-size-sm);
  text-align: center;
  opacity: 0.7;
  padding: 0 var(--space-md);
}

/* Footer sign-off
   The RSVP button straddles the seam between the brown section above
   and this photo, same pattern as the candid photo straddling the
   brown/olive boundary earlier on the page: absolutely positioned at
   the top edge of .site-footer, shifted up by half its own height.
   It's a sibling of .sign-off rather than nested inside it, since
   .sign-off needs overflow:hidden to crop the photo and that would
   clip the button's half that overlaps upward past the photo too. */
.site-footer {
  position: relative;
  background: var(--color-espresso);
}

/* Cropped (not the photo's full natural height) and bottom-weighted
   via object-position, so the page's very last scroll frame always
   ends on their feet instead of varying with viewport proportions —
   a wide/short viewport would otherwise cut the image off well above
   the feet, since the uncropped photo renders quite tall. */
.sign-off {
  position: relative;
  aspect-ratio: 1513 / 1850;
  overflow: hidden;
}

.sign-off-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 88%;
  display: block;
}

/* Both straddle a section seam: absolutely positioned on the top edge of
   their section, shifted up by half their own height. */
.rsvp-cta--footer,
.rsvp-cta--seam {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 20;
}

/* .rsvp-cta:hover's translateY would otherwise replace this button's
   own centering transform outright (only one `transform` wins), which
   snapped it away from its straddling position the instant you
   hovered it. Keep the same -50%/-50% centering, just lifted. */
.rsvp-cta--footer:hover,
.rsvp-cta--seam:hover {
  transform: translate(-50%, calc(-50% - 1px));
}

.footer-credit {
  text-align: center;
  padding: var(--space-md) 0;
  font-family: var(--font-body);
  color: var(--color-olive);
  font-size: var(--font-size-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Responsive
   ========================================================================== */
/* Desktop: the three day-cards sit side by side, statically — no
   pin, no flip animation (site.js skips building the ScrollTrigger
   entirely above this same breakpoint). Each gets its own fixed
   rotation for a dropped-cards look instead of the scroll-driven one
   used at narrower widths. */
@media (min-width: 1024px) {
  .weekend-stack-inner {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    height: auto;
  }

  /* position:relative (not static) so z-index works on hover —
     slightly overlapping cards, each raised above its neighbours
     when you point at it. */
  .day-card {
    position: relative;
    width: 320px;
    flex: 0 0 320px;
    z-index: 1;
    transition: transform 150ms var(--ease);
  }

  .day-card + .day-card {
    margin-left: -12px;
  }

  .day-card:hover {
    z-index: 20;
    transform: rotate(0deg) scale(1.04);
  }

  .day-card--rust {
    transform: rotate(-4deg);
  }

  /* Wedding Day sits on top of the overlapping stack by default (not
     just on hover) — it's the main event, the other two are either
     side of it. */
  .day-card--olive {
    transform: rotate(3deg);
    margin-top: var(--space-md);
    z-index: 2;
  }

  .day-card--sky {
    transform: rotate(-3deg);
  }

  /* Desktop footer photo: a fixed, "regular" footer-band height
     instead of mobile's aspect-ratio box (which on a wide viewport
     would render far too short to read as a photo), cropped to show
     their faces instead of mobile's feet-weighted crop. */
  .sign-off {
    aspect-ratio: auto;
    height: 560px;
  }

  .sign-off-photo {
    object-position: center 30%;
  }

  .rsvp-note {
    font-size: 3.4rem;
  }
}

@media (max-width: 640px) {
  :root {
    --space-xl: 2.75rem;
    --space-lg: 1.75rem;
  }

  .radio-group,
  .checkbox-group {
    gap: 0.5rem;
  }

  .radio-group label,
  .checkbox-group label {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* RSVP form on phones: the modal margin, its frame, the inner padding
     and boxes nested inside boxes left the fields barely 60% of the
     screen wide. Widen the modal, trim the padding, and drop the
     outline around each event so guests' boxes don't nest. */
  .rsvp-modal {
    width: calc(100vw - 20px);
    max-width: none;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
  }

  .rsvp-modal-inner {
    padding: var(--space-xl) var(--space-sm) 4.5rem;
  }

  .guest-block {
    padding: var(--space-sm) 0.75rem;
  }

  /* A smaller blur for the animated card stack: the phone has to redraw
     each card's shadow as it scales and moves, and a large blur radius
     is expensive enough to make the animation stutter on iPhones. */
  .day-card::before {
    filter: blur(16px);
  }

  /* Tighter cards on phones so the pinned stack fits under the logo
     and header with the browser's toolbars showing; the wider text
     area also wraps onto fewer lines. site.js shrinks the stack
     further if it still doesn't fit. */
  .day-card-face {
    padding: 2.5rem 2rem 2.25rem;
  }

  .guest-block fieldset {
    border: 0;
    padding: 0;
    margin: var(--space-sm) 0 0;
  }

  .guest-block fieldset legend {
    padding: 0;
    margin-bottom: var(--space-xs);
  }

  .guest-block fieldset + .form-group {
    margin-top: var(--space-md);
  }
}

/* Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
