/* ═══════════════════════════════════════════════════════════════════════════
   stationery-mini-rsvp-flyer-rsvp-by — "RSVP By" (Mini RSVP · Flyer)
   The compact reminder (mailgram) · ivory + ink + vermillion postmark.

   Same stationery family as the card, louder: a dashed postmark stamp, a
   dark event chip, a "tear here" perforation, and a live countdown.

   Layout contract:
     · .app-shell locks to the viewport (100dvh) only when <html> has "js".
     · Only the ACTIVE panel scrolls internally; inactive panels are hidden.
     · Without JS the page degrades to a normal stacked, scrolling document.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --paper:       #f4edde;   /* ground */
  --paper-2:     #eae0cb;   /* deeper paper for boxes */
  --sheet:       #fdfaf3;   /* form surface */
  --ink:         #2b2620;   /* warm charcoal */
  --ink-2:       #201c17;   /* deeper ink */
  --ink-3:       #2e2922;   /* raised surface */
  --cream:       #fdfaf3;
  --cream-soft:  rgba(253, 250, 243, .68);
  --cream-faint: rgba(253, 250, 243, .4);
  --ink-soft:    #8a8172;   /* muted body text on paper */
  --ink-soft-2:  #6f675a;   /* form labels on paper */
  --ink-faint:   #b3aa99;   /* hints, placeholders, footer */
  --line:        rgba(43, 38, 32, .16);
  --line-soft:   rgba(43, 38, 32, .09);
  --line-cream:  rgba(253, 250, 243, .16);
  --seal:        #c04a2c;   /* vermillion — postmark / stamp */
  --seal-deep:   #9f3b22;
  --seal-soft:   rgba(192, 74, 44, .14);
  --gold:        #b3925c;
  --danger:      #b33a2e;
  --radius:      20px;
  --font-display: "Fraunces", Georgia, "Times New Roman", 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(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { vertical-align: middle; }

/* ── Utilities ─────────────────────────────────────────────────────────── */
.kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--seal);
}

/* ── Shell: single viewport, only the active panel scrolls ─────────────── */
.app-shell { position: relative; width: 100%; }

.js .app-shell {
  height: 100vh;                /* fallback */
  height: 100dvh;
  overflow: hidden;
}

.panel { position: relative; }

.js .panel { height: 100%; display: none; }
.js .panel.is-active { display: block; }

/* Only the active panel scrolls internally. */
.js .panel.is-active {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

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

/* ── Panel themes ──────────────────────────────────────────────────────── */
.remind-panel {
  background-color: var(--paper);
  /* faint linen dotted texture */
  background-image: radial-gradient(rgba(43, 38, 32, .04) 1px, transparent 1.4px);
  background-size: 22px 22px;
}
.detail-panel { background: var(--paper); color: var(--ink); }
.guest-panel  { background: var(--paper); }

/* ── Postmark stamp ────────────────────────────────────────────────────── */
.stamp {
  position: relative;
  width: 184px;
  height: 184px;
  margin: 6px auto 0;
  border-radius: 50%;
  border: 3px dashed var(--seal);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 14px 22px rgba(43, 38, 32, .18));
}
/* inner dashed ring, slowly rotating for a postal-cancellation feel */
.stamp::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 1.5px dashed rgba(192, 74, 44, .55);
  animation: ring-turn 32s linear infinite;
}
.stamp::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: var(--paper-2);
}
@keyframes ring-turn { to { transform: rotate(360deg); } }

.stamp-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  line-height: 1.05;
}
.stamp-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .42em;
  text-indent: .42em;
  text-transform: uppercase;
  color: var(--seal);
}
.stamp-date {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 46px;
  letter-spacing: .01em;
  color: var(--ink);
}
.stamp-waves { margin-top: 5px; }
/* Empty-value guard: with both stamp texts gone (no RSVP-by date set),
   the postmark is an empty dashed ring — hide it. */
.stamp:not(:has(.stamp-label)):not(:has(.stamp-date)) {
  display: none;
}

