/* ═══════════════════════════════════════════════════════════════════════════
   stationery-mini-rsvp-card-reply-requested — "Reply Requested" (Mini RSVP · Card)
   The classic reply card · ivory paper + ink + vermillion wax seal.

   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:     #efe6d2;   /* deeper ground (occasion panel) */
  --sheet:       #fdfaf3;   /* the reply card sheet */
  --sheet-2:     #f7f0e3;   /* sheet gradient end */
  --ink:         #2b2620;   /* warm charcoal */
  --ink-soft:    rgba(43, 38, 32, .64);
  --ink-faint:   rgba(43, 38, 32, .38);
  --line:        rgba(43, 38, 32, .16);
  --line-soft:   rgba(43, 38, 32, .09);
  --seal:        #c04a2c;   /* vermillion — postmark / wax seal */
  --seal-deep:   #9f3b22;
  --seal-soft:   rgba(192, 74, 44, .12);
  --gold:        #b3925c;   /* muted brass for hairlines */
  --danger:      #b33a2e;
  --ok:          #5d7a4a;
  --radius:      20px;
  --nav-bar-h:   72px;   /* section switcher bar height — main.js overwrites it
                            with the bar's real measured height */
  --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; }

/* The hidden attribute must win over any display rule (flex/grid cells,
   paragraphs, navs): main.js toggles it for empty states, so a bare
   label must never survive its value. */
[hidden] { display: none !important; }

/* ── 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(120px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Panel themes ──────────────────────────────────────────────────────── */
.reply-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-2); }
.guest-panel  { background: var(--paper); }

/* ── The reply card sheet ──────────────────────────────────────────────── */
.reply-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--ink-faint);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: 0 24px 48px rgba(43, 38, 32, .12), 0 4px 12px rgba(43, 38, 32, .06);
}

.reply-card-inner {
  position: relative;
  padding: 30px 22px 26px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 6px);
  background: linear-gradient(180deg, var(--sheet) 0%, var(--sheet-2) 100%);
  text-align: center;
}

/* inner hairline frame, like the rules on fine reply cards */
.reply-card-inner::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) - 12px);
  pointer-events: none;
}

.reply-card-inner > * { position: relative; }

/* Wax seal */
.seal {
  display: inline-flex;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 10px rgba(192, 74, 44, .35));
}

/* Personalized greeting */
.guest-greeting {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  color: var(--ink-soft);
}

/* Headline */
.rsvp-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 10vw, 52px);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--ink);
}

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

/* ── Event strip (date · time · place) ─────────────────────────────────── */
.event-strip {
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
}
@media (min-width: 480px) {
  .event-strip { grid-template-columns: repeat(3, 1fr); }
}

.event-cell {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}
@media (min-width: 480px) {
  .event-cell + .event-cell { border-left: 1px solid var(--line-soft); }
}

.cell-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}
.event-cell span[class*="event-"] {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

/* ── Reply-by line + countdown ─────────────────────────────────────────── */
.reply-by-line {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.reply-by-line strong { color: var(--seal-deep); font-weight: 700; }

/* When a real deadline is set, main.js adds .has-countdown to .rsvp-wrap:
   the static reply-by line steps aside for the live countdown. */
.rsvp-wrap.has-countdown .reply-by-line { display: none; }

.rsvp-countdown { margin: 16px auto 0; max-width: 380px; }

.countdown-label {
  margin: 0 0 8px;
  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: 10px 4px 8px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.count-box span {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--seal-deep);
}
.count-box small {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

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

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

.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);
}

.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, .05);
}

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);
  text-align: center;
}

/* ── Form actions (sticky submit — always reachable while filling in) ────
   Lifted above the floating section switcher. --nav-bar-h is the bar's
   real measured height (set by main.js), so the submit is never covered
   by it on any screen width. */
.form-actions {
  margin-top: 16px;
  padding-top: 10px;
  position: sticky;
  bottom: calc(var(--nav-bar-h) + env(safe-area-inset-bottom));
  z-index: 2;
  background: linear-gradient(180deg, transparent 0%, var(--sheet-2) 30%);
}

.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: 600;
  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(--sheet);
  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); }

.btn-block { width: 100%; }

