/* ═══════════════════════════════════════════════════════════════════════
   invitation-card — wedding-card gold-foil style
   Cream stationery sheets (gold hairline frames + corner studs) on a
   dark-ink stage · Cormorant Garamond serif, gold-foil "&" and monogram.
   The .app is locked to 100dvh; the cover is its own full card page and
   each tab turns to a full cream sheet. Only the active panel scrolls.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --ink: #191410;
  --ink-soft: #4c4236;
  --paper: #faf5ea;
  --paper-2: #f3ecdc;
  --champagne: #c9a76b;
  --champagne-deep: #a57f45;
  --champagne-light: #e8d3a2;
  --rose: #c98e7c;
  --muted: #8a7d68;
  --muted-dark: #b5a78c;   /* muted text on the dark stage */
  --line: #e4d9c0;
  --line-gold: rgba(165, 127, 69, 0.45);
  --line-gold-soft: rgba(201, 167, 107, 0.25);
  --error: #b4453a;
  --radius: 4px;
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Jost", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --gold: linear-gradient(105deg, #e8d3a2 0%, #c9a76b 32%, #f3e2b6 50%, #a57f45 68%, #e8d3a2 100%);
  --foil: linear-gradient(105deg, #e8d3a2 0%, #c9a76b 16%, #a57f45 30%, #c9a76b 46%, #e8d3a2 62%, #a57f45 76%, #e8d3a2 100%);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% 0%, #241c13 0%, var(--ink) 55%);
  -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; }

::selection { background: var(--champagne); color: var(--ink); }

/* gold-foil text */
.gold-text {
  background: var(--gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--champagne);
}

/* ── single-viewport shell (JS on) ────────────────────────────────────── */
html.js .app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: grid;
  /* minmax(0, 1fr) lets the single column shrink below the widest child's
     min-content width (tab strip, long names, etc.) so the shell never
     overflows the phone viewport; each row handles its own overflow
     (ellipsis / horizontal scroll) instead. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  z-index: 1;
}

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;
  scrollbar-width: thin;
  scrollbar-color: var(--champagne-deep) transparent;
  padding: clamp(12px, 2.5vh, 22px) clamp(12px, 3vw, 28px);
  padding-bottom: calc(clamp(12px, 2.5vh, 22px) + env(safe-area-inset-bottom));
}
html.js .panel.is-active::-webkit-scrollbar { width: 8px; }
html.js .panel.is-active::-webkit-scrollbar-thumb { background: rgba(201, 167, 107, 0.5); border-radius: 4px; }

/* hero panel (the cover card) centres its 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) .panel.is-active { overflow: visible; }
html:not(.js) .masthead__actions { display: none; }

/* ── optional photo backdrop behind everything (decorative, dark-washed) ─ */
.stage-photo {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.stage-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8);
}
.stage-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(25, 20, 16, 0.42) 0%, rgba(25, 20, 16, 0.72) 55%, rgba(25, 20, 16, 0.88) 100%);
}

/* ── masthead ─────────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) clamp(14px, 3vw, 28px) 10px;
  background: rgba(25, 20, 16, 0.92);
  border-bottom: 1px solid var(--line-gold-soft);
  color: var(--paper);
  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.28em;
  text-transform: uppercase;
  font-family: var(--sans);
  color: var(--champagne);
}
.masthead__name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--paper);
}

.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(201, 167, 107, 0.08);
  color: var(--champagne-light);
  font: 500 12.5px var(--sans);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.chip-btn:hover { background: rgba(201, 167, 107, 0.18); border-color: var(--champagne); color: var(--paper); }
.chip-btn:active { transform: translateY(1px); }
.chip-btn:focus-visible { outline: 2px solid var(--champagne); outline-offset: 2px; }
.chip-btn.is-done { border-color: #9dbd9f; color: #cfe3cf; }

/* ── tabs ─────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  padding: 8px clamp(14px, 3vw, 28px);
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(25, 20, 16, 0.88);
  border-bottom: 1px solid var(--line-gold-soft);
  position: relative;
  z-index: 5;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-dark);
  font: 500 12px var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--paper); }
.tab.is-active {
  background: linear-gradient(105deg, #c9a76b 0%, #a57f45 60%, #c9a76b 100%);
  border-color: var(--champagne-deep);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.tab:focus-visible { outline: 2px solid var(--champagne); outline-offset: 2px; }

/* ── panels & inner ───────────────────────────────────────────────────── */
.panels { min-width: 0; }

