/* ═══════════════════════════════════════════════════════════════════════
   stationery-save-the-date-digital-flyer-big-date — "The Big Date"
   --------------------------------------------------------------------
   A wide, editorial save-the-date flyer: the date is the hero, circled
   on a faint paper dot-grid, with one-tap "Add to calendar".

   Design tokens → shell → panels → cover → details → photos (gallery)
   → RSVP → guestbook → pager → a11y → print → reduced-motion → no-JS fallback.
   ═════════════════════════════════════════════════════════════════════ */

/* ── 1 · Tokens ─────────────────────────────────────────────────────── */
:root {
  --paper:      #f6f0e4;   /* warm ivory sheet        */
  --paper-2:    #efe7d3;   /* recessed paper          */
  --ink:        #2e2a23;   /* warm charcoal ink       */
  --ink-soft:   #5d564a;   /* secondary text          */
  --muted:      #857c6c;   /* tertiary text           */
  --hairline:   #e0d5bb;   /* rules & borders         */
  --accent:     #c05c38;   /* terracotta (the ring)   */
  --accent-deep:#a0492a;   /* hover / focus           */
  --gold:       #b18d4f;   /* foil accents            */
  --white:      #fffdf8;
  --err:        #b3542f;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ── 2 · Reset & base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, h1, h2, h3, dl, dd { margin: 0; }

button { font: inherit; color: inherit; }

/* ── 3 · The single-viewport shell ──────────────────────────────────── */
.invite-shell {
  height: 100vh;               /* fallback for older browsers */
  height: 100dvh;              /* dynamic viewport (mobile UI) */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(rgba(177,141,79,.10) 1px, transparent 1.4px) 0 0 / 26px 26px,
    var(--paper);
}

/* ── 4 · Masthead (fixed; never scrolls) ────────────────────────────── */
.invite-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem max(1.25rem, env(safe-area-inset-left)) .9rem max(1.25rem, env(safe-area-inset-right));
  border-bottom: 1px solid var(--hairline);
  background: rgba(246,240,228,.92);
}

.monogram {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .28em;
}
.monogram .amp { color: var(--accent); letter-spacing: 0; padding: 0 .1em; }

.guest-greeting {
  margin-left: auto;
  font-size: .82rem;
  letter-spacing: .06em;
  color: var(--accent-deep);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.guest-greeting[hidden] { display: none; }

.head-rule {
  flex: 0 0 2px;
  width: 2px;
  height: 14px;
  background: var(--gold);
  opacity: .55;
}

/* ── 5 · Panels — only the active one is visible & scrolls ──────────── */
.invite-panels {
  flex: 1 1 auto;
  min-height: 0;               /* lets children scroll instead of growing */
  overflow: hidden;
  position: relative;
}

.panel {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.js .panel { display: none; }
.js .panel.is-active {
  display: flex;
  flex-direction: column;
  animation: panel-in .45s var(--ease);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel:focus { outline: none; }

/* Inner column — margin:auto centres vertically and still scrolls from
   the top when the content is taller than the viewport. */
.panel-inner {
  margin: auto;
  width: 100%;
  max-width: 52rem;
  padding: 2.2rem max(1.5rem, env(safe-area-inset-left)) 4rem max(1.5rem, env(safe-area-inset-right));
  text-align: center;
}

/* ── 6 · Shared labels ──────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow-rule { width: 2.4rem; height: 1px; background: var(--gold); opacity: .7; }

.panel-index {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: .2em;
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.7rem);
  line-height: 1.1;
  margin-top: .15rem;
}

.panel-sub {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-top: .7rem;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

/* ── 7 · Cover — the date is the hero ───────────────────────────────── */
.d-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: .01em;
  margin-top: 1.3rem;
}
.d-title .amp {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  padding: 0 .12em;
}

.d-tagline {
  color: var(--ink-soft);
  font-size: clamp(.98rem, 2.6vw, 1.12rem);
  line-height: 1.6;
  max-width: 30rem;
  margin: .7rem auto 0;
}

/* The big date: month / circled day / year, stacked */
.date-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1.2rem, 4vh, 2.4rem);
}