/* ── Occasion panel ────────────────────────────────────────────────────── */
.panel-head { text-align: center; margin-bottom: 22px; }

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

.panel-lead {
  margin: 12px auto 0;
  max-width: 34em;
  font-size: 15.5px;
  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-faint);
}

/* The <br> sits between the primary value and its sub-line; when the
   engine removes an empty primary, the orphaned <br> must not leave a
   blank line above the sub-line. */
.detail-row dd > br:first-child { display: none; }

.hosted-by {
  margin: 24px 0 0;
  text-align: center;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.hosted-by .host-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

/* Repeating host names: the cockpit clones .host-item rows; the " & "
   separator is drawn between rows by CSS, so one, two or five hosts all
   read naturally (main.js still reads the .host-name spans to build the
   "replies go straight to…" line). */
.host-list, .host-item { display: inline; }
.host-item:not(:last-child)::after { content: " & "; }

.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; }
/* No CTA button (host cleared it) -> no empty gap at the panel foot. */
.panel-foot:empty { display: none; }

/* ── Occasion: "Keepsakes" photo gallery (optional) ─────────────────────
   Precious photos, matted and hairline-framed like the prints on a
   keepsake card. Visible by default with on-palette SVG placeholders; the
   whole feature hides by deleting the .keepsakes section (or display:none). */
.keepsakes {
  margin-top: 30px;
  text-align: center;
}

.keepsakes-label {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--seal);
}
.keepsakes-label::before,
.keepsakes-label::after {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold);
  opacity: .55;
}

.keepsakes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.keepsake-item { margin: 0; }

/* The mat: a padded sheet behind the photo, like a mounted print. */
.keepsake-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 6px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px -18px rgba(43, 38, 32, .5);
}

.keepsake-item figcaption {
  margin-top: 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ── Occasion: cover / banner photo (optional) ───────────────────────────
   A SINGLE wide image at the top of the Occasion panel — the "you're in
   the right place" moment. Matted and hairline-framed like a keepsake
   print; clicking opens the full-screen, zoomable viewer (main.js). Delete
   the whole .banner-flyer figure to hide the feature. */
.banner-flyer {
  margin: 0 0 26px;
  text-align: center;
}

.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  padding: 8px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px -22px rgba(43, 38, 32, .55);
}

.banner-flyer figcaption {
  margin-top: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
}

/* Small "view full size" badge on hover / keyboard focus, like the gallery. */
html.js .banner-flyer { position: relative; }
html.js .banner-flyer img { cursor: zoom-in; }
html.js .banner-flyer::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  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 .banner-flyer:hover::after,
html.js .banner-flyer:focus-within::after {
  opacity: 1;
  transform: none;
}

/* ── Occasion: film feature (optional video embed) ───────────────────────
   A matted, hairline-framed poster with a wax-seal play button. The video
   (data-video-url on .film-card: any YouTube / Vimeo / embeddable URL) is
   lazy-loaded only when the guest taps play. Delete the whole .film-card
   section to hide the feature. */
.film-card {
  margin-top: 34px;
  text-align: center;
}

.film-card__label {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--seal);
}
.film-card__label::before,
.film-card__label::after {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold);
  opacity: .55;
}

.film-card__lede {
  margin: 8px auto 0;
  max-width: 30em;
  font-size: 14px;
  color: var(--ink-soft);
}

.film-frame {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 16px auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: var(--paper-2); /* mat behind the poster / while loading */
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px -20px rgba(43, 38, 32, .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(58px, 13vmin, 74px);
  height: clamp(58px, 13vmin, 74px);
  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) 55%, #e9ddc3);
  border: 1.5px solid rgba(192, 74, 44, .4);
  box-shadow: 0 12px 26px -10px rgba(43, 38, 32, .6);
  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(43, 38, 32, .6);
  color: var(--paper);
  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-frame.is-playing .film-open { display: none; }

.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  color: var(--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 rgba(192, 74, 44, .4);
  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; }

/* ── Free page (optional "In Our Words" panel, host-filled) ─────────────
   One repeatable block per entry: title + free text + an OPTIONAL photo.
   The panel ships with one placeholder block; the render engine replaces
   it with the host's blocks, or removes the whole .panel-free section when
   there are none (or the host toggles Free Page off) — so the pill that
   main.js builds from this panel disappears with it. */
.panel-free { background: var(--paper); }

.free-blocks {
  display: grid;
  gap: 30px;
}

.free-block { margin: 0; text-align: center; }

.free-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 6.5vw, 34px);
  line-height: 1.12;
  letter-spacing: -.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* The photo is matted and hairline-framed like the keepsake prints;
   clicking it opens the full-screen viewer (main.js). */
