/* ═══════════════════════════════════════════════════════════════════════
   Cellar Notes — Vineyard Romance Wedding · Invitation Card
   Wine-room backdrop · cream vellum cellar card · gold foil · grape motifs
   Cormorant Garamond + Great Vibes (script) + Jost (UI)

   Structure:
     1. Design tokens & fonts
     2. Base / reset
     3. App shell (single-viewport, one active panel) + no-JS fallback
     4. Masthead + action chips
     5. Tabs (generated by main.js)
     6. Panel 1 · the cellar card (invitation)
     7. Countdown tiles (self-driven ceremony countdown)
     8. Panels 2–4 · shared content ground (heads, timeline, venues, notes)
     9. RSVP form + RSVP deadline strip + injected states
    10. Guestbook injected markup
    11. Personalisation
    12. Reveals
    13. Reduced motion
    14. Print
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. tokens & fonts ───────────────────────────────────────────────── */
:root {
  --bg: #2e0f16;              /* deep wine room */
  --bg-deep: #200a10;
  --card: #faf3e7;            /* vellum paper */
  --card-edge: #f1e5d2;
  --ink: #2b1a1e;             /* warm near-black */
  --ink-soft: #553a3f;
  --muted: #8a6f6a;
  --wine: #5b1f2b;
  --wine-deep: #3c131d;
  --wine-mid: #7e2b3c;
  --merlot: #a2444d;
  --gold: #b98d3e;
  --gold-bright: #d4af5f;
  --gold-deep: #8a6426;
  --blush: #f0d9cf;
  --sage: #7b8768;
  --line: rgba(43, 26, 30, 0.16);
  --line-gold: rgba(185, 141, 62, 0.5);
  --danger: #b0402f;
  --shadow: 0 30px 70px rgba(12, 3, 7, 0.55);
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-script: "Great Vibes", "Snell Roundhand", "Segoe Script", cursive;
  --font-ui: "Jost", ui-sans-serif, system-ui, sans-serif;
}

/* ── 2. base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 110% 70% at 50% -14%, rgba(160, 68, 77, 0.28), transparent 55%),
    radial-gradient(ellipse 90% 65% at 50% 118%, rgba(185, 141, 62, 0.12), transparent 62%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--gold); color: #fff; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* hidden inline SVG sprite */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ── 3. single-viewport shell (JS on) ────────────────────────────────── */
html.js .app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  /* Single column that can always shrink to the viewport: without this the
     implicit auto track sizes to the widest content (e.g. the invitation
     card's 562px max-content) and clips the shell on phones. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

html.js .panel { display: none; }
html.js .panels {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html.js .panel.is-active {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

/* hero panels (the card) centre their content when there's room */
html.js .panel.hero-panel.is-active { display: flex; }
html.js .panel.hero-panel.is-active > * { margin: auto; }

/* ── no-JS fallback: everything stacked, page scrolls ─────────────────── */
html:not(.js) .app { display: block; height: auto; }
html:not(.js) .panel { display: block; }
html:not(.js) .tabs { display: none; }
html:not(.js) .tabs-bar { display: none; }
html:not(.js) .panel.is-active { overflow: visible; }

/* ── 4. masthead ─────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(14px, 3vw, 28px);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(46, 15, 22, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--card);
  border-bottom: 1px solid var(--line-gold);
  box-shadow: 0 2px 14px rgba(12, 3, 7, 0.4);
  position: relative;
  z-index: 5;
}

.masthead__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.masthead__mark { display: inline-flex; flex: none; opacity: 0.95; }
.masthead__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.masthead__top {
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.masthead__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masthead__name i { color: var(--gold-bright); font-style: italic; padding: 0 2px; }

.masthead__actions { display: flex; align-items: center; gap: 8px; flex: none; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-gold);
  background: rgba(250, 243, 231, 0.1);
  color: var(--card);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.18s ease, transform 0.18s ease;
}
.chip-btn:hover {
  background: rgba(250, 243, 231, 0.18);
  transform: translateY(-1px);
}
.chip-btn svg { flex: none; opacity: 0.85; }
.chip-btn.is-done { color: var(--gold-bright); border-color: var(--gold); }

@media (max-width: 460px) {
  /* icon-only chips on tiny screens — the aria-labels carry the text */
  .chip-btn { padding: 9px 11px; }
  .chip-btn__label { display: none; }
}

