/* ════════════════════════════════════════════════════════════════════════
   TRICKS & TREATS AT THE WITCHING HOUR — Halloween Invitation (card)
   assets/css/styles.css

   Design: elegant vintage stationery. Deep plum shell, cream paper card
   with an ornate double border, wax seal, blackletter title and refined
   serif prose. Playful-spooky details kept in the details (bat divider,
   corner spider webs). One fixed 100dvh shell: header / scrollable
   panels / tab bar.

   ── THEME TOKENS ──  edit this block to restyle the whole card ──
   ════════════════════════════════════════════════════════════════════════ */
:root {
  /* palette */
  --pumpkin:      #e8590c;   /* deep autumn orange */
  --pumpkin-glow: #ffb347;   /* warm highlight */
  --gold:         #b98a2f;   /* antique gold accent */
  --ink:          #241020;   /* deep plum (page background) */
  --ink-2:        #2e1430;   /* raised surface */
  --ink-3:        #3a1a3d;
  --paper:        #f8efdc;   /* cream stationery */
  --paper-2:      #fdf6e6;
  --ink-text:     #2b1220;   /* dark plum ink on paper */
  --muted:        #7a5c58;
  --ghost:        #d9b8d6;   /* soft lavender accent */
  --error:        #b3261e;
  --line:         rgba(248, 239, 220, .16);
  --line-strong:  rgba(248, 239, 220, .30);

  /* type */
  --font-display: 'Pirata One', 'Old English Text MT', 'UnifrakturMaguntia', 'Georgia', serif;
  --font-body:    'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;

  /* shape + depth */
  --radius:       22px;
  --radius-sm:    10px;
  --shadow:       0 24px 60px rgba(0, 0, 0, .5);

  /* motion */
  --ease:         cubic-bezier(.22, .61, .36, 1);
}

/* ─────────────────────────────── base ─────────────────────────────── */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--paper);
  background:
    radial-gradient(1100px 700px at 50% -12%, #3a1a3d 0%, transparent 62%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--pumpkin);
  color: #fff8ec;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  font-size: .9rem;
}
.skip-link:focus { left: 8px; }

/* ════════════════════════════════════════════════════════════════════
   APP SHELL — one viewport; only the active panel scrolls
   ════════════════════════════════════════════════════════════════════ */
.app {
  height: 100vh; /* fallback */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(1300px 800px at 50% 0%, rgba(232, 89, 12, .07), transparent 55%),
    var(--ink);
}

/* ── header ── */
.app-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(36, 16, 32, .88);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 6;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .04em;
}
.brand svg { width: 22px; height: 22px; color: var(--pumpkin); flex: none; }
.brand:hover .brand-name { color: var(--pumpkin-glow); }
.brand-date {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pumpkin-glow);
  background: rgba(232, 89, 12, .14);
  border: 1px solid rgba(232, 89, 12, .4);
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
}