.free-media {
  margin: 0 auto 16px;
  max-width: 480px;
}

.free-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 6px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 26px -20px rgba(43, 38, 32, .5);
}

.free-content {
  margin: 0 auto;
  max-width: 34em;
  text-align: left;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ── 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);
}
.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(--sheet);
  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); }
.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(--ink-faint);
  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; }
.foot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seal);
}

/* ── Brand footer (placeholder) — tucked into the last panel by main.js ── */
.app-footer { display: none; }
html:not(.js) .app-footer {
  display: block;
  padding: 18px 16px 90px;
  text-align: center;
}
html.js .panel .app-footer {
  display: block;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.footer-brand {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.3em;
  text-transform: none;
  letter-spacing: .02em;
  color: var(--seal-deep);
}

/* ── Full-width powered-by brand strip (exact class 'powered-by') ───────
   A slim, full-width platform credit line written after the shell (so it
   survives the no-JS stacked document); main.js tucks it into the end of
   the last panel that exists, above the .app-footer. The render engine
   swaps the literal brand token inside .link-footer for the platform
   name; the cockpit's Free Powered By field can override the whole line. */
.powered-by {
  width: 100%;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
html:not(.js) .powered-by {
  margin-top: 0;
  padding: 16px 16px 6px;
  border-top: 0;
}
.powered-by .link-footer {
  font-family: var(--font-display);
  font-size: 1.3em;
  text-transform: none;
  letter-spacing: .02em;
  color: var(--seal-deep);
}

/* ── Section switcher (text pills) ────────────────────────────────────────
   Built by main.js from the panels that actually have content — clear,
   labeled buttons (Reply · Occasion · Notes), easy to spot and to tap.
   The pill bar floats bottom-center; main.js keeps --nav-bar-h in sync
   with its real height so the sticky submit never hides behind it. */
.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;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: calc(100vw - 20px);
  max-height: 100px;               /* two pill rows on narrow phones — never a tall stack */
  overflow-y: auto;                /* if a panel set grows beyond that, the bar scrolls */
  padding: 6px;
  border-radius: 999px;
  background: rgba(253, 250, 243, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(43, 38, 32, .14);
  overscroll-behavior: contain;
}
.panel-nav[hidden] { display: none; }

.panel-nav button {
  min-height: 40px;                 /* comfortable touch target */
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
/* A tiny dot before each label — the ghost of the old dot switcher. */
.panel-nav button::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}
.panel-nav button:hover { background: rgba(43, 38, 32, .06); }
.panel-nav button.is-current {
  background: var(--seal);
  color: var(--sheet);
  box-shadow: 0 6px 16px -6px rgba(192, 74, 44, .6);
}
.panel-nav button.is-current::before { opacity: 1; }
.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: 4px;
  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;
  }
  .panel-nav .pn-arrow {
    display: inline-flex;
    flex: 0 0 auto;
    appearance: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(43, 38, 32, .06);
    color: var(--ink-soft);
    cursor: pointer;
    transition: background-color .15s ease, opacity .2s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  /* steppers are chevrons — no label dot */
  .panel-nav .pn-arrow::before { content: none; }
  .panel-nav .pn-arrow svg { width: 15px; height: 15px; display: block; }
  .panel-nav .pn-arrow:hover { background: rgba(43, 38, 32, .12); }
  .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: 46px;
    background: linear-gradient(90deg, rgba(253, 250, 243, .97) 30%, rgba(253, 250, 243, 0));
  }
  .panel-nav::after {
    right: 46px;
    background: linear-gradient(-90deg, rgba(253, 250, 243, .97) 30%, rgba(253, 250, 243, 0));
  }
  .panel-nav.is-off-left::before,
  .panel-nav.is-off-right::after { opacity: 1; }
}

/* Narrow phones: tighten the pills so all sections fit in two rows, and
   keep the tap targets ≥ 40px. */