/* ── 5. tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  background: rgba(32, 10, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(185, 141, 62, 0.35);
  position: relative;
  z-index: 4;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;               /* the rail scrolls silently on touch */
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }
.tab { scroll-snap-align: start; }

.tab {
  flex: none;
  padding: 9px 16px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(250, 243, 231, 0.72);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.tab:hover { color: var(--card); }
.tab[aria-selected="true"] {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
  font-weight: 600;
}

@media (max-width: 560px) {
  /* bigger, easier-to-tap tabs on phones — the rail scrolls horizontally */
  .tab { padding: 11px 13px 12px; font-size: 12px; }
}

/* prev/next arrows for the tab rail — revealed by main.js only when the
   rail overflows (phones and narrow windows); each button hides itself
   once the strip reaches its end */
.tabs-bar {
  display: flex;
  align-items: stretch;
  background: rgba(32, 10, 16, 0.85);
  border-bottom: 1px solid rgba(185, 141, 62, 0.35);
}
.tabs-bar .tabs {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 0;
  background: transparent;
}
.tabs-scroll {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(185, 141, 62, 0.22);
  background: rgba(250, 243, 231, 0.05);
  color: rgba(250, 243, 231, 0.78);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.tabs-scroll--prev { border-left: 0; border-right: 1px solid rgba(185, 141, 62, 0.22); }
.tabs-scroll:hover { background: rgba(250, 243, 231, 0.14); color: var(--card); }
.tabs-scroll:disabled { opacity: 0.35; cursor: default; }
.tabs-scroll:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: -2px; }

/* ── 6. panel 1 · the cellar card ────────────────────────────────────── */
.panel-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(22px, 4.5vw, 44px) clamp(16px, 4vw, 32px) 60px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 620px;
  padding: 52px clamp(24px, 6vw, 60px) 42px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--gold);
  box-shadow: var(--shadow);
  margin: auto;
}

/* the wine-label double frame */
.card::before,
.card::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  border: 1px solid rgba(185, 141, 62, 0.6);
  pointer-events: none;
}
.card::after {
  left: 16px;
  right: 16px;
  top: 16px;
  bottom: 16px;
  border-color: rgba(185, 141, 62, 0.22);
}

.card__corner { position: absolute; width: 30px; height: 30px; color: var(--gold-deep); opacity: 0.85; }
.card__corner svg { display: block; width: 100%; height: 100%; }
.card__corner--tl { top: 0; left: 0; }
.card__corner--tr { top: 0; right: 0; transform: scaleX(-1); }
.card__corner--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.card__corner--br { bottom: 0; right: 0; transform: scale(-1); }

.card__greeting {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15.5px;
  color: var(--wine-mid);
}
.card__greeting b { font-weight: 600; color: var(--wine); }

.card__seal { margin: 0 0 14px; }
.card__seal svg { margin: 0 auto; filter: drop-shadow(0 6px 14px rgba(60, 19, 29, 0.35)); }

.card__cellar {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.card__vintage {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--merlot, #a2444d);
}

.card__request {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
}
.card__request .card__sub {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
}

.card__names {
  margin: 18px 0 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 68px);
  line-height: 1.12;
  color: var(--wine);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.28em;
  flex-wrap: wrap;
}
.card__amp {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 0.4em;
  color: var(--gold);
}

.card__ornament {
  width: 200px;
  margin: 14px auto 0;
  color: var(--gold-deep);
}
.card__ornament svg { width: 100%; height: auto; display: block; }

.card__date {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--wine);
}
.card__date em { font-weight: 400; font-style: italic; color: var(--ink-soft); }