/* ── Reminder headline ─────────────────────────────────────────────────── */
.guest-greeting {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  text-align: center;
  color: var(--ink-soft);
}

.rsvp-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 10vw, 52px);
  line-height: 1.04;
  letter-spacing: -.015em;
  color: var(--ink);
}

.rsvp-description {
  margin: 12px auto 0;
  max-width: 32em;
  text-align: center;
  font-size: 15.5px;
  color: var(--ink-soft);
}

/* ── Event chip (name · date · time · place) ───────────────────────────── */
.event-chip {
  margin: 20px auto 0;
  max-width: 520px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 12px 24px rgba(43, 38, 32, .22);
}
.event-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  color: #fff;
}
.event-chip span[class*="event-"] { white-space: nowrap; }
/* Separator dot between chip segments, drawn on each non-first segment.
   A segment the engine removes (empty value) takes its dot with it — no
   orphan dot, no double separator, no leading/trailing gap. */
.event-chip > span:not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--seal);
}
/* Empty-value guards: hide the whole chip when every segment is gone, so
   guests never see a hollow dark pill. */
.event-chip:not(:has(.event-name)):not(:has(.event-date)):not(:has(.event-time)):not(:has(.event-place)) {
  display: none;
}
.event-date, .event-time, .event-place {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream-soft);
}

/* ── Perforation ("tear here — reply below") ───────────────────────────── */
.perforation {
  margin: 18px auto 0;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-faint);
}
.perf-line {
  flex: 1;
  border-top: 2px dashed rgba(43, 38, 32, .28);
}
.perf-mid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--seal);
  white-space: nowrap;
}

/* ── Reply-by countdown ────────────────────────────────────────────────── */
.rsvp-countdown { margin: 16px auto 0; max-width: 380px; }

.countdown-label {
  margin: 0 0 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}

.countdown-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.count-box {
  padding: 11px 4px 9px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.count-box span {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.count-box small {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-faint);
}

/* "Replies go straight to …" (filled by main.js from .host-name spans) */
.reply-to {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: var(--ink-faint);
}

/* ── RSVP form ─────────────────────────────────────────────────────────── */
.rsvp-form-display {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-row {
  display: grid;
  gap: 13px;
}
@media (min-width: 480px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.form-group label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft-2);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-control::placeholder { color: var(--ink-faint); }
.form-control:focus {
  outline: none;
  border-color: var(--seal);
  box-shadow: 0 0 0 4px var(--seal-soft);
  background: #fff;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c04a2c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}

/* The yes/no question gets a bolder field — it's the whole point of the page. */
select.form-control--big {
  padding: 15px 44px 15px 16px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  border-color: rgba(192, 74, 44, .45);
  background-color: rgba(192, 74, 44, .06);
}

textarea.form-control { resize: vertical; min-height: 72px; }

.error {
  display: block;
  min-height: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}
.field-hint { font-size: 12.5px; color: var(--ink-faint); }

/* When the guest says they can't attend, de-emphasise the party/meal fields */
.rsvp-form-display .form-group--guests,
.rsvp-form-display .form-group--meal {
  transition: opacity .2s ease;
}
#rsvp-form.is-not-attending .form-group--guests,
#rsvp-form.is-not-attending .form-group--meal { opacity: .4; }

.rsvp-note {
  margin: 12px 0 0;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(93, 122, 74, .1);
  border: 1px solid rgba(93, 122, 74, .35);
  font-size: 13.5px;
  color: var(--ink-soft-2);
  text-align: center;
}

/* ── Form actions (sticky submit — always reachable while filling in) ──── */
.form-actions {
  margin-top: 16px;
  padding-top: 10px;
  position: sticky;
  /* Clear the labelled pill nav below (2 rows on narrow phones). */
  bottom: calc(118px + env(safe-area-inset-bottom));
  z-index: 2;
  background: linear-gradient(180deg, transparent 0%, var(--paper) 30%);
}
@media (min-width: 560px) {
  .form-actions { bottom: calc(68px + env(safe-area-inset-bottom)); }
}

.form-micro {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}

.loading {
  display: none;
  margin: 12px 0 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--seal-deep);
}
.loading::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid rgba(192, 74, 44, .3);
  border-top-color: var(--seal-deep);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Platform thank-you / closed states inside #rsvp-form */
.thank-you-message h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
}
.thank-you-message p { margin: 4px 0; color: var(--ink-soft); }
.thank-you-message small { color: var(--ink-faint); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; }

.btn-primary {
  background: var(--seal);
  color: var(--cream);
  box-shadow: 0 10px 22px rgba(192, 74, 44, .3);
}
.btn-primary:hover { background: var(--seal-deep); box-shadow: 0 14px 28px rgba(192, 74, 44, .4); }

/* Details panel shares the light paper theme — button matches .btn-primary */
.btn-on-dark {
  background: var(--seal);
  color: var(--cream);
  box-shadow: 0 10px 22px rgba(192, 74, 44, .3);
}
.btn-on-dark:hover { background: var(--seal-deep); box-shadow: 0 14px 28px rgba(192, 74, 44, .4); }

.btn-block { width: 100%; }

/* ── Details panel (paper, matching the other panels) ─────────────────── */
.detail-panel .panel-head { text-align: center; margin-bottom: 22px; }
.detail-panel .panel-title { color: var(--ink); }

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  font-size: clamp(32px, 9vw, 50px);
  letter-spacing: -.015em;
  color: var(--cream);
}