/* ── main: the scroll container for the active panel ── */
.app-main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s linear .3s;
  scrollbar-width: thin;
  scrollbar-color: rgba(248, 239, 220, .3) transparent;
}
.panel.is-active {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.panel:focus { outline: none; }

.panel-pad {
  max-width: 640px;
  margin: 0 auto;
  padding: 26px 18px calc(34px + env(safe-area-inset-bottom));
}

/* ── tab bar ── */
.app-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(36, 16, 32, .94);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 6;
}
.tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 52px;               /* comfortable touch target */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: rgba(248, 239, 220, .6);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;     /* no double-tap zoom / 300ms delay */
  transition: background .2s, color .2s, transform .12s;
}
.tab svg { width: 20px; height: 20px; }
.tab:hover { color: var(--paper); background: rgba(248, 239, 220, .06); }
.tab:active { transform: scale(.96); }
.tab.is-active {
  color: #fff8ec;
  background: linear-gradient(180deg, #8a2f1f, #5e1f14);
  border-color: rgba(255, 179, 71, .45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.tab.is-active svg { color: var(--pumpkin-glow); }
.tab:focus-visible { outline: 2px solid var(--pumpkin-glow); outline-offset: 2px; }
.tab[hidden] { display: none; }

/* ════════════════════════════════════════════════════════════════════
   PANEL 1 · THE INVITATION CARD
   ════════════════════════════════════════════════════════════════════ */
.panel-invite {
  background:
    radial-gradient(900px 460px at 50% -40px, rgba(232, 89, 12, .14), transparent 60%),
    var(--ink);
}

.invite-stage {
  max-width: 620px;
  margin: 0 auto;
  padding: 34px 18px calc(44px + env(safe-area-inset-bottom));
}

/* the paper card */
.card-invite {
  position: relative;
  padding: 52px 30px 42px;
  background:
    radial-gradient(500px 300px at 50% 0%, rgba(255, 240, 200, .5), transparent 70%),
    repeating-linear-gradient(0deg, rgba(43, 18, 32, .012) 0 2px, transparent 2px 5px),
    var(--paper-2);
  color: var(--ink-text);
  border: 1px solid rgba(43, 18, 32, .25);
  border-radius: 6px;              /* gently sharp corners, like a card */
  box-shadow:
    0 0 0 6px var(--paper),
    0 0 0 7px rgba(185, 138, 47, .55),
    0 26px 60px rgba(0, 0, 0, .55);
  text-align: center;
}
/* inner hairline frame */
.card-invite::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(43, 18, 32, .22);
  border-radius: 3px;
  pointer-events: none;
}

/* corner webs */
.card-web { position: absolute; width: 92px; height: 92px; opacity: .8; z-index: 1; }
.card-web--tl { top: 22px; left: 22px; }
.card-web--tr { top: 22px; right: 22px; transform: scaleX(-1); }

/* wax seal */
.card-seal-wrap {
  position: relative;
  margin: 0 auto 22px;
  width: 96px;
  z-index: 2;
}
.card-seal {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(43, 18, 32, .35));
}
.card-seal-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -16px;
  width: 3px;
  height: 22px;
  background: rgba(43, 18, 32, .5);
  transform: translateX(-50%);
  border-radius: 2px;
}

.card-eyebrow {
  margin: 0 0 14px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
}

.card-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 9vw, 3.2rem);
  line-height: 1.05;
  font-weight: 400;
  color: var(--pumpkin);
  text-shadow: 0 2px 0 rgba(43, 18, 32, .12);
}

.card-prose {
  margin: 0 auto 24px;
  max-width: 30em;
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink-text);
}

/* optional keepsake photo inside the card — matted like a real photo
   tucked into a printed invitation. Remove the <figure> to hide it. */
.card-photo {
  position: relative;
  width: min(82%, 400px);
  margin: 0 auto 26px;
  padding: 7px;
  background: var(--paper-2);
  border: 1px solid rgba(43, 18, 32, .25);
  box-shadow:
    0 0 0 4px var(--paper),
    0 0 0 5px rgba(185, 138, 47, .5),
    0 16px 28px -20px rgba(43, 18, 32, .5);
}
.card-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
  background: rgba(43, 18, 32, .07); /* mat tone while loading / if the file is missing */
}
.card-photo figcaption {
  margin: 8px 0 0;
  font-size: .84rem;
  font-style: italic;
  color: var(--muted);
}

/* details list */
.card-details {
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 0;
  text-align: left;
}
.detail-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 14px;
  padding: 9px 4px;
  border-bottom: 1px dotted rgba(43, 18, 32, .3);
}
.detail-row:first-child { border-top: 1px dotted rgba(43, 18, 32, .3); }
.detail-row dt {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 3px;
  white-space: nowrap;
}
.detail-row dd {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-text);
}

/* bat divider */
.card-divider { margin: 6px 0 18px; }
.card-divider svg { width: min(230px, 60vw); height: auto; display: block; margin: 0 auto; }

.card-rsvp-line {
  margin: 0 auto 22px;
  max-width: 28em;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--ink-text);
}
.card-rsvp-line strong { color: var(--pumpkin); font-style: normal; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 3px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn--primary {
  background: linear-gradient(180deg, #a6391f, #7a2413);
  color: #fff8ec;
  border-color: #5e1f14;
  box-shadow: 0 8px 20px rgba(90, 30, 18, .35);
}
.btn--primary:hover { box-shadow: 0 10px 28px rgba(90, 30, 18, .5); }
.btn--ghost {
  background: transparent;
  color: var(--ink-text);
  border-color: rgba(43, 18, 32, .4);
}
.btn--ghost:hover { border-color: var(--pumpkin); color: var(--pumpkin); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

.card-ps {
  margin: 26px 0 0;
  font-size: .92rem;
  font-style: italic;
  color: var(--muted);
}

/* ════════════════════════════════════════════════════════════════════
   SHARED PANEL CHROME (RSVP + guestbook) — dark plum cards
   ════════════════════════════════════════════════════════════════════ */
.panel-eyebrow {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}
.panel-eyebrow::before { content: '✦ '; }

.rsvp-card,
.guestbook-card,
.photos-section {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px 24px 32px;
  box-shadow: var(--shadow);
}

.rsvp-head { text-align: center; margin-bottom: 24px; }
.rsvp-title,
.guestbook-title,
.photos-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--pumpkin-glow);
}
.rsvp-description,
.guestbook-description,
.photos-description {
  margin: 0 auto;
  max-width: 32em;
  font-size: 1rem;
  font-style: italic;
  color: rgba(248, 239, 220, .82);
}
.guest-greeting {
  margin: 12px 0 0;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--pumpkin-glow);
}