.card__place {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}
.card__place span {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.card__place span + span {
  margin-top: 6px;
}

.card__dress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 0;
  justify-content: center;
}
.card__dress span { flex: 1; max-width: 90px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.card__dress span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.card__dress p {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.card__reply {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* couple cover — a large framed photo at the top of the card, like the
   cover of a printed invitation; the inner gold hairline echoes the card's
   wine-label double frame. Delete the <figure> to hide it. */
.card__cover {
  position: relative;
  margin: 0 0 clamp(24px, 4vh, 34px);
  padding: 7px;
  background: var(--card);
  border: 1px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(60, 19, 29, 0.22);
}
.card__cover::before {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(185, 141, 62, 0.55);
  border-radius: 5px;
  pointer-events: none;
  z-index: 1;
}

/* the cover is a real <button> — click to open the photo viewer */
.card__cover-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 5px;
  overflow: hidden;
  cursor: zoom-in;
}
.card__cover-btn img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.card__cover-btn:hover img,
.card__cover-btn:focus-visible img { transform: scale(1.03); }
.card__cover-btn:focus-visible { outline-offset: 4px; }

/* ── 7. countdown tiles (ceremony — self-driven) ─────────────────────── */
.countdown-tiles { margin: 8px 0 4px; }
.countdown-tiles__label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 380px;
}

.tile {
  padding: 10px 4px 8px;
  border: 1px solid rgba(91, 31, 43, 0.22);
  border-radius: 10px;
  background: rgba(91, 31, 43, 0.05);
}
.tile-num {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--wine);
  font-variant-numeric: tabular-nums;
}
.tile-cap {
  display: block;
  margin-top: 5px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown-tiles.is-here .tiles { display: none; }
.countdown-tiles__here {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--merlot, #a2444d);
}

/* ── 7b. venue photo strip (Celebration panel — optional, see README) ── */
.venue-photo {
  position: relative;
  margin: 0 0 22px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-gold);
  box-shadow: 0 16px 34px rgba(60, 19, 29, 0.18);
}
.venue-photo img {
  width: 100%;
  /* height:auto lets aspect-ratio win over the stamped width/height
     attributes — otherwise Chrome renders the photo at the attribute
     height and the 16:9 frame is ignored. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.venue-photo:hover img { transform: scale(1.03); }
.venue-photo figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 16px 11px;
  background: linear-gradient(180deg, transparent, rgba(32, 10, 16, 0.74));
  color: var(--card);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  text-align: left;
}

/* invisible full-area click target over each clickable photo (venue
   strip, poster banner) — opens the shared photo viewer */
.media-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: inherit;
}
.media-hit::after {
  content: "Enlarge";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(32, 10, 16, 0.66);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: var(--card);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.media-hit:hover::after,
.media-hit:focus-visible::after { opacity: 1; }

/* save-the-date poster banner (Celebration panel — optional, see README) */
.banner-photo {
  position: relative;
  margin: 0 auto 26px;
  max-width: 380px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--gold);
  box-shadow: 0 18px 40px rgba(60, 19, 29, 0.22);
  background: var(--card);
}
.banner-photo img {
  width: 100%;
  /* height:auto — see .venue-photo img (attribute height would override
     the 3:4 poster frame). */
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.banner-photo:hover img { transform: scale(1.03); }
.banner-photo figcaption {
  padding: 11px 14px 13px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--wine-mid);
  background: rgba(250, 243, 231, 0.96);
}