.panel-lead {
  margin: 12px auto 0;
  max-width: 34em;
  font-size: 15.5px;
  color: var(--ink-soft);
}
.detail-panel .panel-lead { color: var(--ink-soft); }

.detail-list {
  margin: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}
.detail-row dt {
  flex: 0 0 96px;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--seal);
}
.detail-row dd {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
}
.detail-row .dd-sub {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-soft);
}

.hosted-by {
  margin: 24px 0 0;
  text-align: center;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.hosted-by-label { color: var(--ink-soft); }
/* Separator between co-hosts — the platform clones one .host per host, so
   the ampersand is added by CSS instead of being baked into the markup. */
.host-names .host + .host::before { content: " & "; }
.hosted-by .host-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.reply-note {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: var(--ink-faint);
}

.panel-foot { text-align: center; margin-top: 26px; }

/* ── Photos (keepsake gallery — optional panel) ───────────────────────── */
/* Self-contained, optional: delete <section id="photos"> to remove the
   gallery (main.js drops empty panels from the switcher automatically).
   Every slot ships with a designed SVG placeholder so the template shows
   finished frames out of the box; hosts replace the <img src> with their
   own files. */
.photo-panel { background: var(--paper); }
.photo-panel .panel-head { text-align: center; margin-bottom: 22px; }
.photo-panel .panel-title { color: var(--ink); }
.photo-panel .panel-lead { color: var(--ink-soft); }

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 16px;
}
@media (max-width: 359px) {
  .photo-gallery { grid-template-columns: 1fr; }
}

.photo-card {
  margin: 0;
  display: flex;
  flex-direction: column;
}
/* If a host deletes an <img> but leaves the card, the card steps out of
   the grid instead of showing an empty frame. */
.photo-card:not(:has(img)) { display: none; }

