/* ═══════════════════════════════════════════════════════════════════════════
   party-bbq-flyer-smoke-and-sizzle — "Smoke & Sizzle" (BBQ Party · Flyer)
   Casual smoky warmth · charcoal + ember + cream · checkered accents.

   Layout contract:
     · .app-shell locks to the viewport (100dvh) when <html> has class "js":
       slim header on top, panels inside .shell-body, text tab bar on bottom.
     · Only the ACTIVE panel scrolls internally; inactive panels are hidden.
     · Without JS the page degrades to a normal stacked, scrolling document
       (header + tab bar hidden).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --ember:        #e8631f;
  --ember-deep:   #c24c12;
  --ember-glow:   rgba(232, 99, 31, .32);
  --charcoal:     #221a14;
  --charcoal-soft:#2c231b;
  --cream:        #f6ead3;
  --cream-bright: #fdf6e7;
  --smoke:        #a8957d;
  --leaf:         #5f7a3a;
  --danger:       #c0392b;
  --line:         rgba(246, 234, 211, .16);
  --line-dark:    rgba(34, 26, 20, .14);
  --radius:       18px;
  --ease:         cubic-bezier(.22, .61, .36, 1);
  --font-display: "Alfa Slab One", "Arial Black", Impact, sans-serif;
  --font-body:    "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font: 16px/1.65 var(--font-body);
  color: var(--cream);
  background: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── No-JS fallback: ordinary stacked document, everything readable ────── */
.app-shell { min-height: 100vh; }
.shell-head, .shell-nav, .shell-nav-bar { display: none; }
.panel { position: relative; padding: 24px 20px 48px; }

/* ── JS shell: single-viewport 100dvh app, only the active panel scrolls ── */
html.js body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
html.js .app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html.js .shell-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(34, 26, 20, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
html.js .shell-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
html.js .panel {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
html.js .panel.is-active { display: block; }
/* Tab bar wrapper: holds the prev/next arrows + the scrolling tab row. The
   chrome (border, background, padding) lives here; .shell-nav below is the
   scroll container. */
html.js .shell-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) 12px;
  border-top: 1px solid var(--line);
  background: rgba(34, 26, 20, .92);
}
html.js .shell-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  /* Nine tabs can exceed narrow screens: scroll sideways instead of
     clipping. "safe center" keeps the row centered when it fits and
     left-aligned (scrollable) when it doesn't. */
  justify-content: safe center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
html.js .shell-nav::-webkit-scrollbar { display: none; }
/* When the tab bar overflows, gentle cream fades at both edges hint that
   more sections are reachable by swiping. main.js toggles .is-scrollable. */
html.js .shell-nav.is-scrollable::before,
html.js .shell-nav.is-scrollable::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 34px;
  z-index: 2;
  pointer-events: none;
}
html.js .shell-nav.is-scrollable::before {
  left: 0;
  background: linear-gradient(90deg, rgba(34, 26, 20, .95), transparent);
}
html.js .shell-nav.is-scrollable::after {
  right: 0;
  background: linear-gradient(270deg, rgba(34, 26, 20, .95), transparent);
}

/* ── Prev/next arrows for the tab bar ────────────────────────────────────
   Hidden by default (the bar fits); appear only when the bar overflows
   (narrow screens) — swipe OR tap to reach the far tabs. Dimmed at the
   ends by main.js. */
.nav-arrow {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(34, 26, 20, .6);
  color: var(--cream);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.shell-nav-bar.is-scrollable .nav-arrow { display: inline-flex; }
.nav-arrow:hover { background: var(--ember); color: var(--cream-bright); }
.nav-arrow:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.nav-arrow.is-disabled { opacity: .35; pointer-events: none; }

/* ── App header ────────────────────────────────────────────────────────── */
.head-brand { display: inline-flex; align-items: center; }
.head-monogram {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  color: var(--ember);
  line-height: 1;
}
.head-amp { font-family: var(--font-body); font-style: italic; font-size: 11px; color: var(--smoke); padding: 0 2px; }
.head-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--smoke);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  font: 600 12px/1 var(--font-body);
  letter-spacing: .06em;
  padding: 7px 12px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.head-btn svg { width: 15px; height: 15px; }
