/* ═══════════════════════════════════════════════════════════════════════
   TASTE OF THE TOWN · Food Festival Card — styles
   Refined stationery invitation. Single-viewport shell: only the active
   panel scrolls. Progressive enhancement: without JS every panel stacks
   and the page scrolls normally.

   Customize by editing the CSS custom properties below (palette, fonts,
   radii, shadows). Everything else inherits.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* palette — terracotta / olive / gold on warm paper */
  --paper:    #F6EFE2;
  --card:     #FFFDF7;
  --ink:      #31291F;
  --ink-soft: #786A50;
  --terra:    #BC4A2C;
  --terra-deep:#96351C;
  --olive:    #6E7C3C;
  --olive-deep:#525E2B;
  --gold:     #C9A227;
  --line:     #E7DAC2;
  --blush:    #F5E7D9;

  --radius:   16px;
  --shadow:   0 24px 48px rgba(49, 41, 31, .18);
  --card-line: 1px solid var(--line);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── reset / base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
ul, dl { margin: 0; padding: 0; list-style: none; }
p, h1, h2, h3, h4 { margin: 0; }

/* `hidden` must win over any author display rule (e.g. greeting chip,
   countdown) — otherwise hidden nodes would render as empty pills */
[hidden] { display: none !important; }

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

/* skip link (visible on keyboard focus) */
.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 10px; }

/* ── shell: single-viewport app ──────────────────────────────────────── */
.shell { min-height: 100vh; min-height: 100dvh; }

/* JavaScript on → fixed viewport shell; only the active panel scrolls */
html.js body { overflow: hidden; }

.js .shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.js .shell-body {
  flex: 1 1 auto;
  min-height: 0;          /* allow children to scroll internally */
  position: relative;
}

.js .panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: none;
}
.js .panel.is-active { display: block; }

/* ── header ──────────────────────────────────────────────────────────── */
.shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px clamp(14px, 4vw, 32px);
  background: var(--card);
  border-bottom: var(--card-line);
  position: relative;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-medallion {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--terra);
  color: var(--terra);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .08em;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
}
.brand:hover .brand-medallion { background: var(--blush); }

/* nav — hidden without JS (buttons need JS); fixed bottom bar on mobile,
   inline pills in the header on desktop */
.shell-nav { display: none; }

.js .shell-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 247, .95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: var(--card-line);
  overflow-x: auto;               /* 5+ items can exceed narrow screens */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;          /* scroll quietly, swipe to reveal */
}
.js .shell-nav.is-hidden { display: none; }
.js .shell-nav::-webkit-scrollbar { display: none; }

.nav-item {
  appearance: none;
  border: 1.5px solid transparent;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  flex: 0 0 auto;                 /* keep pill width, scroll instead of squeeze */
  transition: color .15s ease, background .15s ease;
}
.nav-item:hover { color: var(--ink); }
.nav-item[aria-current="true"] {
  color: var(--ink);
  background: var(--blush);
  border-color: var(--line);
}
.nav-item:focus-visible { outline-offset: 2px; }

@media (min-width: 701px) {
  .js .shell-nav {
    position: static;
    justify-content: flex-end;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-top: 0;
    padding: 0;
    overflow: visible;
  }
}

/* ── panel scaffolding ───────────────────────────────────────────────── */
.panel-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 60px) clamp(16px, 4vw, 32px)
           calc(100px + env(safe-area-inset-bottom)); /* room for mobile nav */
}
.panel-inner--narrow { max-width: 660px; }

.panel-head { text-align: center; margin-bottom: clamp(28px, 5vw, 46px); }
.panel-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--terra);
}
.panel-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5.6vw, 3.2rem);
  letter-spacing: -.01em;
  margin: 8px 0 12px;
}
.panel-sub { max-width: 58ch; margin: 0 auto; color: var(--ink-soft); }

.panel-section { margin-top: clamp(36px, 6vw, 60px); }
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.2vw, 1.8rem);
  letter-spacing: -.01em;
  margin-bottom: 22px;
  text-align: center;
}

/* ── PANEL 1 · the invitation card ───────────────────────────────────── */
.panel-invite {
  position: relative; /* anchors the optional photo backdrop */
  background:
    radial-gradient(rgba(49, 41, 31, .06) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--paper);
}