/* countdown (shown only when the host sets an RSVP deadline) */
.countdown {
  margin-top: 22px;
  padding: 14px 10px 12px;
  border: 1px dashed rgba(255, 179, 71, .5);
  border-radius: var(--radius-sm);
  background: rgba(232, 89, 12, .08);
}
.countdown-label {
  margin: 0 0 10px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ghost);
}
.countdown-grid { display: flex; justify-content: center; gap: 8px; }
.countdown-cell {
  min-width: 58px;
  padding: 8px 6px 6px;
  background: rgba(20, 8, 18, .6);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.countdown-cell span {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pumpkin-glow);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.countdown-cell small {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(248, 239, 220, .6);
  margin-top: 2px;
}

/* ─────────────────────────────── forms ─────────────────────────────── */
.form-group { margin: 0 0 16px; text-align: left; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ghost);
}
.label-hint { font-weight: 500; opacity: .7; text-transform: none; letter-spacing: 0; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 1.02rem;
  color: var(--paper);
  background: rgba(20, 8, 18, .5);
  border: 1.5px solid rgba(248, 239, 220, .25);
  border-radius: 6px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: rgba(248, 239, 220, .35); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pumpkin-glow);
  background: rgba(20, 8, 18, .75);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, .2);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--pumpkin-glow) 50%),
                    linear-gradient(135deg, var(--pumpkin-glow) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 2px), calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.error {
  display: block;
  margin-top: 5px;
  font-size: .85rem;
  font-weight: 700;
  color: #ff8a7a;
  min-height: 1em;
}
.field-hint {
  margin: 5px 0 0;
  font-size: .86rem;
  font-style: italic;
  color: rgba(248, 239, 220, .5);
}

/* guest party fields — tucked away when declining */
.guest-fields {
  padding: 14px 14px 2px;
  border: 1px dashed rgba(255, 179, 71, .45);
  border-radius: 8px;
  margin-bottom: 16px;
}
.guest-fields.is-hidden-fields { display: none; }
.decline-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-size: .95rem;
  font-style: italic;
  color: rgba(248, 239, 220, .85);
  text-align: center;
}
.decline-note[hidden] { display: none; }

.form-submit { text-align: center; margin-top: 4px; }
.form-submit .btn { width: 100%; justify-content: center; }

/* platform states */
#rsvp-form .loading {
  margin-top: 12px;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--pumpkin-glow);
}
#rsvp-form .loading::before,
.loading-guestbook::before {
  content: '';
  display: inline-block;
  width: .95em;
  height: .95em;
  margin-right: .55em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -0.18em;
  animation: spin .8s linear infinite;
}

.thank-you-message {
  text-align: center;
  padding: 30px 12px 14px;
}
.thank-you-message h3, .thank-you-message h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--pumpkin-glow);
}
.thank-you-message p {
  margin: 6px 0;
  color: rgba(248, 239, 220, .85);
  font-size: 1rem;
}
.thank-you-message small { color: rgba(248, 239, 220, .55); }

/* ════════════════════════════════════════════════════════════════════
   PLATFORM-INJECTED GUESTBOOK MARKUP
   (the platform replaces .guestbook-body with #guestbookForm,
   #comments-container and #load-more — we only style it)
   ════════════════════════════════════════════════════════════════════ */