.d-month {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  letter-spacing: .38em;
  text-indent: .38em;          /* optically recentre letter-spaced text */
  text-transform: uppercase;
  color: var(--accent-deep);
}

.d-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(8.5rem, 34vw, 13.5rem);
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  border-radius: 50%;
  margin: .55rem 0 .45rem;
}
.d-ring::before {
  content: "";
  position: absolute;
  inset: -0.85rem;
  border: 1px dashed var(--gold);
  border-radius: 50%;
  opacity: .85;
}
.d-ring::after {
  content: "";
  position: absolute;
  inset: .45rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255,253,248,.0) 60%, rgba(192,92,56,.07) 100%);
  pointer-events: none;
}
.d-day {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.4rem, 15vw, 6rem);
  line-height: 1;
  color: var(--ink);
}

.d-year {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.8vw, 2.3rem);
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--gold);
}

.d-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .65rem;
  margin-top: 1.1rem;
  color: var(--ink-soft);
}
.d-weekday {
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  font-size: .82rem;
}
.d-sep { color: var(--accent); font-size: .9rem; }
.d-time { font-size: 1rem; }

.d-place {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 3.6vw, 1.55rem);
  color: var(--accent-deep);
  margin-top: .8rem;
}

.d-note {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
  max-width: 26rem;
  margin: .8rem auto 0;
}

/* private-link chip — shown by JS only on /s/ token links */
.private-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: 1.1rem;
  padding: .45rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--white);
  font-size: .82rem;
  color: var(--ink-soft);
}
.private-chip[hidden] { display: none; }
.private-chip svg { color: var(--accent); }

/* optional cover backdrop photo — delete .cover-photo-wrap to go image-free */
.panel-inner.cover { position: relative; }

.cover-photo-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.cover-photo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* a soft paper wash keeps the ink text legible while the photo shows through */
.cover-photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(246,240,228,.92) 0%,
    rgba(246,240,228,.76) 34%,
    rgba(246,240,228,.86) 68%,
    rgba(246,240,228,.95) 100%);
}
.cover-content { position: relative; }

/* a missing/broken photo collapses its slot (or whole card) so the
   invitation never shows a broken-image icon or an empty hole */
.photo-slot.is-empty-photo,
.gallery-card.is-empty-photo { display: none !important; }

/* gentle "view photo" affordance on the cover backdrop — the photo is
   clickable either way; this makes it discoverable and keyboard-usable */
.cover-photo-open {
  position: absolute;
  right: .9rem;
  bottom: .9rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border: 1px solid rgba(255,253,248,.55);
  border-radius: 999px;
  background: rgba(46,42,35,.45);
  color: var(--white);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background-color .18s, transform .18s var(--ease);
}
.cover-photo-open:hover { background: rgba(46,42,35,.68); transform: translateY(-1px); }
.cover-photo-open:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* clicking the photo itself also opens the lightbox */
.cover-photo-wrap img { cursor: zoom-in; }
.cover-photo-wrap.is-empty-photo .cover-photo-open { display: none; }

/* ── 8 · Cover CTAs ─────────────────────────────────────────────────── */
.cover-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .95rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s, border-color .18s;
  min-height: 48px;           /* comfortable touch target */
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 10px 24px -12px rgba(160,73,42,.65);
}
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--accent-deep); }

.btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.scroll-hint {
  margin-top: 2.2rem;
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--muted);
}
.scroll-arrow {
  display: inline-block;
  margin-left: .5rem;
  color: var(--accent);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ── 9 · Details panel ──────────────────────────────────────────────── */
.details { text-align: left; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.1rem;
  margin-top: 2.4rem;
}
@media (min-width: 860px) {
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}

.detail-item {
  border-top: 1px solid var(--hairline);
  padding-top: 1.2rem;
}

.detail-item dt {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .85rem;
}
.detail-item dt svg { color: var(--accent); flex: 0 0 auto; }

.detail-item dd { line-height: 1.55; }
.detail-item dd + dd { margin-top: .35rem; }

.d-venue {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}
.d-address { color: var(--muted); font-size: .95rem; }

.d-date { font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 1.45rem); }
.d-time  { color: var(--muted); font-size: .95rem; }
.d-more  { font-family: var(--font-display); font-style: italic; color: var(--accent-deep); font-size: 1.02rem; }

.note { color: var(--ink-soft); font-size: .98rem; }
.note::before { content: "✦ "; color: var(--gold); font-size: .72rem; vertical-align: .08em; }

/* optional official flyer / banner — delete the <figure> to hide it.
   Framed like a poster so guests can confirm they're in the right place. */
.banner-flyer {
  margin: 2.6rem auto 0;
  max-width: 34rem;
  text-align: center;
  border-top: 1px solid var(--hairline);
  padding-top: 1.8rem;
}
.banner-flyer a {
  display: block;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: .45rem;
  background: var(--white);
  box-shadow: 0 18px 40px -24px rgba(46,42,35,.45);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.banner-flyer a:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 24px 48px -24px rgba(46,42,35,.5);
}
.banner-flyer a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.banner-flyer figcaption {
  margin-top: .8rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: .92rem;
  color: var(--muted);
}
.banner-flyer a img { cursor: zoom-in; }

/* ── 10 · Gallery (optional photos) ────────────────────────────────── */
.gallery-section {
  margin: auto;
  width: 100%;
  max-width: 52rem;
  padding: 2.4rem max(1.5rem, env(safe-area-inset-left)) 4rem max(1.5rem, env(safe-area-inset-right));
  text-align: center;
}

.gallery-title { margin-top: .15rem; }
.gallery-description { margin-top: .7rem; color: var(--muted); line-height: 1.6; }

/* gallery photos are clickable → lightbox with zoom */
.gallery-photo img { cursor: zoom-in; }
.gallery-photo img:focus-visible { outline: 3px solid var(--gold); outline-offset: -4px; }

/* ── 10b · The Film (optional video feature) ────────────────────────── */
.film-section {
  margin: auto;
  width: 100%;
  max-width: 52rem;
  padding: 2.4rem max(1.5rem, env(safe-area-inset-left)) 4rem max(1.5rem, env(safe-area-inset-right));
  text-align: center;
}

.film-title { margin-top: .15rem; }
.film-description { margin-top: .7rem; color: var(--muted); line-height: 1.6; }

/* .film-card accepts any video URL in data-video-url and lazy-loads an
   <iframe> when the guest taps play. Delete .film-card (or its whole
   panel) to hide the feature. */
.film-card {
  margin: 2rem auto 0;
  max-width: 44rem;
}

.film-frame {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;   /* 16:9 via padding — works in every browser */
  overflow: hidden;
  background:
    radial-gradient(rgba(177,141,79,.14) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--paper-2);
  border: 1px solid var(--hairline);
  box-shadow: 0 24px 48px -28px rgba(46,42,35,.5);
}
.film-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,253,248,.35);
  pointer-events: none;
}

.film-open {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.film-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the play chip floats over the poster */
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(246,240,228,.92);
  color: var(--accent-deep);
  box-shadow: 0 14px 34px -12px rgba(46,42,35,.6);
  transition: transform .2s var(--ease), background-color .2s;
}
.film-play svg { width: 26px; height: 26px; margin-left: 3px; }
.film-open:hover .film-play,
.film-open:focus-visible .film-play {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--white);
}
.film-open:focus-visible { outline: 3px solid var(--gold); outline-offset: -6px; }