/* ── 8. panels 2–4 · shared content ground ───────────────────────────── */
.panel:not(.hero-panel) {
  background:
    radial-gradient(140% 60% at 50% -10%, #fdf0e2 0%, rgba(253, 240, 226, 0) 62%),
    linear-gradient(180deg, #f6e4d8 0%, #fbf1e7 100%);
}

.section-head { margin-bottom: 26px; }

.kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 500;
  line-height: 1.12;
  color: var(--wine);
}

.lede {
  margin: 12px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* RSVP reply deadline — its own line under the lede (the .rsvp-date strong
   must NOT live inside the lede, whose innertext the engine replaces when
   the RSVP Lede morph is filled). The whole line is removed via css_if_empty
   when the deadline is blank, so "Kindly reply by" never leaks. */
.rsvp-deadline {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* Two-line blocks whose lines are optional: when BOTH lines are empty the
   engine removes the spans and the paragraph would otherwise stay as an
   empty gap (a stray <br /> or whitespace text nodes defeat :empty, so we
   key on the presence of a line span). Modern browsers only — older ones
   show at worst an empty line, never broken text. */
.card__request:not(:has(span)),
.card__place:not(:has(span)) {
  display: none;
}


.block-title {
  margin: 30px 0 4px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  color: var(--wine);
}

.timeline { margin-top: 8px; }
.timeline-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-item__time {
  flex: none;
  width: 108px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--wine);
  font-variant-numeric: tabular-nums;
}
.timeline-item__text { font-size: 15px; color: var(--ink-soft); }
@media (max-width: 480px) {
  .timeline-item { flex-direction: column; gap: 3px; }
  .timeline-item__time { width: auto; }
}

.event-list { margin-top: 6px; }
.event-item {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line-gold);
  border-radius: 14px;
  background: rgba(250, 243, 231, 0.85);
}
.event-item__chip {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.event-item__title { margin: 10px 0 4px; font-family: var(--font-display); font-size: 23px; font-weight: 600; color: var(--wine); }
.event-item__when { margin: 0; font-size: 13px; color: var(--muted); }
.event-item__addr { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.event-item__actions { margin-top: 12px; }

.notes { margin-top: 26px; }
.note {
  margin: 10px 0;
  padding-left: 14px;
  border-left: 2px solid var(--gold);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.note strong { color: var(--wine); }

/* ── 8b. photo gallery ("The Memories") + lightbox ───────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 860px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
}

.gallery-cell { margin: 0; }
.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--wine-deep);
  cursor: pointer;
  aspect-ratio: 4 / 5;
  text-align: left;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: border-color 0.3s ease;
  pointer-events: none;
}
.gallery-item:hover::after,
.gallery-item:focus-visible::after { border-color: rgba(212, 175, 95, 0.8); }
.gallery-item__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(32, 10, 16, 0.78));
  color: var(--card);
  font-family: var(--font-display);
  font-size: 15.5px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* ── 7c. free page (optional panel — see README "Free page") ────────── */
.free-blocks { margin-top: 4px; }
.free-block {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line-gold);
  border-radius: 14px;
  background: rgba(250, 243, 231, 0.85);
}
.free-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  color: var(--wine);
}
.free-content {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-line;          /* the cockpit textarea may hold line breaks */
}
.free-figure {
  position: relative;
  margin: 16px 0 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-gold);
  box-shadow: 0 14px 28px rgba(60, 19, 29, 0.14);
}
.free-figure:empty { display: none; }   /* text-only block: no photo, no gap */
.free-img {
  width: 100%;
  /* height:auto lets aspect-ratio win over the stamped width/height
     attributes — otherwise Chrome renders the photo at the attribute
     height and the 4:3 frame is ignored. */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.free-figure:hover .free-img { transform: scale(1.03); }

/* lightbox — full-screen photo viewer (opened by main.js) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 4vw, 44px);
  background: rgba(22, 6, 12, 0.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox.is-open { display: flex; }

.lightbox__frame {
  position: relative;
  max-width: min(920px, 94vw);
}
.lightbox__stage {
  margin: 0;
  overflow: hidden;
  animation: lightbox-in 0.22s ease;
}
.lightbox__stage.is-zoomed {
  overflow: auto;                     /* zoomed photo pans by scrolling */
  scrollbar-width: none;
}
.lightbox__stage.is-zoomed::-webkit-scrollbar { display: none; }
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.975); }
}
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 95, 0.55);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.28s ease;
}
.lightbox__img.is-zoomed { transform: scale(1.7); cursor: zoom-out; }
@media (max-width: 700px) { .lightbox__img.is-zoomed { transform: scale(1.5); } }
.lightbox__cap {
  margin: 13px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--card);
}
.lightbox__count {
  display: block;
  margin-top: 5px;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.lightbox__hint {
  display: block;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(250, 243, 231, 0.62);
}
.lightbox__btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 95, 0.45);
  background: rgba(46, 15, 22, 0.8);
  color: var(--card);
  z-index: 2;
  transition: background 0.18s ease;
}
.lightbox__btn:hover { background: var(--wine-mid); }
.lightbox__btn:disabled { opacity: 0.4; cursor: default; }
.lightbox__close { top: -10px; right: -10px; }
.lightbox__zoom { top: -10px; right: 56px; }
.lightbox__prev { left: -58px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: -58px; top: 50%; transform: translateY(-50%); }
@media (max-width: 900px) {
  .lightbox__prev { left: 6px; }
  .lightbox__next { right: 6px; }
}

/* ── 8c. the film (optional video feature) + player viewer ───────────── */
.video-feature {
  margin: 0 0 26px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-gold);
  background: rgba(250, 243, 231, 0.85);
  box-shadow: 0 16px 34px rgba(60, 19, 29, 0.16);
}
.video-feature__play {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--wine-deep);
  cursor: pointer;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-feature__play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.video-feature__play:hover img { transform: scale(1.03); }