.head-btn:hover { background: var(--ember); color: var(--cream-bright); }
.head-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ── Footer brand placeholder (platform swaps the text/logo) ───────────── */
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--smoke);
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer-brand-mark { color: var(--ember); font-size: 12px; }

/* ── Checkerboard / gingham utilities ──────────────────────────────────── */
.checker {
  background:
    linear-gradient(45deg, var(--cream) 25%, transparent 25%),
    linear-gradient(-45deg, var(--cream) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--cream) 75%),
    linear-gradient(-45deg, transparent 75%, var(--cream) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  background-color: var(--charcoal);
}
.checker-top,
.checker-bottom {
  height: 22px;
  flex: 0 0 22px;
}
.checker-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--ember);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--charcoal), inset 0 0 0 4px var(--cream);
}

.gingham {
  background: repeating-conic-gradient(var(--ember) 0% 25%, var(--cream) 0% 50%)
    0 0 / 26px 26px;
}
.gingham-strip { height: 26px; border-radius: 6px; margin: 34px 0 6px; }

/* ── Panel scaffolding ─────────────────────────────────────────────────── */
.panel-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 24px calc(120px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Panel themes (alternating for poster rhythm) ──────────────────────── */
.cover-panel { background: var(--charcoal); }
#menu       { background: var(--cream); color: var(--charcoal); }
.detail-panel { background: var(--charcoal-soft); }
.moments-panel { background: var(--cream); color: var(--charcoal); }
.video-panel { background: var(--charcoal); }
.flyer-panel { background: var(--cream); color: var(--charcoal); }
.rsvp-panel { background: var(--cream); color: var(--charcoal); }
.guest-panel { background: var(--charcoal); }
.free-panel { background: var(--cream); color: var(--charcoal); }

/* Ember glow behind the cover art */
.cover-panel .panel-inner {
  position: relative;
  z-index: 2; /* above the cover photo + scrim */
  background:
    radial-gradient(ellipse 70% 46% at 50% 38%, var(--ember-glow), transparent 70%);
  /* Reserve room for the footer-brand line so it peeks into the cover
     viewport (a flyer-brand touch) without covering the poster itself. */
  min-height: calc(100% - 56px);
}

/* ── Optional cover photo (placeholder until the host swaps it) ────────── */
.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
/* Readability scrim over the cover photo so the poster text stays crisp. */
.cover-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(rgba(34, 26, 20, .35), rgba(34, 26, 20, .55) 55%, rgba(34, 26, 20, .88));
  pointer-events: none;
}
.cover-photo.is-broken { display: none; }

/* Cover photo chip — opens the backdrop photo full-size in the lightbox.
   Gentle ember pill under the CTAs. Removed by JS when no backdrop photo
   exists. */
.cover-photo-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  min-height: 40px;
  margin-top: 18px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(34, 26, 20, .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: var(--cream);
  font: 700 11px/1 var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.cover-photo-open svg { width: 15px; height: 15px; flex: none; color: var(--ember); }
.cover-photo-open:hover { background: var(--ember); color: var(--cream-bright); }
.cover-photo-open:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ── Typography ────────────────────────────────────────────────────────── */
.kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ember);
}
.kicker-dark { color: var(--ember-deep); }

.cover-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(52px, 13vw, 96px);
  line-height: .98;
  letter-spacing: .01em;
  color: var(--cream);
  text-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.title-accent { color: var(--ember); }

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.05;
}
.panel-title:focus { outline: none; }
#menu .panel-title, .rsvp-panel .panel-title, .moments-panel .panel-title, .flyer-panel .panel-title, .free-panel .panel-title { color: var(--charcoal); }
.detail-panel .panel-title { color: var(--cream); }
.guest-panel .panel-title { color: var(--cream); }

.panel-lead {
  margin: 12px 0 0;
  color: var(--smoke);
  font-size: 16px;
}
#menu .panel-lead, .rsvp-panel .panel-lead, .moments-panel .panel-lead, .flyer-panel .panel-lead, .free-panel .panel-lead { color: #6f5f4a; }