#guestbookForm .form-group label { color: var(--ghost); }
#guestbookForm .form-control {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 1.02rem;
  color: var(--paper);
  background: rgba(20, 8, 18, .5);
  border: 1.5px solid rgba(248, 239, 220, .25);
  border-radius: 6px;
  transition: border-color .2s, box-shadow .2s;
}
#guestbookForm .form-control:focus {
  outline: none;
  border-color: var(--pumpkin-glow);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, .2);
}
#guestbookForm .error {
  display: block;
  margin-top: 5px;
  font-size: .85rem;
  font-weight: 700;
  color: #ff8a7a;
  min-height: 1em;
}
.guestbook-chapta { margin: 14px 0; display: flex; justify-content: center; }
#guestbookForm button[type="submit"],
.guestbook-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 26px;
  border-radius: 3px;
  border: 1.5px solid #5e1f14;
  background: linear-gradient(180deg, #a6391f, #7a2413);
  color: #fff8ec;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(90, 30, 18, .35);
}
#guestbookForm button[type="submit"]:hover { box-shadow: 0 10px 28px rgba(90, 30, 18, .5); }
.loading-guestbook {
  margin-top: 12px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--pumpkin-glow);
}

/* message list (injected entries) */
#comments-container.guestbook-wrap {
  margin-top: 28px;
  border-top: 1px dashed var(--line-strong);
}
.guestbook-entry {
  padding: 16px 4px 14px;
  border-bottom: 1px dashed var(--line);
  text-align: left;
}
.guestbook-entry:last-child { border-bottom: 0; }
.guestbook-entry h5 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pumpkin-glow);
}
.guestbook-entry p {
  margin: 0 0 5px;
  font-size: .98rem;
  line-height: 1.6;
  color: rgba(248, 239, 220, .9);
}
.guestbook-entry small {
  font-size: .8rem;
  font-style: italic;
  color: rgba(248, 239, 220, .5);
}
.more-guestbook-wrap { text-align: center; margin-top: 20px; }
#load-more {
  padding: 11px 26px;
  border-radius: 3px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
}
#load-more:hover { border-color: var(--pumpkin-glow); color: var(--pumpkin-glow); }

/* ════════════════════════════════════════════════════════════════════
   PHOTOS — optional keepsake photo + "Memories" gallery + viewer
   (template-owned, no platform contract). Remove a block in index.html
   or add `display: none` here to hide a feature.
   ════════════════════════════════════════════════════════════════════ */
.photos-head { text-align: center; margin-bottom: 24px; }

/* ── Optional official flyer / banner ──
   A wide framed slot up top (above the card) for hosts who already have a
   designed flyer or poster for the party — shown so guests can confirm
   they're in the right place with the right link. Clicking it opens the
   same full-screen viewer as the photos. Delete the <figure> to hide it. */
.banner-flyer {
  margin: 0 auto clamp(30px, 5.5vmin, 44px);
  max-width: 620px;
  text-align: center;
}
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  padding: 7px;
  background: var(--paper-2);
  border: 1px solid rgba(185, 138, 47, .55);
  border-radius: 4px;
  box-shadow:
    0 0 0 5px rgba(248, 239, 220, .05),
    0 18px 40px -24px rgba(0, 0, 0, .8);
}
.banner-flyer figcaption {
  margin-top: 8px;
  font-size: .86rem;
  font-style: italic;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 3.4vmin, 26px);
}
.gallery-item { margin: 0; }
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 6px;
  background: var(--paper-2);
  border: 1px solid rgba(248, 239, 220, .28);
  border-radius: 4px;
  box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .7);
}
.gallery-item figcaption {
  margin-top: 8px;
  font-size: .92rem;
  font-style: italic;
  color: rgba(248, 239, 220, .85);
  text-align: center;
}

/* ── 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, or a direct
   .mp4/.webm file). Nothing loads until the guest taps play — fast and
   consent-friendly. Delete the whole .film-card section to hide it. */
.film-card {
  margin-top: clamp(30px, 5.5vmin, 44px);
  text-align: center;
}
.film-label {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}
.film-label::before { content: '✦ '; }
.film-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: clamp(16px, 3.4vmin, 24px) auto 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ink-3); /* mat behind the poster / while loading */
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 34px -24px rgba(0, 0, 0, .8);
}
.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(--ink-text);
  background: radial-gradient(circle at 32% 28%, #ffd9a0, var(--paper-2) 60%, var(--paper));
  border: 1px solid rgba(185, 138, 47, .6);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .65);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform .25s var(--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(--pumpkin-glow); outline-offset: 3px; }