.photo-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: linear-gradient(135deg, var(--paper), var(--paper-2));
  box-shadow: 0 10px 22px rgba(43, 38, 32, .14);
  transition: transform .15s ease, box-shadow .15s ease;
}
.photo-card:hover .photo-frame {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(43, 38, 32, .18);
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.photo-caption {
  margin: 8px 4px 0;
  font-size: 12.5px;
  font-style: italic;
  text-align: center;
  color: var(--ink-soft);
}

/* ── Photos: optional film feature (video URL embed) ────────────────────
   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 <section class="film-card"> block in index.html to hide. */
.film-card {
  margin-top: 34px;
  text-align: center;
}
.film-label {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
}
.film-frame {
  position: relative;
  width: 100%;
  margin: 16px auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: var(--paper-2); /* mat behind the poster / while loading */
  border: 1.5px solid var(--line);
  box-shadow: 0 10px 22px rgba(43, 38, 32, .14);
}
.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(--seal-deep);
  background: radial-gradient(circle at 32% 28%, #fff, var(--sheet) 60%, var(--paper-2));
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px -12px rgba(43, 38, 32, .6);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform .2s 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: 3px solid var(--seal); outline-offset: -3px; }
.film-hint {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(32, 28, 23, .62);
  color: var(--cream);
  font-size: 10px; font-weight: 700; 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(--paper-2);
}
.film-external {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--seal-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(--seal); border-color: var(--seal); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px -12px rgba(43, 38, 32, .6), 0 0 0 0 rgba(192, 74, 44, .35); }
  50% { box-shadow: 0 12px 28px -12px rgba(43, 38, 32, .6), 0 0 0 14px rgba(192, 74, 44, 0); }
}

/* Featured keepsake photo on the paper Details panel (optional) */
.detail-photo { margin: 0 0 24px; }
.detail-photo:not(:has(img)) { display: none; }
.detail-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(43, 38, 32, .18);
}
.detail-photo figcaption {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-faint);
}

/* Official event flyer / banner — optional figure at the top of Details.
   Wide & slim so it reads as "the official flyer" (guests can confirm
   they're in the right place) without fighting the keepsake photo below.
   Delete the whole <figure class="banner-flyer"> block to hide. */
.banner-flyer { margin: 0 0 26px; }
.banner-flyer:not(:has(img)) { display: none; }
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 64 / 21; /* matches the 1280×420 placeholder */
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(43, 38, 32, .18);
}
.banner-flyer figcaption {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-faint);
}

/* ── Free page (optional repeatable free blocks) ────────────────────────
   A self-contained, OPTIONAL panel: repeatable blocks with a free title,
   free text and an optional photo. The platform clones the first
   .free-block once per row the host adds; leaving every block empty
   removes the whole panel (and its nav pill). Delete the whole
   <section id="free"> (or add hidden) to hide the page entirely. */
.free-panel { background: var(--paper); }
.free-panel .panel-head { text-align: center; margin-bottom: 22px; }
.free-panel .panel-title { color: var(--ink); }
.free-panel .panel-lead { color: var(--ink-soft); }

.free-blocks {
  display: grid;
  gap: 18px;
  margin-top: 6px;
}

.free-block {
  margin: 0;
  padding: 24px;
  background: var(--sheet);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(43, 38, 32, .1);
}
.free-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}
.free-content { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft-2); }
.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 the engine
   dropping the img + main.js removing the empty figure) when the block has
   no photo, so a block always reads as title + text. Clicking the photo
   opens it full-size in the lightbox (main.js). */
.free-figure { margin: 18px 0 0; }
.free-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.free-cap {
  margin: 8px 4px 0;
  font-size: 12.5px;
  font-style: italic;
  text-align: center;
  color: var(--ink-soft);
}

/* ── Guestbook (Style A mount on paper ground) ─────────────────────────── */
.guestbook-head { text-align: center; margin-bottom: 22px; }

.guestbook-title { margin: 0; }

/* The platform injects #guestbookForm, #comments-container, #load-more into
   .guestbook-body (Style A). We style that injected markup here. */
.guestbook-body #guestbookForm {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
}
.guestbook-body #guestbookForm label {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft-2);
}
.guestbook-body #guestbookForm .form-control {
  border-color: var(--line);
  background: var(--paper);
}
.guestbook-body #guestbookForm .form-control:focus { background: #fff; }
.guestbook-body #guestbookForm textarea { min-height: 88px; resize: vertical; }
.guestbook-body #guestbookForm .error { margin-top: 4px; }

.guestbook-body #guestbookForm button[type="submit"] {
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--seal);
  color: var(--cream);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.guestbook-body #guestbookForm button[type="submit"]:hover { transform: translateY(-2px); background: var(--seal-deep); box-shadow: 0 10px 22px rgba(192, 74, 44, .3); }