.tagline {
  margin: 22px 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--cream);
}
.hosted-by {
  margin: 0 0 18px;
  color: var(--smoke);
  font-size: 15px;
}
.host-name { color: var(--cream); font-weight: 600; }

.cover-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  color: var(--cream);
  background: rgba(246, 234, 211, .08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
}
.mini-ico { display: inline-flex; color: var(--ember); }

/* Cover date + time: the separator is generated so it survives the engine's
   value write (a filled Cover Time replaces the span's text only) and
   disappears with the span when the time is empty. */
.cover-date-time::before { content: "·"; margin-right: 8px; }

/* ── Personalized guest greeting (platform `name` global) ──────────────── */
.guest-greeting {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ember);
  letter-spacing: .02em;
}
.guest-greeting::before { content: "🔥 "; }

/* ── Grill illustration ────────────────────────────────────────────────── */
.grill-art {
  display: block;
  width: clamp(150px, 42vw, 220px);
  height: auto;
  margin: 18px auto 4px;
  overflow: visible;
}
.grill-bowl { fill: #33271e; stroke: rgba(246, 234, 211, .28); stroke-width: 2; }
.grill-lid  { fill: #2b2119; stroke: rgba(246, 234, 211, .28); stroke-width: 2; }
.grill-grate { stroke: var(--cream); stroke-width: 3; opacity: .85; }
.grill-handle { stroke: var(--smoke); stroke-width: 5; stroke-linecap: round; }
.grill-knob { fill: var(--ember); }
.grill-leg { stroke: var(--smoke); stroke-width: 5; stroke-linecap: round; }
.grill-foot { stroke: var(--smoke); stroke-width: 6; stroke-linecap: round; }
.grill-fire { fill: var(--ember); }
.fire-small { fill: #f5a623; }

.smoke {
  fill: none;
  stroke: rgba(246, 234, 211, .55);
  stroke-width: 6;
  stroke-linecap: round;
}
.smoke-1 { animation: rise 5s ease-in-out infinite; }
.smoke-2 { animation: rise 6.4s ease-in-out .8s infinite; }
.smoke-3 { animation: rise 5.6s ease-in-out 1.6s infinite; }

@keyframes rise {
  0%   { transform: translateY(0);  opacity: 0; }
  25%  { opacity: .8; }
  100% { transform: translateY(-26px); opacity: 0; }
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 15px/1 var(--font-body);
  letter-spacing: .04em;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ember);
  color: var(--cream-bright);
  box-shadow: 0 6px 0 var(--ember-deep);
}
.btn-primary:hover { background: #f2702b; }

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(246, 234, 211, .08); }

.btn-block { width: 100%; }

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  justify-content: center;
}

.panel-foot { margin-top: 34px; text-align: center; }
.foot-hint { margin: 14px 0 0; color: var(--smoke); font-size: 14px; }
.detail-panel .foot-hint { color: var(--smoke); }

/* ── Menu ──────────────────────────────────────────────────────────────── */
.menu-grid {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}
@media (min-width: 560px) {
  .menu-grid { grid-template-columns: 1fr 1fr; }
}

.menu-card {
  background: #fffaf0;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 0 rgba(34, 26, 20, .06);
}
.menu-card-accent {
  background: var(--ember);
  border-color: var(--ember-deep);
  color: var(--cream-bright);
}
.menu-card-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: .01em;
  color: var(--charcoal);
}
.menu-card-accent .menu-card-title { color: var(--cream-bright); }
.menu-list { margin: 0; padding: 0; list-style: none; }
.menu-list li {
  position: relative;
  padding: 7px 0 7px 26px;
  border-bottom: 1px dashed var(--line-dark);
  font-size: 15px;
}
.menu-card-accent .menu-list li { border-color: rgba(253, 246, 231, .3); }
.menu-list li:last-child { border-bottom: 0; }
.menu-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 16px;
  width: 10px;
  height: 10px;
  background: var(--ember);
  border-radius: 2px;
  transform: rotate(45deg);
}
.menu-card-accent .menu-list li::before { background: var(--cream-bright); }