/* optional soft photo backdrop behind the card (decorative) — a wide photo
   cream-washed + re-dotted in CSS so the invitation card and text stay
   readable. Remove .stage-photo from index.html to hide it entirely. */
.stage-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.stage-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.8);
}
.stage-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(rgba(49, 41, 31, .05) 1px, transparent 1.2px) 0 0 / 22px 22px,
    radial-gradient(120% 100% at 50% 0%, rgba(246, 239, 226, .92) 0%, rgba(246, 239, 226, .66) 45%, rgba(245, 231, 217, .58) 100%);
}

.js .invite-stage { min-height: 100%; }

.invite-stage {
  position: relative;
  z-index: 1;            /* sit above the backdrop */
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) clamp(16px, 4vw, 40px)
           calc(110px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
}

/* greeting chip — filled in by main.js when the platform passes a name */
.greeting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--olive);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(82, 94, 43, .35);
}

.card-invite {
  width: 100%;
  max-width: 620px;
  background: var(--card);
  border: 1px solid var(--line);
  outline: 1px solid var(--line);
  outline-offset: 6px;
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.card-inner {
  padding: clamp(34px, 6vw, 56px) clamp(24px, 6vw, 52px);
}

.monogram {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1.5px solid var(--terra);
  border-radius: 50%;
  color: var(--terra);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .1em;
  margin-bottom: 22px;
}

.card-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 8vw, 4.3rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 14px 0 0;
}

.card-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
}
.divider-line { flex: 1; max-width: 120px; height: 1px; background: var(--line); }
.divider-mark { color: var(--gold); font-size: 14px; }

.card-sub {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  line-height: 1.45;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 34ch;
  margin: 0 auto;
}

/* optional festival photo inside the card — framed like a photograph tucked
   into an invitation. Remove <figure class="card-photo"> to hide it. */
.card-photo {
  margin: 12px auto 20px;
  padding: 6px;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 28px -18px rgba(49, 41, 31, .5);
}
.card-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
  background: var(--blush); /* soft tone while loading / if the file is missing */
}
.card-photo figcaption {
  margin-top: 6px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-soft);
}
.card-photo + .menu-strip { margin-top: 16px; }

/* menu strip — a taste of the lineup, no photos needed */
.menu-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 26px;
  flex-wrap: wrap;
}
.menu-item {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 26px;
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.card-when {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
}
.card-when strong { font-weight: 700; }

.card-note {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin-top: 12px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--ink);
  padding: 14px 30px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(49, 41, 31, .16); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn-lg { font-size: 17px; padding: 16px 36px; }
.btn-arrow { width: 15px; height: 15px; }

.stage-foot {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── brand footer placeholder ──────────────────────────────────────────
   Written after </main> in index.html. main.js tucks it into the last
   panel that exists (so it survives RSVP/Guestbook being stripped). No-JS:
   a plain closing line at the end of the stacked document. */
html:not(.js) .app-footer {
  display: block;
  padding: 10px 18px 42px;
  text-align: center;
}
html.js .app-footer { display: none; }
html.js .panel .app-footer {
  display: block;
  max-width: 600px;
  margin: clamp(36px, 6vw, 56px) auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-brand {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.3em;
  font-style: italic;
  text-transform: none;
  letter-spacing: .02em;
  color: var(--terra);
}

/* Full-width platform credit line — exact class 'powered-by' (do not
   rename). The platform convention for the 'powered by Kundangi' brand
   line at the bottom of every invitation. It sits inside .app-footer so
   it rides along when main.js tucks the footer into the last panel. */
.powered-by {
  width: 100%;
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: .85;
}
.powered-by__name { color: var(--terra); }

/* ── optional FREE PAGE (between The Plan and RSVP) ────────────────────
   A free-text page: a panel title + intro, a repeatable list of blocks
   (each a title, a note and an optional photo) and a closing line. The
   photo opens in the same full-screen viewer as every other photo slot.
   Delete the <section id="panel-free"> block from index.html to hide the
   whole page (its nav entry disappears automatically). See README § Free
   page. */
.panel-free { background: var(--paper); }

.free-blocks {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vw, 22px);
}
.free-block {
  background: var(--card);
  border: var(--card-line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 30px);
  text-align: center;
}
.free-block__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 3.4vw, 1.6rem);
  letter-spacing: -.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.free-block__content {
  margin: 10px auto 0;
  max-width: 34em;
  font-size: 14.5px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.free-block__media {
  margin: clamp(16px, 3vw, 22px) auto 0;
  max-width: 460px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 28px -18px rgba(49, 41, 31, .5);
}
.free-block__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
  background: var(--blush); /* soft tone while loading / if the file is missing */
}
.free-block__cap {
  margin-top: 6px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-soft);
}
.free-powered-by {
  margin: clamp(22px, 4vw, 30px) 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  font-style: italic;
  color: var(--terra);
}