.film-hint {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(20, 8, 18, .62);
  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,
.film-frame video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #000;
}
.film-note {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 0; padding: 0 18px;
  color: rgba(248, 239, 220, .55);
  font-size: .9rem; font-style: italic; text-align: center;
  background: var(--ink-3);
}
.film-external {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--pumpkin-glow);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 179, 71, .4);
  padding-bottom: 2px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.film-external:hover { color: var(--gold); border-color: var(--gold); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .65), 0 0 0 0 rgba(232, 89, 12, .4); }
  50% { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .65), 0 0 0 14px rgba(232, 89, 12, 0); }
}

/* ── Optional Free Page (host-written "Notes" panel) ──
   Repeatable free blocks, each with a title, free text and an OPTIONAL
   photo (the engine removes .free-media when the host leaves the image
   empty, so a block always reads cleanly as title + text). */
.free-blocks {
  display: grid;
  gap: clamp(20px, 4vmin, 28px);
}
.free-block {
  margin: 0;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow);
  text-align: left;
}
.free-media { margin: 0 0 18px; }
.free-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 6px;
  background: var(--paper-2);
  border: 1px solid rgba(248, 239, 220, .28);
  border-radius: 4px;
  box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .7);
}
.free-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--pumpkin-glow);
}
.free-title::before { content: '✦ '; color: var(--gold); }
.free-content {
  margin: 0;
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.7;
  color: rgba(248, 239, 220, .88);
  white-space: pre-line;
}

/* ── Brand footer (placeholder) ──
   No-JS: a plain closing line at the end of the stacked document. JS shell:
   hidden where it starts (after </main>), then initFooter() tucks it into
   the last existing panel so it reads as the invitation's closing line —
   even when RSVP / Guestbook are stripped. */