.guestbook-body #guestbookForm button[type="submit"]:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; }

.loading-guestbook {
  display: none;
  text-align: center;
  font-size: 13.5px;
  color: var(--seal-deep);
}

.guestbook-wrap { margin-top: 22px; display: grid; gap: 12px; }

.guestbook-entry {
  padding: 14px 16px;
  border-left: 3px solid var(--seal);
  border-radius: 0 14px 14px 0;
  background: var(--sheet);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}
.guestbook-entry h5 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.guestbook-entry p { margin: 0 0 6px; font-size: 14.5px; color: var(--ink-soft-2); }
.guestbook-entry small { font-size: 12px; color: var(--ink-faint); }

.more-guestbook-wrap { margin-top: 18px; text-align: center; }
#load-more {
  padding: 12px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
#load-more:hover { background: rgba(43, 38, 32, .06); transform: translateY(-2px); }
#load-more:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; }

/* ── Site foot ─────────────────────────────────────────────────────────── */
.site-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
}
.site-foot p { margin: 0; }
/* Empty-value guard: with the footer line gone (engine removed the <p>),
   only the two decorative dots would remain — hide the whole line. */
.site-foot:not(:has(p)) { display: none; }
.foot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seal);
}

/* ── Brand footer (placeholder) ──────────────────────────────────────────
   No-JS: a plain closing line at the end of the stacked document. JS shell:
   hidden where it starts (after the shell), then initFooter() tucks it
   into the last existing panel so it reads as the invitation's closing
   line — even when RSVP / Guestbook are stripped by the platform. */