/* Every non-cover page is a cream stationery sheet with a gold hairline
   frame — the same paper as the cover card, so all tabs feel like pages
   of one invitation. */
.panel-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(26px, 4vh, 42px) clamp(20px, 4.5vw, 40px) 60px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(232, 211, 162, 0.16), transparent 60%),
    var(--paper);
  border: 1px solid rgba(165, 127, 69, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}
.panel-inner::before {
  content: "";
  position: absolute;
  inset: clamp(10px, 2vw, 14px);
  border: 1px solid rgba(165, 127, 69, 0.4);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}
.panel-inner > * { position: relative; z-index: 2; }

.section-head { margin-bottom: 26px; }
.kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-family: var(--sans);
  color: var(--champagne-deep);
}
.section-head h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 40px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.lede {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  font-family: var(--sans);
  max-width: 56ch;
}
.lede strong { color: var(--champagne-deep); font-weight: 500; }

/* ── the cover card (panel 1 · the full invitation card) ──────────────── */
.card {
  position: relative;
  max-width: 620px;
  width: 100%;
  /* Flex item inside the hero panel: let it shrink below its content's
     intrinsic width so long host-entered names / text wrap instead of
     blowing the card past the phone viewport. */
  min-width: 0;
  padding: clamp(26px, 4.5vh, 40px) clamp(22px, 5vw, 48px) clamp(24px, 4vh, 38px);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(232, 211, 162, 0.16), transparent 60%),
    var(--paper);
  border: 1px solid rgba(165, 127, 69, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 14px);
}

/* fine gold inner frame */
.card::before {
  content: "";
  position: absolute;
  inset: clamp(12px, 2.5vw, 18px);
  border: 1px solid rgba(165, 127, 69, 0.4);
  border-radius: 2px;
  pointer-events: none;
  z-index: 2;
}

/* four gold corner studs */
.card::after {
  content: "";
  position: absolute;
  inset: clamp(16px, 3vw, 24px);
  background-image:
    radial-gradient(circle at 0 0, var(--champagne) 2.5px, transparent 3.5px),
    radial-gradient(circle at 100% 0, var(--champagne) 2.5px, transparent 3.5px),
    radial-gradient(circle at 0 100%, var(--champagne) 2.5px, transparent 3.5px),
    radial-gradient(circle at 100% 100%, var(--champagne) 2.5px, transparent 3.5px);
  pointer-events: none;
  z-index: 2;
}

.card > * { position: relative; z-index: 1; }

html.js:not(.no-motion) .card { animation: card-rise 0.8s var(--ease-out) both; }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* corner flourishes (fine gold brackets) */
.card__corner {
  position: absolute;
  width: 15px;
  height: 15px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.9;
}
.card__corner::before, .card__corner::after {
  content: "";
  position: absolute;
  background: linear-gradient(90deg, var(--champagne-light), var(--champagne-deep));
}
.card__corner::before { width: 15px; height: 1.3px; }
.card__corner::after  { width: 1.3px; height: 15px; }
.card__corner--tl { top: 20px; left: 20px; }
.card__corner--tr { top: 20px; right: 20px; }
.card__corner--bl { bottom: 20px; left: 20px; }
.card__corner--br { bottom: 20px; right: 20px; }
.card__corner--tl::before, .card__corner--tl::after { left: 0; top: 0; }
.card__corner--tr::before, .card__corner--tr::after { right: 0; top: 0; }
.card__corner--bl::before, .card__corner--bl::after { left: 0; bottom: 0; }
.card__corner--br::before, .card__corner--br::after { right: 0; bottom: 0; }

/* personalised greeting pill */
.card__greeting {
  margin: 0;
  padding: 6px 16px;
  border: 1px dashed var(--line-gold);
  border-radius: 999px;
  font-size: 12.5px;
  font-family: var(--sans);
  color: var(--champagne-deep);
  background: rgba(201, 167, 107, 0.08);
}
.card__greeting b { font-weight: 500; color: var(--ink); }