.film-hint {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  padding: .35rem 1rem;
  border-radius: 999px;
  background: rgba(46,42,35,.55);
  color: var(--white);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

/* the lazily-loaded embed fills the frame once playing */
.film-frame.is-playing::after { display: none; }
.film-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* gentle note when the host hasn't set a video URL yet */
.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.6;
  text-align: center;
}

.film-external {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: 1.1rem;
  padding: .6rem 1.3rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .18s, color .18s;
}
.film-external:hover { border-color: var(--gold); color: var(--accent-deep); }
.film-external:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.film-external[hidden] { display: none; }

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.7rem;
  margin-top: 2.2rem;
}
@media (min-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* scrapbook polaroid cards — one figure per photo */
.gallery-card {
  margin: 0;
  padding: .7rem .7rem .95rem;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: 0 14px 30px -20px rgba(46,42,35,.5);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.gallery-card:nth-child(odd)  { --tilt: -1.1deg; }
.gallery-card:nth-child(even) { --tilt:  1.1deg; }
.gallery-card:hover {
  transform: rotate(var(--tilt, 0deg)) translateY(-3px);
  box-shadow: 0 18px 36px -20px rgba(46,42,35,.55);
}

/* 4:5 slot via padding-bottom — works in every browser; the dot-grid
   shows while the image loads or if it is missing */
.gallery-photo {
  position: relative;
  height: 0;
  padding-bottom: 125%;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(rgba(177,141,79,.14) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--paper-2);
}
.gallery-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.gallery-card:hover .gallery-photo img { transform: scale(1.045); }

.gallery-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-soft);
  margin-top: .7rem;
}

/* ── 10c · Optional free page (repeatable note blocks) ────────────────
   A bonus panel: repeatable title + text blocks with an optional photo
   each. The whole panel drops out (pager pill too) when every block is
   empty, the host hides/deletes the section, or the cockpit's Free Page
   switch is off. */
.free-section {
  margin: auto;
  width: 100%;
  max-width: 52rem;
  padding: 2.4rem max(1.5rem, env(safe-area-inset-left)) 4rem max(1.5rem, env(safe-area-inset-right));
  text-align: center;
}

.free-blocks {
  display: grid;
  gap: 1.6rem;
  margin-top: 2.2rem;
  text-align: left;
}

.free-block {
  padding: 1.7rem 1.8rem 1.8rem;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 14px 30px -20px rgba(46,42,35,.5);
}

.free-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 3.4vw, 1.5rem);
  line-height: 1.25;
  color: var(--accent-deep);
  margin-bottom: .55rem;
}

.free-content {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
  white-space: pre-line;
}
.free-content p { margin: 0 0 .6rem; }
.free-content p:last-child { margin-bottom: 0; }

/* the optional block photo — a framed figure; tapping it opens the
   full-size image in the lightbox with zoom, like every other photo */
.free-figure {
  margin: 1.4rem 0 0;
  padding: .4rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper);
}
.free-figure[hidden] { display: none; }
.free-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: zoom-in;
}
.free-figure img:focus-visible { outline: 3px solid var(--gold); outline-offset: -4px; }

.free-cap {
  margin-top: .7rem;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: .92rem;
  color: var(--muted);
}

/* ── 11 · RSVP panel (inside .rsvp-wrap) ────────────────────────────── */
.rsvp-wrap {
  margin: auto;
  width: 100%;
  max-width: 36rem;
  padding: 2.4rem max(1.5rem, env(safe-area-inset-left)) 4rem max(1.5rem, env(safe-area-inset-right));
  text-align: left;
}

.rsvp-title { margin-top: .15rem; }
.rsvp-description { margin-top: .7rem; color: var(--muted); line-height: 1.6; }

/* deadline countdown */
.countdown {
  margin-top: 1.5rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--paper-2);
}
.countdown.is-off { display: none; }

.countdown-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  margin-top: .7rem;
}