/* ── PANEL 2 · the plan ──────────────────────────────────────────────── */
.panel-plan { background: var(--paper); }

/* the day, hour by hour */
.plan-list {
  max-width: 640px;
  margin: 0 auto;
}
.plan-item {
  display: flex;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}
.plan-item:last-child { border-bottom: 0; }
.plan-time {
  flex: 0 0 96px;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--terra);
  padding-top: 2px;
}
.plan-body { flex: 1; }
.plan-title { font-size: 18px; font-weight: 700; }
.plan-note { font-size: 14.5px; color: var(--ink-soft); margin-top: 2px; }

/* curated lineup — rows */
.lineup-list {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.vendor-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: var(--card-line);
  border-radius: var(--radius);
  padding: 16px;
}
.vendor-icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  font-size: 26px;
  background: var(--blush);
  border-radius: 50%;
}
.vendor-body { flex: 1; min-width: 0; }
.vendor-name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.2;
}
.vendor-dish { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
.vendor-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--olive-deep);
  background: var(--blush);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* optional "Festival Moments" photo gallery — remove
   .moments-gallery from index.html to hide it entirely */
.moments-gallery { text-align: center; }
.section-sub {
  max-width: 52ch;
  margin: -10px auto 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 3vw, 22px);
  max-width: 720px;
  margin: 24px auto 0;
}
.gallery-item { margin: 0; }
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 24px -20px rgba(49, 41, 31, .45);
}
.gallery-item figcaption {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

/* ── optional official flyer / banner (cover, under the invitation card) ──
   A wide framed slot for hosts who already have a designed flyer or poster
   for the event — guests can confirm they're in the right place. Clicking
   it opens the same full-screen viewer as the photos (zoom + open original).
   Delete <figure class="banner-flyer"> from index.html to hide it entirely. */
.banner-flyer {
  margin: 0;
  max-width: 560px;
  text-align: center;
}
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  outline: 1px solid var(--line);
  outline-offset: 4px;
  border-radius: 4px;
  box-shadow: 0 18px 34px -24px rgba(49, 41, 31, .55);
}
.banner-flyer figcaption {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── optional film feature (The Plan panel) ────────────────────────────
   A poster + play button that lazy-loads an <iframe> from the URL in
   data-video-url on .film-card (YouTube / Vimeo / any embeddable URL).
   Nothing loads until the guest taps play — fast and consent-friendly.
   Delete the .film-card section from index.html to hide it entirely. */
.film-card { text-align: center; }
.film-frame {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 22px auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: var(--blush);   /* mat behind the poster / while loading */
  border: 1px solid var(--line);
  box-shadow: 0 18px 34px -26px rgba(49, 41, 31, .55);
}
.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: #fff;
  background: radial-gradient(circle at 32% 28%, #d97a58, var(--terra) 60%, var(--terra-deep));
  border: 1px solid var(--blush);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .55);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform .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(--gold); outline-offset: 3px; }
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(49, 41, 31, .66);
  color: var(--paper);
  font-size: 10px;
  letter-spacing: .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-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-style: italic;
  text-align: center;
  background: var(--blush);
}
.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terra-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .2s ease, border-color .2s ease;
}
.film-external:hover { color: var(--terra); border-color: var(--terra); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .55), 0 0 0 0 rgba(188, 74, 44, .4); }
  50%      { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .55), 0 0 0 14px rgba(188, 74, 44, 0); }
}