/* gold-foil monogram */
.card__monogram {
  width: clamp(64px, 11vw, 84px);
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(165, 127, 69, 0.35));
}

.card__hosts {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-family: var(--sans);
  color: var(--champagne-deep);
}

.card__names {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 8.5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.3em;
  flex-wrap: wrap;
  /* Long names (or review markers like "[R:5526] …") must wrap, not force
     the cover card wider than the viewport on small phones. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.card__amp {
  font-style: italic;
  font-size: 0.78em;
}

.card__request {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-soft);
}

.card__photo-list {
  min-width: 0;
  max-width: 100%;
}

/* optional couple portrait (arch) — delete .card__photo-list to hide;
   add a second figure for individual portraits side by side. Clicking
   opens the zoomable lightbox (main.js). */
.card__photo-list { display: flex; align-items: center; justify-content: center; gap: 16px; }
.card__photo { margin: 0; }
.card__photo img {
  width: min(250px, 62vw);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  padding: 6px;
  background: linear-gradient(180deg, #fffdf8, var(--paper-2));
  border: 1px solid var(--line-gold);
  border-radius: 999px 999px 8px 8px; /* semicircular arch, soft base */
  box-shadow: 0 18px 36px -22px rgba(25, 20, 16, 0.55);
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card__photo + .card__photo img { width: min(190px, 46vw); } /* two portraits: pair, slightly smaller */
.card__photo:hover img, .card__photo img:focus-visible { transform: scale(1.03); }
.card__photo img:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: 3px; }

.card__ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(280px, 74%);
  color: var(--champagne-deep);
}
.card__ornament span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--champagne), transparent); }
.card__ornament i { font-style: normal; font-size: 10px; }

.card__date {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.card__date em {
  font-style: italic;
  color: var(--champagne-deep);
  font-size: 0.92em;
}

.card__place {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--sans);
  color: var(--champagne-deep);
  line-height: 1.7;
}
.card__place span { color: var(--muted); }

.card__dress {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(280px, 76%);
}
.card__dress span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--champagne), transparent); }
.card__dress p {
  margin: 0;
  padding: 6px 18px;
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em; /* optically re-centre the tracked caps */
  text-transform: uppercase;
  color: var(--champagne-deep);
  background: rgba(201, 167, 107, 0.08);
  white-space: nowrap;
}

.card__reply {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ── reveal-on-scroll (gated: html.no-motion / reduced-motion disable) ── */
[data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .panel.is-active [data-reveal].is-visible,
html.no-motion [data-reveal],
html:not(.js) [data-reveal] { opacity: 1; transform: none; }

/* ── official flyer / banner (OPTIONAL — in the Celebration panel) ───────
   A framed image slot for hosts who already have a designed flyer or
   poster for the event — display it so guests can confirm they're in the
   right place. Any ratio works (kept intact, never cropped); clicking it
   opens the same zoomable lightbox as the photos. Delete the whole
   .banner-flyer block in index.html to hide the feature. */
.banner-flyer {
  margin: 0 0 28px;
  text-align: center;
}
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: 6px;
  border: 1px solid var(--line-gold);
  background: #fffdf8;
  box-shadow: 0 12px 30px rgba(25, 20, 16, 0.18);
  transition: transform 0.3s ease;
}
.banner-flyer:hover img { transform: scale(1.012); }
.banner-flyer img:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: 3px; }
.banner-flyer figcaption {
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--champagne-deep);
}

/* ── optional film feature (video URL embed — in the Photos panel) ───────
   A poster + play button that lazy-loads an <iframe> from the URL in
   data-video-url (YouTube / Vimeo / any embeddable URL). Nothing loads
   until the guest taps play — fast, and consent-friendly. Delete the whole
   .film-card block in index.html to hide the feature. */