.count-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  padding: .5rem 0;
  border-radius: 12px;
  background: var(--white);
}
.count-box > span:first-child {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.count-tag {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown-closed {
  margin-top: .7rem;
  text-align: center;
  font-size: .88rem;
  color: var(--accent-deep);
}
.countdown.is-expired .countdown-grid { opacity: .35; }
.countdown.is-expired .countdown-closed { display: block; }
.countdown.is-expired .countdown-closed[hidden] { display: block; }

/* the form */
#rsvp-form { margin-top: 1.6rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 1.4rem;
}
@media (min-width: 560px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.form-group { margin-bottom: 1.35rem; }

.form-group label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .45rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  padding: .6rem .1rem;
  transition: border-color .18s;
  appearance: none;
  -webkit-appearance: none;
}

.form-group textarea { resize: vertical; min-height: 3rem; line-height: 1.5; }

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b18d4f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .2rem center;
  padding-right: 1.8rem;
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #b3a891; }

.error {
  display: block;
  min-height: 1.15em;
  font-size: .8rem;
  color: var(--err);
  margin-top: .3rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: .4rem;
}

#submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .95rem 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-size: .98rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  box-shadow: 0 10px 24px -12px rgba(160,73,42,.65);
  transition: background-color .18s, transform .18s var(--ease);
}
#submit-button:hover { background: var(--accent-deep); transform: translateY(-1px); }
#submit-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.loading {
  font-size: .88rem;
  color: var(--muted);
  letter-spacing: .06em;
}

/* ── 12 · Guestbook (Style A mount; injected markup styled below) ───── */
.guestbook-section {
  margin: auto;
  width: 100%;
  max-width: 36rem;
  padding: 2.4rem max(1.5rem, env(safe-area-inset-left)) 4rem max(1.5rem, env(safe-area-inset-right));
  text-align: left;
}

.guestbook-title { margin-top: .15rem; }
.guestbook-description { margin-top: .7rem; color: var(--muted); line-height: 1.6; }

/* ── 12b · Feature-wrapper classes live ON the section ────────────────
   The platform gate removes .rsvp-wrap / .guestbook-section wholesale,
   so these classes sit on the <section> itself — the whole panel (and
   its pager pill) disappears when the feature is off. Keep short content
   vertically centred like the other panels (safe: tall content still
   scrolls from the top), and never show a broken-image icon when the
   host left a photo empty (no-JS fallback; main.js collapses it with JS). */
.js .panel.is-active.rsvp-wrap,
.js .panel.is-active.guestbook-section { justify-content: safe center; }
.photo-slot img[src=""],
.film-open img[src=""] { visibility: hidden; }

/* the platform injects the functional form + list into .guestbook-body;
   style the injected classes so it reads as part of the design. */
.guestbook-body { margin-top: 1.6rem; }

.guestbook-body form { margin-bottom: 1.8rem; }

.guestbook-body .form-control {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  padding: .6rem .1rem;
  margin-bottom: .25rem;
}
.guestbook-body .form-control:focus { outline: none; border-bottom-color: var(--accent); }

.guestbook-body textarea.form-control { resize: vertical; min-height: 5rem; line-height: 1.5; }

.guestbook-body .error { display: block; min-height: 1.1em; font-size: .8rem; color: var(--err); }

.guestbook-body button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 46px;
  margin-top: .6rem;
}
.guestbook-body button[type="submit"]:hover { background: var(--accent-deep); }

.guestbook-body .loading-guestbook { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.guestbook-body .guestbook-chapta { margin-top: .8rem; }

.guestbook-wrap { border-top: 1px solid var(--hairline); }
.guestbook-entry {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--hairline);
}
.guestbook-entry:last-child { border-bottom: 0; }
.guestbook-entry h5 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 .25rem;
}
.guestbook-entry p { margin: 0 0 .2rem; line-height: 1.55; color: var(--ink-soft); }
.guestbook-entry small { font-size: .76rem; color: var(--muted); }

.more-guestbook-wrap { margin-top: 1rem; text-align: center; }
#load-more {
  padding: .7rem 1.5rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}