.video-feature__play::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(32, 10, 16, 0.05), rgba(32, 10, 16, 0.42));
  transition: background 0.3s ease;
  pointer-events: none;
}
.video-feature__play:hover::after { background: linear-gradient(180deg, rgba(32, 10, 16, 0.02), rgba(32, 10, 16, 0.3)); }
.video-feature__play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(250, 243, 231, 0.92);
  color: var(--wine);
  box-shadow: 0 10px 30px rgba(12, 3, 7, 0.4);
  z-index: 2;
  transition: transform 0.25s ease, background 0.25s ease;
}
.video-feature__play:hover .video-feature__play-btn {
  transform: translate(-50%, -50%) scale(1.08);
  background: #fff;
}
.video-feature__play-btn svg { margin-left: 3px; }
.video-feature__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--card);
  text-shadow: 0 1px 12px rgba(12, 3, 7, 0.6);
  z-index: 2;
  pointer-events: none;
}
.video-feature__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px 13px;
}
.video-feature__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--wine);
}
.video-feature__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-decoration: none;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 8px 15px;
  transition: background 0.18s ease;
}
.video-feature__link:hover { background: rgba(185, 141, 62, 0.12); }
.video-feature__ext { font-size: 13px; }

/* video player viewer (opened by main.js from data-video-src) */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 4vw, 44px);
  background: rgba(22, 6, 12, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.video-lightbox.is-open { display: flex; }
.video-lightbox__frame {
  position: relative;
  width: min(960px, 96vw);
  animation: lightbox-in 0.22s ease;
}
.video-lightbox__stage {
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(212, 175, 95, 0.55);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6);
}
.video-lightbox__media {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.video-lightbox__original {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-decoration: none;
}
.video-lightbox__original:hover { text-decoration: underline; }
.video-lightbox__close { top: -10px; right: -10px; }

/* ── 9. RSVP ─────────────────────────────────────────────────────────── */
.rsvp-date { color: var(--wine); font-weight: 600; }

/* RSVP deadline strip — revealed only when the platform sets a deadline */
.rsvp-countdown {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  padding: 11px 18px;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--wine-deep), var(--wine));
  color: var(--card);
}
.rsvp-countdown__label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(250, 243, 231, 0.8);
}
.rsvp-countdown__nums {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rsvp-card {
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line-gold);
  border-radius: 16px;
  background: rgba(250, 243, 231, 0.94);
  box-shadow: 0 18px 44px rgba(60, 19, 29, 0.16);
}

.form-group { margin-bottom: 14px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--wine-deep);
}
.form-group label small {
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(43, 26, 30, 0.24);
  border-radius: 9px;
  background: #fffdf8;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(138, 111, 106, 0.75); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 141, 62, 0.22);
}
.form-group textarea { resize: vertical; min-height: 74px; }

.error {
  display: block;
  min-height: 16px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--danger);
}

.form-hint {
  margin: -6px 0 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
}

.rsvp-extras { transition: opacity 0.25s ease; }
#rsvp-form.is-declining .rsvp-extras { display: none; }

.declined-note {
  display: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(176, 64, 47, 0.35);
  border-radius: 10px;
  background: rgba(176, 64, 47, 0.07);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--danger);
}
#rsvp-form.is-declining .declined-note { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--block { width: 100%; }

.btn--primary {
  background: linear-gradient(120deg, var(--wine-deep), var(--wine));
  color: var(--card);
  box-shadow: 0 10px 24px rgba(60, 19, 29, 0.35);
}
.btn--primary:hover { box-shadow: 0 14px 30px rgba(60, 19, 29, 0.45); }
.btn--primary:disabled { opacity: 0.6; cursor: default; transform: none; }

.btn--ghost {
  border-color: var(--gold);
  color: var(--gold-deep);
  background: transparent;
  padding: 9px 18px;
}
.btn--ghost:hover { background: rgba(185, 141, 62, 0.12); }

/* loading node (driven by the platform script) */
.loading {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0 0;
}