.film-card {
  margin-top: clamp(28px, 5.5vmin, 44px);
  text-align: center;
}
.film-card__title { margin-top: 0; }
.film-frame {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: clamp(14px, 3.2vmin, 20px) auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--paper-2); /* mat behind the poster / while loading */
  border: 1px solid var(--line-gold);
  box-shadow: 0 12px 30px rgba(25, 20, 16, 0.18);
}
.film-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.film-open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(56px, 12vmin, 72px);
  height: clamp(56px, 12vmin, 72px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--champagne-deep);
  background: radial-gradient(circle at 32% 28%, #fffdf8, var(--champagne-light) 55%, var(--champagne));
  border: 1px solid var(--line-gold);
  box-shadow: 0 12px 28px -12px rgba(25, 20, 16, 0.65);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform 0.25s ease;
}
.film-play svg { width: 26px; height: 26px; margin-left: 3px; }
.film-open:hover .film-play { transform: translate(-50%, -50%) scale(1.08); }
.film-open:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: 3px; }
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(25, 20, 16, 0.62);
  color: var(--champagne-light);
  font-size: 10px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.film-frame.is-playing .film-open { display: none; }
.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  font-family: var(--sans);
  font-style: italic;
  text-align: center;
  background: var(--paper-2);
}
.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 11.5px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--champagne-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--line-gold);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.film-external:hover { color: var(--champagne); border-color: var(--champagne); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px -12px rgba(25, 20, 16, 0.65), 0 0 0 0 rgba(201, 167, 107, 0.35); }
  50% { box-shadow: 0 12px 28px -12px rgba(25, 20, 16, 0.65), 0 0 0 14px rgba(201, 167, 107, 0); }
}

/* ── countdown tiles (celebration) ────────────────────────────────────── */
.countdown-tiles {
  display: none; /* JS reveals with .is-live once the tiles hold real numbers */
  margin: 0 0 28px;
  padding: 18px;
  border: 1px solid var(--line-gold);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
  box-shadow: 0 6px 22px rgba(25, 20, 16, 0.1);
  text-align: center;
}
html.js .countdown-tiles.is-live { display: block; }
.countdown-tiles__label {
  margin: 0 0 12px;
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--champagne-deep);
}
.tiles { display: flex; justify-content: center; gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 62px;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
}
.tile-num {
  font-family: var(--serif);
  font-size: clamp(24px, 3.8vw, 32px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--champagne-deep);
}
.tile-cap { font-size: 10px; font-family: var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.countdown-tiles__here { margin: 12px 0 0; font-family: var(--serif); font-style: italic; color: var(--champagne-deep); }

/* ── timeline ─────────────────────────────────────────────────────────── */
.block-title {
  margin: 30px 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--champagne), rgba(201, 167, 107, 0.25));
}
.timeline-item {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  font-size: 14.5px;
  font-family: var(--sans);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -22.5px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--champagne);
  border: 2px solid var(--paper);
}
.timeline-item__time {
  flex: none;
  width: 78px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--champagne-deep);
}
.timeline-item__text { color: var(--ink-soft); }

/* ── venue cards ──────────────────────────────────────────────────────── */
.event-list { display: grid; grid-template-columns: 1fr; gap: 14px; }

.event-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
  box-shadow: 0 6px 22px rgba(25, 20, 16, 0.1);
}
.event-item__chip {
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-gold);
  color: var(--champagne-deep);
  font-size: 10px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.event-item__title { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.event-item__when { margin: 2px 0 0; font-size: 13px; font-family: var(--sans); font-weight: 500; color: var(--champagne-deep); }
.event-item__where { margin: 0; font-size: 13px; font-family: var(--sans); font-weight: 500; color: var(--ink-soft); }
.event-item__addr { margin: 0; font-size: 12.5px; font-family: var(--sans); color: var(--muted); }
.event-item__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── notes ────────────────────────────────────────────────────────────── */
.notes {
  margin-top: 26px;
  padding: 16px 18px;
  border: 1px dashed var(--line-gold);
  border-radius: 8px;
  background: rgba(201, 167, 107, 0.07);
}
.note { margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; color: var(--muted); font-family: var(--sans); }
.note:last-child { margin-bottom: 0; }
.note strong { color: var(--champagne-deep); font-weight: 600; }

/* ── photo gallery (OPTIONAL: delete the whole #panel-photos <section> in
   index.html to hide it — its tab disappears automatically). Each img is
   itself the clickable (role="button" via markup; main.js opens the
   lightbox on click / Enter / Space). ── */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 2.4vw, 18px);
}
@media (max-width: 340px) { .photo-gallery { grid-template-columns: 1fr; } }