/* practical notes */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.note-card {
  background: var(--card);
  border: var(--card-line);
  border-radius: var(--radius);
  padding: 22px;
}
.note-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}
.note-text { font-size: 14.5px; color: var(--ink-soft); }

/* end-of-panel CTA */
.panel-cta {
  margin-top: clamp(32px, 5vw, 48px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.panel-cta-text { font-size: 15.5px; font-weight: 600; color: var(--ink-soft); }

/* ── PANEL 3 · RSVP form ─────────────────────────────────────────────── */
.rsvp-wrap { background: var(--paper); }

.form-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  outline: 1px solid var(--line);
  outline-offset: 5px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }

.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.form-group .required::after { content: " *"; color: var(--terra); }

.form-control {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color .15s ease;
}
.form-control:focus { border-color: var(--terra); }
.form-control::placeholder { color: #B3A488; }
textarea.form-control { resize: vertical; min-height: 70px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23786A50' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.error {
  display: block;
  min-height: 1.25em;   /* reserve space → no layout jump when shown */
  font-size: 13px;
  font-weight: 600;
  color: var(--terra-deep);
}
.form-hint { font-size: 12.5px; color: var(--ink-soft); }

/* when "not attending", soften fields that only matter if coming */
.optional-field { transition: opacity .2s ease; }
form.is-not-attending .optional-field { opacity: .5; }

.submit-row { display: flex; justify-content: center; margin-top: 12px; }

.loading {
  display: none;                       /* platform toggles via inline style */
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  font-weight: 600;
  color: var(--ink-soft);
}
.loading .spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--terra);
  animation: spin .8s linear infinite;
}

/* countdown (shown only when a deadline is configured) */
.countdown { margin-top: 22px; }
.countdown-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terra);
}
.countdown-grid {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}
.count-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 10px 8px;
}
.count-box .count-day, .count-box .count-hour,
.count-box .count-minute, .count-box .count-second {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
}
.count-box small {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 5px;
}

/* ── PANEL 4 · guest notes (mount points + styling for injected markup) ─ */
.guestbook-section { background: var(--card); }
.guestbook-body { max-width: 600px; margin: 0 auto; }

/* the platform injects #guestbookForm with .form-control fields */
.guestbook-section .form-control { margin-bottom: 6px; }