.note {
  margin: 26px 0 0;
  font-size: 14px;
  color: #6f5f4a;
  background: rgba(232, 99, 31, .1);
  border: 1px dashed var(--ember);
  border-radius: 12px;
  padding: 12px 16px;
}

/* ── Details ───────────────────────────────────────────────────────────── */
.detail-list { margin: 30px 0 0; }
.detail-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.detail-row:last-child { border-bottom: 0; }
.detail-row dt {
  flex: 0 0 120px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ember);
}
.detail-row dd { margin: 0; font-size: 16px; color: var(--cream); }
.dd-sub { color: var(--smoke); font-size: 14px; }

/* ── Moments (photo gallery — placeholders until the host swaps them) ─── */
.moments-head { margin-bottom: 8px; }
.moments-panel .foot-hint { color: #6f5f4a; }

.moments-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 28px;
}
@media (min-width: 560px) {
  .moments-grid { grid-template-columns: repeat(3, 1fr); }
}

.moment-card {
  margin: 0;
  background: #fffaf0;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(34, 26, 20, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.moment-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 rgba(34, 26, 20, .08);
}
.moment-card:focus-within { outline: 2px solid var(--ember); outline-offset: 2px; }

/* The clickable photo button (opens the built-in lightbox) */
.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.gallery-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s var(--ease);
}
.moment-card:hover .gallery-open img { transform: scale(1.05); }

.moment-caption {
  padding: 8px 10px 9px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  letter-spacing: .02em;
  color: var(--charcoal-soft);
}

/* Friendly fallback when a photo file is missing/broken (main.js adds
   .is-broken to the <img> and its .moment-card) — no broken-image icon,
   just a clear "add your photo" state. */
.moment-card.is-broken .gallery-open { display: none; }
.moment-card.is-broken {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
}
.moment-card.is-broken .moment-caption {
  padding: 0;
  color: var(--ember-deep);
}
.moment-card.is-broken .moment-caption::after {
  content: " — add your photo";
  color: var(--smoke);
  font-weight: 400;
}

/* ── Video: optional embed (the "Sizzle Reel") ─────────────────────────── */
.film-figure { margin: 0; }
.film-embed {
  position: relative;
  width: 100%;
  /* Cap by height so a tall phone screen never inflates the video; the
     16/9 ratio is preserved (width caps first on phones). */
  max-width: calc(56vh * 16 / 9);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, .7);
  /* Warm fallback while the embed loads — nothing ever looks broken. */
  background:
    radial-gradient(circle at 50% 40%, var(--ember-glow), transparent 60%),
    linear-gradient(165deg, #33271e 0%, #221a14 62%, #17110c 100%);
}
.film-embed iframe,
.film-embed video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.film-cap {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--smoke);
}
.film-open { margin: 16px 0 0; text-align: center; }
.film-open a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.film-open a:hover { background: var(--ember); color: var(--cream-bright); }
.film-open a:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ── The Flyer: optional flyer/banner showcase ─────────────────────────── */
/* Own frame + caption; centered and capped in width so a flyer reads like
   a flyer. The photo button reuses .gallery-open (4:3) — overridden to a
   portrait 4:5 crop here. */
.flyer-figure {
  margin: 0 auto;
  max-width: 380px;
  background: #fffaf0;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 0 rgba(34, 26, 20, .08);
}
.flyer-figure .gallery-open { aspect-ratio: 4 / 5; }
.flyer-figure:focus-within { outline: 2px solid var(--ember); outline-offset: 2px; }
.flyer-figure:hover .gallery-open img { transform: scale(1.04); }
.flyer-cap {
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  letter-spacing: .02em;
  color: var(--charcoal-soft);
}

/* ── Lightbox: full-screen photo viewer (built by main.js) ─────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  background: rgba(20, 15, 11, .94);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: min(92vw, 880px);
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 34px 90px -30px rgba(0, 0, 0, .85);
  cursor: zoom-in;
  transition: transform .25s var(--ease);
}
/* Zoom state: the photo scales 2× and the viewer becomes a scrollable
   pane so guests can pan around — click the photo (or the zoom button)
   to toggle, click the dark backdrop to close. */