.gallery-item { margin: 0; }
.gallery-item--wide { grid-column: 1 / -1; }
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  cursor: zoom-in;
  padding: 4px;
  background: #fffdf8;
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  box-shadow: 0 6px 22px rgba(25, 20, 16, 0.14);
  transition: transform 0.5s ease, box-shadow 0.3s ease;
}
.gallery-item--wide img { aspect-ratio: 16 / 9; }
.gallery-item:hover img,
.gallery-item img:focus-visible { transform: scale(1.035); }
.gallery-item img:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: 2px; }
.gallery-item__cap {
  margin: 8px 2px 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--champagne-deep);
}

/* ── free page (OPTIONAL host-filled panel) ─────────────────────────────
   The free page is a host-filled extra panel (#panel-free): a title, an
   intro, and repeatable blocks — each a title, free text and an OPTIONAL
   photo. The platform hides the whole section when it is empty or switched
   off; the tab disappears with it because tabs are generated from the
   panels that exist. Leave the image empty in the editor (or delete the
   .free-block__media figure) and the block still works without it. */
.free-blocks { display: grid; gap: 16px; }
.free-block {
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
  box-shadow: 0 6px 22px rgba(25, 20, 16, 0.1);
}
.free-block__title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}
.free-block__content {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  font-family: var(--sans);
}
.free-block__media { margin: 16px 0 0; }
.free-block__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
  padding: 4px;
  background: #fffdf8;
  border: 1px solid var(--line-gold);
  border-radius: 3px;
  box-shadow: 0 6px 22px rgba(25, 20, 16, 0.14);
  transition: transform 0.5s ease;
}
.free-block__media:hover img,
.free-block__media img:focus-visible { transform: scale(1.02); }
.free-block__media img:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: 2px; }
.free-block__cap {
  margin: 8px 2px 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--champagne-deep);
}
.free-powered-by {
  margin: 26px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--champagne-deep);
}

/* ── forms (RSVP + injected guestbook) ────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12.5px; font-family: var(--sans); font-weight: 500; letter-spacing: 0.03em; }
.form-group label small { font-weight: 400; color: var(--muted); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  font: 400 15px var(--sans);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group textarea { resize: vertical; min-height: 72px; }
.form-group input::placeholder, .form-group textarea::placeholder { color: #c4b9a2; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--champagne-deep);
  box-shadow: 0 0 0 3px rgba(201, 167, 107, 0.25);
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a7d68' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-hint { margin: -6px 0 16px; font-size: 12.5px; color: var(--muted); font-family: var(--sans); }

.error { display: block; color: var(--error); font-size: 12.5px; font-family: var(--sans); }

/* decline state: hide party-size & meals, show the miss-you note */
.rsvp-extras { transition: opacity 0.25s; }
.rsvp-form.is-declining .rsvp-extras { display: none; }
.declined-note {
  display: none;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line-gold);
  background: rgba(201, 167, 107, 0.08);
  font-size: 13.5px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--champagne-deep);
}
.rsvp-form.is-declining .declined-note { display: block; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 500 13px var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: 2px; }
.btn--primary {
  background: linear-gradient(105deg, #c9a76b 0%, #a57f45 60%, #c9a76b 100%);
  color: #fff;
  box-shadow: 0 10px 26px rgba(165, 127, 69, 0.4);
}
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost {
  background: transparent;
  border-color: var(--line-gold);
  color: var(--champagne-deep);
}
.btn--ghost:hover { border-color: var(--champagne); color: var(--ink); }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }

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