#load-more:hover { border-color: var(--gold); color: var(--accent-deep); }

/* thank-you panel the platform swaps in after a successful guestbook post */
.guestbook-body .thank-you-message {
  text-align: center;
  padding: 1.7rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--paper-2);
}
.guestbook-body .thank-you-message h4 {
  margin: 0 0 .4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
}
.guestbook-body .thank-you-message p { margin: 0; color: var(--muted); }

/* ── 12b · Brand footer placeholder ────────────────────────────────────
   Written after the shell; JS tucks it into the last panel so it closes
   the invite. The platform swaps the text/logo. */
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 1.1rem 1.5rem calc(1.1rem + env(safe-area-inset-bottom));
  margin-top: 2.6rem;
  border-top: 1px solid var(--hairline);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.footer-brand-mark { color: var(--accent); font-size: .8rem; }

/* ── 12c · Full-width powered-by brand strip (platform line) ──────────
   Sits below the pager, inside the shell, so it always closes the invite
   at full width. The engine swaps the literal Kundangi token for the app
   name at render; the editor's "Free Powered By" field can override the
   whole line (.powered-by-text). */
.powered-by {
  flex: 0 0 auto;
  width: 100%;
  padding: .55rem max(1rem, env(safe-area-inset-left)) calc(.55rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-right));
  text-align: center;
  border-top: 1px solid var(--hairline);
  background: rgba(246,240,228,.94);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.powered-by-text { margin: 0; }
.powered-by a { color: inherit; text-decoration: none; }
.powered-by a:hover { color: var(--accent-deep); }

/* ── 13 · Pager (fixed bottom rail; never scrolls) ──────────────────── */
.invite-pager {
  flex: 0 0 auto;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;               /* clean rail; the pills show position */
  padding: .6rem max(1rem, env(safe-area-inset-left)) calc(.6rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-right));
  border-top: 1px solid var(--hairline);
  background: rgba(246,240,228,.94);
}
.invite-pager::-webkit-scrollbar { display: none; }

/* the track centres when it fits; scrolls from the left when it doesn't */
.pager-track {
  display: flex;
  gap: .4rem;
  margin: 0 auto;
  width: max-content;
  max-width: 100%;
}

.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  min-height: 48px;                    /* comfortable touch target */
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s, color .18s;
}

.pager-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
  transition: opacity .18s, transform .18s var(--ease);
}

.pager-label { display: inline; }      /* labels always visible — the bar is
                                          the navigation, not just dots */

.pager-btn:hover { color: var(--ink); }
.pager-btn:hover .pager-dot { opacity: .8; }

.pager-btn.is-active { background: var(--white); color: var(--accent-deep); box-shadow: 0 2px 10px -4px rgba(46,42,35,.25); }
.pager-btn.is-active .pager-dot { opacity: 1; transform: scale(1.15); background: var(--accent); }

.pager-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.pager-btn.is-pruned { display: none; }
.invite-pager.is-single { display: none; }

/* prev / next icon buttons — shown on small screens so guests can always
   step between sections even when the labelled pill track overflows the
   viewport and scrolls sideways */
.pager-arrow {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--white);
  color: var(--accent-deep);
  cursor: pointer;
  transition: border-color .18s, color .18s;
}
.pager-arrow:hover { border-color: var(--gold); color: var(--accent); }
.pager-arrow:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pager-arrow svg { flex: 0 0 auto; }

@media (max-width: 768px) {
  .invite-pager { display: flex; align-items: center; gap: .2rem; }
  .pager-arrow { display: inline-flex; }
  .pager-track { flex: 1 1 auto; min-width: 0; margin: 0; overflow-x: auto; }
}