.lightbox.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.lightbox.is-zoomed img {
  max-width: none;
  max-height: none;
  transform: scale(2);
  transform-origin: 0 0;
  align-self: flex-start;
  cursor: zoom-out;
}
.lightbox-cap,
.lightbox-hint,
.lightbox-original { align-self: center; }
.lightbox-cap {
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ember);
  text-align: center;
}
.lightbox-hint {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(246, 234, 211, .55);
  text-align: center;
}
.lightbox-original {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.lightbox-original:hover { background: var(--ember); color: var(--cream-bright); }
.lightbox-close,
.lightbox-prev,
.lightbox-next,
.lightbox-zoom {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(34, 26, 20, .75);
  color: var(--cream);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover, .lightbox-zoom:hover {
  background: var(--ember);
  color: var(--cream-bright);
}
.lightbox-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lightbox-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-zoom { bottom: calc(14px + env(safe-area-inset-bottom)); right: 14px; }
.lightbox-zoom svg { width: 19px; height: 19px; }
.lightbox-prev.is-hidden, .lightbox-next.is-hidden { display: none; }
@media (max-width: 560px) {
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* ── Forms (RSVP) ──────────────────────────────────────────────────────── */
.rsvp-wrap { width: 100%; }
.rsvp-head { margin-bottom: 26px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 7px;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  font: 400 15px/1.4 var(--font-body);
  color: var(--charcoal);
  background: #fffaf0;
  border: 2px solid #d9c9ae;
  border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--ember-glow);
}
select.form-control { appearance: none; }
textarea.form-control { resize: vertical; }

.field-hint { display: block; margin-top: 6px; font-size: 13px; color: #7a6a54; }

.error {
  display: block;
  min-height: 1.2em;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.form-actions { margin-top: 24px; }

.loading {
  display: none;
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--ember-deep);
  font-weight: 600;
}
.loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid var(--ember-glow);
  border-top-color: var(--ember);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* RSVP deadline countdown (platform fills the numbers when a deadline is set) */
.rsvp-countdown { margin: 0 0 28px; text-align: center; }
.countdown-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ember-deep);
}
.countdown-boxes { display: flex; justify-content: center; gap: 10px; }
.count-box {
  flex: 0 0 68px;
  background: var(--charcoal);
  color: var(--cream);
  border-radius: 12px;
  padding: 10px 4px;
}
.count-box span {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
}
.count-box small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--smoke);
}

/* "Thank you" / "RSVP closed" state — the platform swaps this into #rsvp-form */
.thank-you-message h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  color: var(--ember);
}
.thank-you-message p { margin: 4px 0; color: #6f5f4a; }
.thank-you-message small { color: #7a6a54; }

/* ── Guestbook (platform injects the markup into .guestbook-body) ──────── */
.guestbook-head { margin-bottom: 22px; }

/* injected form */
.guestbook-body form,
.guestbook-body #guestbookForm {
  background: rgba(246, 234, 211, .06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.guestbook-body label { color: var(--cream); }
.guestbook-body .form-control {
  color: var(--cream);
  background: rgba(246, 234, 211, .07);
  border-color: var(--line);
}
.guestbook-body .form-control:focus { border-color: var(--ember); }
.guestbook-body button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 15px/1 var(--font-body);
  color: var(--cream-bright);
  background: var(--ember);
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ember-deep);
}
.guestbook-chapta { margin: 12px 0; }

/* injected message list */
.guestbook-wrap {
  margin-top: 22px;
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line);
}
.guestbook-entry {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.guestbook-entry h5 { margin: 0 0 3px; font-size: 15px; color: var(--ember); }
.guestbook-entry p { margin: 0 0 3px; font-size: 15px; color: var(--cream); }
.guestbook-entry small { font-size: 12px; color: var(--smoke); }

.loading-guestbook {
  display: none;
  text-align: center;
  color: var(--smoke);
  font-size: 14px;
  padding: 10px 0;
}
.more-guestbook-wrap { text-align: center; margin-top: 14px; }
#load-more {
  font: 600 14px/1 var(--font-body);
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
}
#load-more:hover { background: rgba(246, 234, 211, .08); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.site-foot p { margin: 0; font-size: 13px; color: var(--smoke); }