html.no-js .app-footer { display: block; padding: 26px 18px 42px; text-align: center; }
html:not(.no-js) .app-footer { display: none; }
html:not(.no-js) .panel .app-footer {
  display: block;
  margin-top: clamp(30px, 6vmin, 48px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ── Powered-by brand strip (full-width footer line) ──
   Sits between the scroll area and the tab bar in the JS shell (flex
   child of .app); in the no-JS stacked document it lands at the end of
   the page. The cockpit's Free Powered By field can override the text;
   leaving it empty keeps the baked-in "Powered by <platform>" line. */
.powered-by {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  padding: 9px 16px;
  background: rgba(36, 16, 32, .94);
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(248, 239, 220, .5);
}
.powered-by .link-footer {
  color: var(--gold);
  font-style: normal;
}
.footer-brand {
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(248, 239, 220, .5);
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.25em;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--pumpkin-glow);
}

/* ── Photo viewer (lightbox) — click any photo to view it full-screen ──
   Built by main.js only while a [data-lightbox] photo slot exists, so
   removing those blocks removes the viewer too — nothing orphaned. */
html:not(.no-js) .card-photo img, html:not(.no-js) .gallery-item img, html:not(.no-js) .banner-flyer img, html:not(.no-js) .free-media img { cursor: zoom-in; }

/* small "view full size" badge on hover / keyboard focus — purely
   visual; without JS (no viewer) it never appears. */
html:not(.no-js) .card-photo, html:not(.no-js) .gallery-item, html:not(.no-js) .banner-flyer, html:not(.no-js) .free-media { position: relative; }
html:not(.no-js) .card-photo::after,
html:not(.no-js) .gallery-item::after,
html:not(.no-js) .banner-flyer::after,
html:not(.no-js) .free-media::after {
  content: "";
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(248, 239, 220, .95)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b1220' 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 rgba(185, 138, 47, .6);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  pointer-events: none;
}
html:not(.no-js) .card-photo:hover::after,
html:not(.no-js) .card-photo:focus-within::after,
html:not(.no-js) .gallery-item:hover::after,
html:not(.no-js) .gallery-item:focus-within::after,
html:not(.no-js) .banner-flyer:hover::after,
html:not(.no-js) .banner-flyer:focus-within::after,
html:not(.no-js) .free-media:hover::after,
html:not(.no-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(20, 8, 18, .93);
  -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(--paper-2);
  border-radius: 4px;
  background: rgba(43, 18, 32, .3); /* mat while loading / if the file is missing */
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.photo-viewer figcaption {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: .02em;
  color: var(--pumpkin-glow);
}
.photo-viewer .pv-unavailable {
  display: flex; align-items: center; justify-content: center;
  width: min(72vw, 520px); height: min(46vh, 360px);
  border: 6px solid var(--paper-2); border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px; font-style: italic;
  text-align: center;
}

.pv-btn {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(248, 239, 220, .5);
  background: rgba(248, 239, 220, .95);
  color: var(--ink-text);
  font-size: 24px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  transition: transform .2s var(--ease), background-color .2s var(--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-zoom  { bottom: calc(14px + env(safe-area-inset-bottom)); right: calc(14px + env(safe-area-inset-right)); }
.pv-prev:hover, .pv-next:hover { transform: translateY(-50%) scale(1.06); }
.pv-zoom svg { width: 22px; height: 22px; }
.photo-viewer :focus-visible { outline: 2px solid var(--pumpkin-glow); outline-offset: 3px; }

/* Zoomed state: the photo shows at its real pixel size inside a panning
   viewport (drag / scroll / pinch). Prev/next hide so nothing fights the
   pan; clicking the photo again (or Esc) steps back out. */
.photo-viewer figure.is-zoomed {
  display: block;
  overflow: auto;
  max-width: 96vw;
  max-height: 82vh;
  max-height: 82dvh;
  text-align: center;
  overscroll-behavior: contain;
}
.photo-viewer figure.is-zoomed img {
  display: inline-block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  margin: 0 auto;
  cursor: zoom-out;
}
.photo-viewer figure.is-zoomed figcaption {
  display: none;
  padding: 0 10px;
}
.photo-viewer figure.is-zoomed::-webkit-scrollbar { width: 8px; height: 8px; }
.photo-viewer figure.is-zoomed::-webkit-scrollbar-thumb { background: rgba(248, 239, 220, .35); border-radius: 4px; }

/* 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; }
  .pv-zoom { position: static; transform: none; width: 40px; height: 40px; }
  .pv-zoom:hover { transform: scale(1.06); }
  .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)); }
}

/* ─────────────────────── feature-off fallbacks ─────────────────────── */
.feature-fallback {
  margin-top: 22px;
  text-align: center;
  padding: 30px 22px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.feature-fallback[hidden] { display: none; }
.feature-fallback .fallback-icon { margin: 0 0 8px; font-size: 2rem; }
.feature-fallback h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--pumpkin-glow);
}
.feature-fallback p:not(.fallback-icon) {
  margin: 0 auto;
  max-width: 30em;
  font-size: 1rem;
  font-style: italic;
  color: rgba(248, 239, 220, .85);
}

/* ════════════════════════════════════════════════════════════════════
   MOTION & ACCESSIBILITY
   ════════════════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes seal-glow {
  0%, 100% { filter: drop-shadow(0 6px 10px rgba(43, 18, 32, .35)); }
  50%      { filter: drop-shadow(0 6px 16px rgba(232, 89, 12, .45)); }
}

@media (prefers-reduced-motion: no-preference) {
  .card-seal { animation: seal-glow 5s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
    scroll-behavior: auto !important;
  }
  .panel { transform: none; }
}

/* ════════════════════════════════════════════════════════════════════
   NO-JS FALLBACK — without JavaScript every panel shows, stacked
   ════════════════════════════════════════════════════════════════════ */
html.no-js .app { height: auto; }
html.no-js .app-main { position: static; }
html.no-js .panel {
  position: static;
  visibility: visible;
  opacity: 1;
  transform: none;
  height: auto;
  overflow: visible;
  transition: none;
}
html.no-js .app-tabs { display: none; }

/* ════════════════════════════════════════════════════════════════════
   PRINT — every panel printable, stacked
   ════════════════════════════════════════════════════════════════════ */
@media print {
  body { background: #fff; }
  .app { height: auto; display: block; overflow: visible; }
  .app-header, .app-tabs, .powered-by { display: none !important; }
  .app-main { position: static; }
  .panel {
    position: static;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    height: auto;
    overflow: visible;
    margin-bottom: 26px;
    page-break-after: always;
  }
  .panel:last-child { page-break-after: auto; }
  .invite-stage { padding: 0; }
  .card-invite, .rsvp-card, .guestbook-card, .photos-section, .free-block, .feature-fallback {
    box-shadow: none;
    border: 1px solid #999;
  }
  .photo-viewer { display: none !important; }
  .card-photo, .banner-flyer img { box-shadow: none; }
  .film-frame { border: 1px solid #999; box-shadow: none; }
  a { color: inherit; }
}

/* small screens: tighten spacing */
@media (max-width: 400px) {
  .card-invite { padding: 44px 20px 34px; }
}

/* very small screens: keep every tab label on one clear line */
@media (max-width: 380px) {
  .app-tabs { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .tab { font-size: .66rem; letter-spacing: .03em; }
}