@media (max-width: 520px) {
  .panel-nav {
    gap: 3px;
    padding: 5px;
  }
  .panel-nav button {
    min-height: 40px;
    padding: 7px 12px;
    font-size: 12.5px;
  }
}

/* ── Photo viewer (lightbox) — click any cover / keepsake photo to view
   it full-screen and zoom in. Plain enhancement over the optional photo
   slots (the [data-lightbox] images: .banner-flyer cover + .keepsakes).
   The viewer markup is built by main.js only when a photo slot exists, so
   removing the photos removes the viewer entirely — nothing orphaned, no
   platform contract. */
html.js .keepsake-item 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 .keepsake-item { position: relative; }
html.js .keepsake-item::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 .keepsake-item:hover::after,
html.js .keepsake-item:focus-within::after {
  opacity: 1;
  transform: none;
}

/* Same "view full size" affordance for the optional free-page photo. */
html.js .free-media img { cursor: zoom-in; }
html.js .free-media { position: relative; }
html.js .free-media::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 .free-media:hover::after,
html.js .free-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(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;
}

/* The stage wraps the photo so zoomed images can pan (scroll/drag) without
   the caption scrolling away. */
.pv-stage {
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

.photo-viewer img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 76vh;
  max-height: 76dvh;
  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);
  transition: width .18s ease; /* gentle when zooming */
}

/* Zoomed: the stage becomes a scroll pane; the photo (width set by main.js:
   200% / 300%) pans inside it. */
.photo-viewer figure.is-zoomed .pv-stage {
  overflow: auto;
  max-height: 72vh;
  max-height: 72dvh;
  scrollbar-width: thin;
}
.photo-viewer figure.is-zoomed img {
  max-width: none;
  max-height: none;
  border-width: 4px;
}

html.js .photo-viewer img { cursor: zoom-in; }
html.js .photo-viewer figure.is-zoomed img { cursor: zoom-out; }

.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, opacity .15s ease;
}
.pv-btn:hover { transform: scale(1.06); background: #fff; }
.pv-btn:disabled {
  opacity: .35;
  cursor: default;
}
.pv-btn:disabled:hover { transform: none; background: var(--sheet); }
.pv-close { top: calc(14px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
.pv-zoom-out { top: calc(14px + env(safe-area-inset-top)); left: calc(14px + env(safe-area-inset-left)); }
.pv-zoom-in  { top: calc(14px + env(safe-area-inset-top)); left: calc(68px + env(safe-area-inset-left)); }
.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); }
.pv-btn[hidden] { display: none; }

.pv-zoom-hint {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  max-width: calc(100vw - 24px);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(253, 250, 243, .85);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-style: italic;
  text-align: center;
  pointer-events: none;
}
.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 figure.is-zoomed .pv-stage { max-height: 60vh; max-height: 60dvh; }
  .photo-viewer .pv-close { top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
  .photo-viewer .pv-zoom-out { top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); }
  .photo-viewer .pv-zoom-in  { top: calc(10px + env(safe-area-inset-top)); left: calc(64px + env(safe-area-inset-left)); }
}

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

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

/* ── Print: expand every panel so the whole card prints ────────────────── */
@media print {
  body { background: #fff; }
  .panel-nav, .photo-viewer, .app-footer, .powered-by { 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;
  }
  .reply-card { box-shadow: none; }
  .seal, .btn, .count-box, .event-strip, .foot-dot, .keepsake-item img,
  .banner-flyer img, .film-frame, .free-media img {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .banner-flyer, .film-card, .keepsakes, .free-block { page-break-inside: avoid; }
  .film-frame iframe { display: none; } /* a playing video can't print — the poster prints instead */
  a[href]::after { content: ""; }
}


/* ── Guestbook (platform-injected form + message list) ─────────────── */
/* Existing .guestbook-body #guestbookForm rules already style the form;
   this block fills the two remaining gaps (reCAPTCHA slot + the injected
   list container's inline styles). */
.guestbook-body #guestbookForm .guestbook-chapta {
  max-width: 304px;
  margin: 0 auto;
}

#comments-container.guestbook-wrap {
  border-top: 1px solid var(--line) !important;
  margin-top: 22px !important;
  max-height: none !important;
  overflow: visible !important;
}