.guestbook-wrap {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.guestbook-entry {
  background: var(--paper);
  border: var(--card-line);
  border-radius: 12px;
  padding: 16px 18px;
}
.guestbook-entry h5 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.guestbook-entry p { margin: 0 0 4px; font-size: 14.5px; color: var(--ink-soft); }
.guestbook-entry small { font-size: 12px; color: var(--ink-soft); opacity: .8; }

.more-guestbook-wrap { text-align: center; margin-top: 22px; }
#load-more { font-family: var(--font-body); font-weight: 700; }

.loading-guestbook {
  display: none;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 16px;
}

/* scoped styling for the platform-injected guestbook form + list (Style A
   mount: #guestbookForm, #comments-container, #load-more replace the empty
   .guestbook-body). Keeps the injected markup on-brand with the card. */
#guestbookForm {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#guestbookForm .form-control { width: 100%; }
#comments-container {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Photo viewer (lightbox) — click any photo to view it full-screen ──
   Plain enhancement over the optional photo slots (#hero-photo + the
   gallery). The viewer markup is built by main.js only when a photo slot
   exists, so removing those blocks removes the viewer entirely — nothing
   orphaned, no platform contract. */
html.js .card-photo, html.js .gallery-item img, html.js .banner-flyer img, html.js .free-block__media img { cursor: zoom-in; }

/* small "view full size" badge on hover / keyboard focus — shows the photo
   is clickable. Purely visual; without JS (no viewer) it never appears. */
html.js .card-photo, html.js .gallery-item, html.js .banner-flyer, html.js .free-block__media { position: relative; }
html.js .card-photo::after,
html.js .gallery-item::after,
html.js .banner-flyer::after,
html.js .free-block__media::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 253, 247, .94)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23BC4A2C' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px -4px rgba(49, 41, 31, .45);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
html.js .card-photo:hover::after,
html.js .card-photo:focus-within::after,
html.js .gallery-item:hover::after,
html.js .gallery-item:focus-within::after,
html.js .banner-flyer:hover::after,
html.js .banner-flyer:focus-within::after,
html.js .free-block__media:hover::after,
html.js .free-block__media:focus-within::after {
  opacity: 1;
  transform: none;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(49, 41, 31, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.photo-viewer.is-open { display: flex; }
.photo-viewer figure {
  margin: 0;
  max-width: min(92vw, 960px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  max-height: 76dvh;
  width: auto;
  height: auto;
  border: 6px solid var(--card);
  border-radius: 6px;
  background: var(--blush); /* mat while loading / if the file is missing */
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;       /* pointer events drive pan / pinch */
  transform-origin: center center;
  transition: transform .25s ease;
}
.photo-viewer img.pv-zoomed { cursor: grab; }
.photo-viewer img.pv-zoomed:active { cursor: grabbing; }
.photo-viewer figcaption {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--paper);
}
.photo-viewer .pv-unavailable {
  display: block;
  width: min(72vw, 520px);
  padding: 40px 24px;
  border: 6px solid var(--card);
  border-radius: 6px;
  background: var(--blush);
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
  text-align: center;
}

/* toolbar under the photo: zoom in/out/reset + open the original file */
.pv-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pv-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(246, 239, 226, .45);
  background: rgba(49, 41, 31, .82);
  color: var(--paper);
  font: 500 12px/1 var(--font-body);
  letter-spacing: .08em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.pv-tool:hover { border-color: var(--gold); background: rgba(49, 41, 31, .94); color: #fff; }
.pv-zoom-val {
  min-width: 46px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--gold);
}

.pv-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 226, .5);
  background: rgba(255, 253, 247, .94);
  color: var(--terra-deep);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  transition: transform .2s ease, background-color .2s ease;
}
.pv-btn:hover { transform: scale(1.06); background: #fff; }
.pv-close { top: calc(14px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
.pv-prev  { left: 12px;  top: 50%; transform: translateY(-50%); }
.pv-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.pv-prev:hover, .pv-next:hover { transform: translateY(-50%) scale(1.06); }
.photo-viewer :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* narrow screens: prev/next drop below the photo so they never cover it */
@media (max-width: 520px) {
  .photo-viewer { flex-direction: column; gap: 10px; }
  .photo-viewer img { max-height: 62vh; max-height: 62dvh; }
  .pv-prev, .pv-next { position: static; transform: none; }
  .pv-prev:hover, .pv-next:hover { transform: scale(1.06); }
  .pv-prev, .pv-next { width: 40px; height: 40px; }
  .photo-viewer figure { flex: 1 1 auto; justify-content: center; }
  .photo-viewer .pv-close { top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
}

/* ── responsive tweaks ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .notes-grid { grid-template-columns: 1fr; }
  .lineup-list { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .plan-item { flex-direction: column; gap: 4px; }
  .card-inner { padding: 30px 22px; }
}

/* tight phones: shrink the nav pills so all 5 tabs (incl. the free page)
   fit on one line; the bar scrolls if they ever don't */
@media (max-width: 480px) {
  .nav-item { padding: 8px 11px; font-size: 12.5px; }
}

/* ── prefers-reduced-motion: calm everything down ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .loading .spinner { animation: none; }
}

/* ── print: a clean, flat invitation ─────────────────────────────────── */
@media print {
  @page { margin: 14mm; }

  html.js body { overflow: visible; }
  .js .shell { height: auto; overflow: visible; display: block; }
  .js .shell-body { position: static; overflow: visible; }
  .js .panel {
    position: static;
    display: block !important;
    overflow: visible;
    height: auto;
  }
  .js .invite-stage { min-height: 0; }
  .panel-inner { padding: 0; }

  .shell-head, .shell-nav, .skip-link,
  .rsvp-wrap, .guestbook-section, .stage-photo { display: none !important; }

  body { background: #fff; color: #000; }
  .panel-invite { background: #fff; }
  .card-invite { box-shadow: none; outline-offset: 3px; }
  .cta-row .btn { display: none; }
  .stage-foot { color: #000; }
  .plan-item, .note-card, .vendor-item { break-inside: avoid; }
}