/* RSVP deadline countdown (platform-driven .count-*) */
.rsvp-countdown {
  margin: -6px 0 22px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px dashed var(--line-gold);
  background: rgba(201, 167, 107, 0.07);
  text-align: center;
  font-size: 13.5px;
  font-family: var(--sans);
}
.rsvp-countdown__label { margin: 0 0 4px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--champagne-deep); }
.rsvp-countdown__nums { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.rsvp-countdown__nums span { color: var(--champagne-deep); font-size: 17px; font-family: var(--serif); }

/* ── guestbook (Style A: platform injects form + list into .guestbook-body) ── */
.guestbook-section #guestbookForm .form-group { margin-bottom: 14px; }
.guestbook-section #guestbookForm button[type="submit"] {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px auto 0;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(105deg, #c9a76b 0%, #a57f45 60%, #c9a76b 100%) !important;
  color: #fff !important;
  font: 500 13px var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(165, 127, 69, 0.35);
}
.guestbook-section #guestbookForm button[type="submit"]:hover { filter: brightness(1.08); }

/* injected message list — neutralise the engine's inline scroll box */
.guestbook-section #comments-container {
  margin-top: 28px !important;
  border-top: 1px solid var(--line) !important;
  max-height: none !important;
  overflow: visible !important;
}
.guestbook-section .guestbook-entry {
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
  box-shadow: 0 4px 16px rgba(25, 20, 16, 0.08);
}
.guestbook-section .guestbook-entry h5 { margin: 0 0 4px; font-size: 15px; font-weight: 500; font-family: var(--serif); }
.guestbook-section .guestbook-entry p { margin: 0 0 4px; font-size: 14px; line-height: 1.55; color: var(--muted); font-family: var(--sans); }
.guestbook-section .guestbook-entry small { color: var(--muted); font-size: 12px; font-family: var(--sans); }

.guestbook-section .more-guestbook-wrap { text-align: center; margin-top: 18px; }
.guestbook-section #load-more {
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font: 500 13px var(--sans);
  cursor: pointer;
}
.guestbook-section #load-more:hover { border-color: var(--champagne-deep); color: var(--ink); }

/* thank-you / closed states injected by the platform scripts */
.thank-you-message { text-align: center; padding: 26px 12px; }
.thank-you-message h3, .thank-you-message h4 { margin: 0 0 8px; font-family: var(--serif); font-size: 26px; font-weight: 400; color: var(--champagne-deep); }
.thank-you-message p { margin: 4px 0; color: var(--muted); font-size: 14px; line-height: 1.6; font-family: var(--sans); }

/* ── photo lightbox (built by main.js from every [data-lightbox] img: the
   cover portrait, the official flyer and the gallery — so removing those
   blocks removes the lightbox too). Opens the original image; click the
   picture (or the zoom button) to view it at actual size and pan around. ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 24px);
  background: rgba(25, 20, 16, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: lightbox-fade 0.25s ease both;
}
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox__stage {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(880px, 94vw);
}
.lightbox__img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}
.lightbox__img-wrap img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  max-height: 74dvh;
  object-fit: contain;
  border-radius: 6px;
  border: 4px solid var(--paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  background: var(--paper-2);
  cursor: zoom-in;
  transition: border-radius 0.2s ease;
}
/* zoomed: the original image at actual size, pannable inside the frame */
.lightbox.is-zoomed .lightbox__img-wrap {
  display: block;
  width: 92vw;
  height: 72vh;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lightbox.is-zoomed .lightbox__img-wrap img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  margin: 0 auto; /* keep a small image centred inside the pan frame */
  cursor: zoom-out;
  border-radius: 3px;
}