/* ── 14 · Utilities & a11y ──────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: .75rem;
  top: .75rem;
  z-index: 50;
  padding: .6rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-size: .85rem;
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

[data-empty="hide"].is-empty { display: none !important; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: .88rem;
  box-shadow: 0 14px 34px -14px rgba(46,42,35,.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: calc(100vw - 2rem);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { color: var(--gold); flex: 0 0 auto; }

/* ── 14b · Photo lightbox — tap any photo to view it full-screen & zoom ─
   Every photo (cover backdrop, gallery card, official flyer/banner) opens
   here. Zoom via buttons, clicking the image, the mouse wheel, or +/- keys;
   drag to pan when zoomed; ESC / ✕ / backdrop click closes. */
.lightbox {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  padding: 1.25rem;
  background: rgba(24,21,17,.94);
  opacity: 0;
  transition: opacity .22s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

/* the zoomable image; transform is driven by JS (scale + pan) */
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  border-radius: 10px;
  border: 1px solid rgba(251,246,234,.18);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.85);
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform .28s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}
.lightbox-img.is-zoomed { cursor: grab; touch-action: none; }
.lightbox-img.is-zoomed.is-dragging { cursor: grabbing; }
.lightbox-img[hidden] { display: none; }

.lightbox-caption {
  font-size: .9rem;
  font-style: italic;
  color: rgba(251,246,234,.75);
  text-align: center;
  padding: 0 1rem;
}
.lightbox-caption:empty { display: none; }

/* zoom toolbar */
.lightbox-tools {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem;
  border-radius: 999px;
  background: rgba(251,246,234,.12);
  backdrop-filter: blur(8px);
}
.lightbox-tools[hidden] { display: none; }
.lightbox-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 46px;
  min-height: 46px;
  padding: 0 .8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .18s;
}
.lightbox-tool:hover { background: rgba(251,246,234,.16); }
.lightbox-tool:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lightbox-tool svg { flex: 0 0 auto; }
.lightbox-tool .tool-label { letter-spacing: .04em; }
@media (max-width: 380px) {
  .lightbox-tool .tool-label { display: none; }   /* icons only on tiny screens */
}

.lightbox-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.6);
}
.lightbox-close:hover { background: var(--paper-2); }
.lightbox-close:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* hint shown while zoomed (and not dragging) */
.lightbox-hint {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: .74rem;
  letter-spacing: .06em;
  color: rgba(251,246,234,.55);
  pointer-events: none;
}
.lightbox-hint[hidden] { display: none; }

/* ── 15 · Print: the invitation as a sheet of paper ─────────────────── */
@media print {
  html, body { height: auto; background: #fff; }

  .invite-shell {
    height: auto;
    display: block;
    overflow: visible;
    background: #fff;
  }

  .invite-head, .invite-pager, .skip-link, .scroll-hint, .cover-cta, .private-chip, .cover-photo-open {
    display: none !important;
  }

  .invite-panels { overflow: visible; }

  .js .panel,
  .panel {
    display: block !important;
    height: auto;
    min-height: 0;
    overflow: visible;
    animation: none;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 2rem;
  }

  .panel-inner, .rsvp-wrap, .guestbook-section, .gallery-section, .free-section {
    max-width: 100%;
    padding: 0;
  }

  .cover-photo-wrap { position: static; height: 15rem; margin-bottom: 1.6rem; border-radius: 12px; box-shadow: none; }
  .cover-photo-scrim { background: rgba(246,240,228,.5); }
  .gallery-card { transform: none; box-shadow: none; }
  .gallery-card:hover .gallery-photo img { transform: none; }

  .guestbook-body, #rsvp-form, .countdown, .powered-by { display: none !important; }

  .lightbox { display: none !important; }
  .film-frame iframe { display: none; }   /* a playing video can't print — the poster prints instead */
  .footer-brand { margin-top: 0; padding: 1rem 0 0; }
  .banner-flyer a { box-shadow: none; }

  .d-ring::before { inset: -0.4rem; }
}

/* ── 16 · Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
  .js .panel.is-active { animation: none; }
  .scroll-arrow { animation: none; }
}