/* ── Free page (repeatable free blocks) ───────────────────────────────── */
.free-blocks {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}
.free-block {
  padding: 24px;
  background: #fffaf0;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  box-shadow: 0 10px 0 rgba(34, 26, 20, .06);
}
.free-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: .01em;
  color: var(--charcoal);
}
.free-content { font-size: 16px; line-height: 1.7; color: var(--charcoal-soft); }
.free-content p { margin: 0 0 10px; }
.free-content p:last-child { margin-bottom: 0; }

/* Optional photo inside a free block: the figure is removed by main.js when
   the block has no photo, so a block always reads as title + text. */
.free-figure { margin: 18px 0 0; }
.free-figure .gallery-open {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
}
.free-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--charcoal);
}
.free-cap {
  margin: 8px 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: #6f5f4a;
  text-align: center;
}

/* ── Powered by Kundangi (full-width brand strip at the shell bottom) ────
   The engine swaps the token inside .link-footer for the platform name at
   render; the cockpit's Free Powered By field can override the whole line. */
.powered-by {
  width: 100%;
  text-align: center;
  padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
  background: var(--charcoal);
  border-top: 1px solid var(--line);
  color: rgba(246, 234, 211, .62);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.powered-by .link-footer {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: .05em;
  text-transform: none;
  color: var(--ember);
}

/* ── Bottom section tabs (text labels, built by main.js) ───────────────── */
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--smoke);
  font: 600 13px/1 var(--font-body);
  letter-spacing: .03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
  scroll-snap-align: center;
}
.nav-tab svg { width: 15px; height: 15px; flex: none; }
.nav-tab:hover { background: rgba(246, 234, 211, .1); color: var(--cream); }
.nav-tab.is-current {
  background: var(--ember);
  color: var(--cream-bright);
  box-shadow: 0 4px 0 var(--ember-deep);
}
.nav-tab:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }

/* ── Full-screen menu overlay (built by main.js from the same panels) ──── */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(232, 99, 31, .14), transparent 55%),
    var(--charcoal);
}
.menu-overlay.is-open { display: flex; }
.menu-overlay-inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.menu-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.menu-overlay-brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--cream);
}
.menu-overlay-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  font-size: 15px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.menu-overlay-close:hover { background: var(--ember); color: var(--cream-bright); }
.menu-overlay-close:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.menu-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(246, 234, 211, .05);
  color: var(--cream);
  font: 600 16px/1.2 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.menu-item svg { width: 20px; height: 20px; flex: none; color: var(--ember); }
.menu-item:hover { background: rgba(246, 234, 211, .1); border-color: var(--ember); }
.menu-item:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.menu-overlay-foot {
  margin: auto 0 0;
  padding-top: 26px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--smoke);
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .smoke { display: none; }
  .loading::before { animation: none; }
}

/* ── Print: expand every panel so the whole invitation prints ──────────── */
@media print {
  body, html.js body { background: #fff !important; color: #000; height: auto !important; overflow: visible !important; }
  .shell-head, .shell-nav, .shell-nav-bar, .menu-overlay, .lightbox, .film-embed, .powered-by { display: none !important; }
  .app-shell { height: auto !important; overflow: visible !important; }
  .shell-body { display: block !important; }
  .panel { display: block !important; position: static !important; height: auto !important; overflow: visible !important; padding: 24px 0 0 !important; }
  .panel-inner {
    max-width: none;
    padding: 0;
    min-height: 0;
    page-break-after: always;
  }
  .cover-panel .panel-inner { min-height: 0 !important; background: none; }
  .checker, .gingham, .grill-art, .cover-photo, .footer-brand, .cover-panel::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]::after { content: ""; }
}