.lightbox__caption {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--champagne-light);
}
.lightbox__counter {
  position: absolute;
  left: 0; right: 0; bottom: 20px;
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-family: var(--sans);
  letter-spacing: 0.18em;
  color: rgba(232, 211, 162, 0.7);
}
.lightbox__btn {
  position: absolute;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(232, 211, 162, 0.4);
  background: rgba(25, 20, 16, 0.6);
  color: var(--champagne-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox__btn:hover { background: rgba(201, 167, 107, 0.25); }
.lightbox__btn:focus-visible { outline: 2px solid var(--champagne); outline-offset: 2px; }
.lightbox__btn[aria-pressed="true"] { background: rgba(165, 127, 69, 0.6); border-color: var(--champagne-light); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__zoom {
  top: 16px;
  left: 16px;
  font-size: 0;
}
.lightbox__zoom svg { width: 18px; height: 18px; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: clamp(8px, 2vw, 20px); }
.lightbox__next { right: clamp(8px, 2vw, 20px); }

.lightbox__note {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  font-family: var(--sans);
  font-style: italic;
  background: var(--paper-2);
  border-radius: 6px;
}
.lightbox__note.is-show { display: flex; }

/* ── foot ─────────────────────────────────────────────────────────────── */
.foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px clamp(14px, 3vw, 28px);
  background: rgba(25, 20, 16, 0.92);
  color: var(--muted-dark);
  border-top: 1px solid var(--line-gold-soft);
  font-size: 12px;
  font-family: var(--sans);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.foot::-webkit-scrollbar { display: none; }
.foot__dot { opacity: 0.5; }

/* ── brand footer (placeholder) — tucked into the last panel by main.js ── */
.app-footer { display: none; }
html:not(.js) .app-footer { display: block; padding: 18px 16px 34px; text-align: center; }
html.js .panel .app-footer {
  display: block;
  margin-top: clamp(28px, 5vmin, 40px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-brand {
  margin: 0;
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-brand-name {
  font-family: var(--serif);
  font-size: 1.3em;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--champagne-deep);
}

/* ── powered-by brand strip (full-width footer line) ────────────────────
   A slim "Powered by …" line at the foot of the app. The engine swaps the
   literal brand token for the platform name at render. Static platform HTML,
   never bound to a cockpit field. Full-width in both the JS
   shell (an extra auto row of the .app grid) and the no-JS stacked
   document (its natural place at the end). */
.powered-by {
  width: 100%;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
html:not(.js) .powered-by {
  padding: 14px 16px 22px;
  border-top: 1px solid var(--line-gold-soft);
}
html.js .powered-by {
  padding: 7px 14px;
  border-top: 1px solid var(--line-gold-soft);
  background: rgba(25, 20, 16, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.powered-by .link-footer { color: var(--champagne); }
.powered-by .link-footer:hover { color: var(--champagne-light); }

/* ── focus visibility (global) ────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--champagne);
  outline-offset: 2px;
}

/* ── small screens ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .chip-btn { padding: 8px 10px; }
  .chip-btn__label { display: none; }
  .tabs { padding-top: 6px; padding-bottom: 6px; }
  .tab { padding: 7px 13px; font-size: 11px; }
  .card { padding-left: 18px; padding-right: 18px; }
}

/* ── short screens: reclaim vertical space ────────────────────────────── */
@media (max-height: 680px) {
  .masthead { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
  .masthead__top { display: none; }
  .foot { display: none; }
  html.js .panel.is-active { padding-top: 10px; padding-bottom: 10px; }
  .panel-inner { padding-top: 22px; padding-bottom: 40px; }
  .card { gap: 6px; padding-top: 18px; padding-bottom: 18px; }
  .card__monogram { width: 52px; }
  .card__photo img { width: min(180px, 48vw); }
  .card__ornament, .card__dress, .card__reply { display: none; }
}

/* ── 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;
  }
}
html.no-motion *, html.no-motion *::before, html.no-motion *::after {
  animation: none !important;
  transition: none !important;
}

/* ── 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, .foot, .no-print, .stage-photo, .powered-by { display: none !important; }
  body { background: #fff; }
  .panel-inner { max-width: none; padding: 12px; }
  .card, .panel-inner {
    box-shadow: none;
    border: 1px solid #a57f45;
    background: #fff;
    page-break-inside: avoid;
  }
  .card__corner { display: none; }
  .card__request, .card__reply { color: #444; }
  .card__date { color: #333; }
  .card__date em, .card__place span { color: #555; }
  .card__names, .card__hosts { color: #111; }
  .gold-text { -webkit-text-fill-color: #a57f45; color: #a57f45; }
  .countdown-tiles, .timeline-item, .event-item, .notes, .gallery-item, .banner-flyer, .film-card, .free-block { page-break-inside: avoid; }
  .film-frame iframe { display: none; } /* a playing video can't print — the poster prints instead */
  .lightbox { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