html:not(.js) .app-footer { display: block; padding: 8px 18px 42px; text-align: center; }
html.js .app-footer { display: none; }
html.js .panel .app-footer {
  display: block;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.footer-brand {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.15em;
  text-transform: none;
  letter-spacing: .02em;
  color: var(--seal);
}

/* ── Powered by Kundangi (full-width brand strip) ────────────────────────
   A slim, full-width "Powered by Kundangi" line. No-JS: prints after the
   app footer in the stacked document. JS shell: initFooter() tucks it
   (with .app-footer) into the last panel that exists, so it survives
   RSVP/Guestbook stripping. The engine swaps the Kundangi token inside
   .link-footer for the platform name at render; the cockpit's Free
   Powered By field can override the whole line. */
html:not(.js) .powered-by {
  display: block;
  width: 100%;
  padding: 8px 18px 42px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
html.js .powered-by { display: none; }
html.js .panel .powered-by {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.powered-by .link-footer {
  font-family: var(--font-display);
  font-size: 1.2em;
  font-style: italic;
  letter-spacing: .05em;
  text-transform: none;
  color: var(--seal);
}

/* ── Section switcher — labelled text pills (clear, easy to spot & tap) ──
   Built by main.js from the panels that have content. The visible section
   name IS the label; the pill bar wraps to two rows on narrow screens and
   scrolls if a panel set ever grows taller than that. */
.panel-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: min(92vw, 560px);
  max-height: 100px;
  overflow-y: auto;
  padding: 7px 9px;
  border-radius: 16px;
  background: rgba(32, 28, 23, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(253, 250, 243, .16);
  box-shadow: 0 8px 24px rgba(43, 38, 32, .3);
  overscroll-behavior: contain;
}
.panel-nav[hidden] { display: none; }

.panel-nav button {
  min-height: 34px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(253, 250, 243, .14);
  color: var(--cream);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.panel-nav button:hover { background: rgba(253, 250, 243, .26); }
.panel-nav button.is-current {
  background: var(--seal);
  color: var(--cream);
  box-shadow: 0 6px 16px -6px rgba(192, 74, 44, .65);
}
.panel-nav button:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }

/* ── Mobile dock: ONE inline row — ‹ / › steppers flank a swipeable
   pill strip. Edge fades hint at more pills, scroll-snap settles one
   under the thumb, and main.js keeps the current pill centred and
   greys a stepper out at either end. */
.panel-nav-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
}
.pn-arrow { display: none; }

@media (max-width: 700px) {
  .panel-nav {
    flex-wrap: nowrap;
    max-height: none;
    overflow-y: visible;
    gap: 4px;
    padding: 6px 8px;
  }
  .panel-nav .pn-arrow {
    display: inline-flex;
    flex: 0 0 auto;
    appearance: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(253, 250, 243, .14);
    color: var(--cream);
    cursor: pointer;
    transition: background .15s ease, opacity .2s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .panel-nav .pn-arrow svg { width: 15px; height: 15px; display: block; }
  .panel-nav .pn-arrow:hover { background: rgba(253, 250, 243, .26); }
  .panel-nav .pn-arrow:active { transform: scale(.94); }
  .panel-nav .pn-arrow[disabled] { opacity: .32; cursor: default; pointer-events: none; }

  .panel-nav-track {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 8px;
    padding: 2px 8px;
    gap: 4px;
  }
  .panel-nav-track::-webkit-scrollbar { display: none; }
  .panel-nav-track button { flex: 0 0 auto; scroll-snap-align: center; }

  /* edge fades tucked beside the steppers, never scrolling away */
  .panel-nav::before,
  .panel-nav::after {
    content: '';
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 2;
  }
  .panel-nav::before {
    left: 44px;
    background: linear-gradient(90deg, rgba(32, 28, 23, .95) 30%, rgba(32, 28, 23, 0));
  }
  .panel-nav::after {
    right: 44px;
    background: linear-gradient(-90deg, rgba(32, 28, 23, .95) 30%, rgba(32, 28, 23, 0));
  }
  .panel-nav.is-off-left::before,
  .panel-nav.is-off-right::after { opacity: 1; }
}

/* ── Photo viewer (lightbox) — click any photo to view it full-screen ──
   Plain enhancement over the optional media slots (the [data-lightbox]
   images: gallery cards, featured Details photo, event flyer/banner). The
   viewer markup is built by main.js only when a media slot exists, so
   removing those blocks removes the viewer entirely — nothing orphaned,
   no platform contract. */
html.js .photo-frame, html.js .detail-photo, html.js .banner-flyer, html.js .free-figure { 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 .photo-frame, html.js .detail-photo, html.js .banner-flyer, html.js .free-figure { position: relative; }
html.js .photo-frame::after,
html.js .detail-photo::after,
html.js .banner-flyer::after,
html.js .free-figure::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(253, 250, 243, .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='%23c04a2c' 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(43, 38, 32, .45);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
html.js .photo-frame:hover::after,
html.js .photo-frame:focus-within::after,
html.js .detail-photo:hover::after,
html.js .detail-photo:focus-within::after,
html.js .banner-flyer:hover::after,
html.js .banner-flyer:focus-within::after,
html.js .free-figure:hover::after,
html.js .free-figure: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(31, 26, 20, .9);
  -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(--sheet);
  border-radius: 8px;
  background: var(--paper-2); /* mat while loading / if the file is missing */
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
}

.photo-viewer figcaption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--paper);
}

.photo-viewer .pv-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(72vw, 520px);
  height: min(46vh, 360px);
  border: 6px solid var(--sheet);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
}

.pv-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--seal-deep);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  transition: transform .15s ease, background-color .15s 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); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (min-width: 560px) {
  .panel-inner { padding-left: 40px; padding-right: 40px; }
}

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

/* ── Print: expand every panel so the whole reminder prints ────────────── */
@media print {
  body { background: #fff; }
  .panel-nav { display: none !important; }
  .js .app-shell { height: auto !important; overflow: visible !important; }
  .js .panel { display: block !important; height: auto !important; overflow: visible !important; }
  .panel-inner {
    max-width: none;
    padding: 20px;
    min-height: 0;
    page-break-after: always;
  }
  .stamp, .btn, .count-box, .event-chip, .foot-dot, .photo-frame, .detail-photo, .banner-flyer, .free-figure {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .film-frame iframe { display: none; } /* a playing video can't print — the poster prints instead */
  a[href]::after { content: ""; }
}