/* ── 10. guestbook (injected markup) ─────────────────────────────────── */
.guestbook-section #guestbookForm {
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid var(--line-gold);
  border-radius: 16px;
  background: rgba(250, 243, 231, 0.94);
  box-shadow: 0 18px 44px rgba(60, 19, 29, 0.16);
}
.guestbook-section #guestbookForm input,
.guestbook-section #guestbookForm textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(43, 26, 30, 0.24);
  border-radius: 9px;
  background: #fffdf8;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--ink);
}
.guestbook-section #guestbookForm textarea { resize: vertical; min-height: 96px; }
.guestbook-section #guestbookForm button[type="submit"] {
  margin-top: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--wine-deep), var(--wine));
  color: var(--card);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(60, 19, 29, 0.35);
}
.guestbook-chapta { margin: 10px 0; }
.loading-guestbook { color: var(--muted); font-size: 13px; padding: 10px 0 0; }

.guestbook-wrap { margin-top: 22px; }

.guestbook-entry {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-gold);
  border-radius: 12px;
  background: rgba(250, 243, 231, 0.82);
}
.guestbook-entry h5 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--wine);
}
.guestbook-entry p { margin: 0 0 4px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.guestbook-entry small { color: var(--muted); font-size: 12px; }

.more-guestbook-wrap { text-align: center; margin-top: 18px; }
.more-guestbook-wrap #load-more {
  padding: 10px 22px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-deep);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── 11. personalisation ─────────────────────────────────────────────── */
.guest-greeting {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15.5px;
  color: var(--wine);
}
.guest-greeting__name { font-weight: 600; }

/* ── 12. reveals ─────────────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ── 12b. mobile refinements (small screens / touch) ────────────────── */
@media (max-width: 600px) {
  /* Form controls at 16px — below this iOS Safari auto-zooms the page on
     focus, which makes the RSVP/guestbook forms feel broken on phones. */
  .form-group input,
  .form-group select,
  .form-group textarea,
  .guestbook-section #guestbookForm input,
  .guestbook-section #guestbookForm textarea {
    font-size: 16px;
  }

  /* Comfortable ≥44px touch targets for the tappable controls. */
  .chip-btn {
    min-height: 44px;
    min-width: 44px;
  }
  .btn { min-height: 44px; }
  .video-feature__link { min-height: 44px; }
  .guestbook-section #guestbookForm button[type="submit"] { min-height: 44px; }
  .tabs-scroll { width: 44px; }
}

/* ── 13. reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── 14. foot ────────────────────────────────────────────────────────── */
.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px clamp(14px, 3vw, 28px);
  background: rgba(32, 10, 16, 0.9);
  border-top: 1px solid rgba(185, 141, 62, 0.35);
  color: rgba(250, 243, 231, 0.75);
  font-size: 12px;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 5;
}
.foot__dot { opacity: 0.5; }

/* footer brand placeholder — the platform stamps its name here */
.foot .footer-brand {
  color: var(--gold-bright);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
}

/* ── 14b. powered-by brand strip (full-width, app-level) ────────────── */
.powered-by {
  width: 100%;
  padding: 8px clamp(14px, 3vw, 28px);
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: var(--bg-deep);
  border-top: 1px solid rgba(185, 141, 62, 0.25);
  color: rgba(250, 243, 231, 0.55);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  position: relative;
  z-index: 5;
}

/* ── 15. print: flatten to readable pages ────────────────────────────── */
@media print {
  html.js .app { height: auto; display: block; overflow: visible; }
  html.js .panel { display: block !important; overflow: visible !important; }
  html.js .panel.hero-panel.is-active { display: block !important; }
  .masthead__actions, .tabs, .tabs-bar, .foot, .no-print, .svg-sprite { display: none !important; }
  body { background: #fff; }
  .panel:not(.hero-panel) { background: #fff; }
  .panel-inner { max-width: none; padding: 12px; }
  .card {
    box-shadow: none;
    border: 1px solid var(--gold);
    background: #fff;
    page-break-inside: avoid;
  }
  .card__corner { opacity: 0.6; }
  .card__sub, .card__place span, .card__date em { color: #555; }
  .countdown-tiles, .timeline-item, .event-item, .notes, .rsvp-card, .guestbook-entry,
  .card__cover, .venue-photo, .banner-photo, .video-feature, .gallery-cell { page-break-inside: avoid; }
  .lightbox, .video-lightbox { display: none !important; }
  .media-hit::after { display: none; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
