/* ============================================================
   reuni-alumni-flyer-homecoming — "Homecoming" reunion poster
   ------------------------------------------------------------
   Design language: a vintage poster pinned to a notice board.
   Cream paper, navy ink, mustard + maroon pennants, typewriter
   captions, a taped yearbook photo, a perforated ticket stub.

   Progressive enhancement:
     • `.js` (inline in <head>)  → minimal capability flag.
     • `.invite-ready` (main.js) → locks the 100dvh shell & hides
       inactive panels. Without it the page is normal-flow and
       every panel is readable — the no-JS fallback.
     • `.no-motion` (fail-open)  → kills entrance animations.
   ============================================================ */

:root {
  --paper:      #fbf5e6;
  --paper-deep: #f3ead4;
  --ink:        #1d2b53;   /* deep navy */
  --maroon:     #7a2e3d;
  --gold:       #c99b2e;
  --gold-deep:  #a67c1d;
  --charcoal:   #3a352b;
  --muted:      #6f6756;
  --error:      #a13a3a;
  --backdrop:   #e7dcc0;
  --line:       rgba(29, 43, 83, 0.18);

  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-body:    "Lora", Georgia, serif;
  --font-type:    "Special Elite", "Courier New", monospace;

  --radius: 6px;
  --shadow: 0 10px 30px rgba(52, 43, 20, 0.18);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 255, 255, 0.5), transparent 60%),
    var(--backdrop);
  line-height: 1.5;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold-deep); }
button { font-family: inherit; }

/* ============================================================
   THE ONE-SCREEN SHELL
   Without .invite-ready the stage is normal flow (no-JS fallback:
   everything scrolls, every panel visible). With it, we lock the
   viewport and let only the active panel scroll internally.
   ============================================================ */
.stage { min-height: 100vh; min-height: 100dvh; }

.invite-ready .stage {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.invite-ready .panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* inactive panels are hidden only once the app has booted */
.invite-ready .panel:not(.is-active) { display: none; }

/* ============================================================
   TABS — a ticket-stub strip
   ============================================================ */
.tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 4px;
  padding: 10px max(14px, env(safe-area-inset-left)) 9px max(14px, env(safe-area-inset-right));
  background: var(--paper);
  border-bottom: 1px dashed var(--line);
  box-shadow: 0 2px 0 rgba(52, 43, 20, 0.06);
  position: relative;
  z-index: 5;
}
.tabs:empty { display: none; }

.tabs__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}
.tabs__btn:hover { color: var(--ink); }
.tabs__btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}
.tabs__btn.is-active {
  color: var(--paper);
  background: var(--ink);
}
/* narrow screens: keep every tab label readable — the strip wraps to a
   second row instead of scrolling or truncating, and targets stay big */
@media (max-width: 560px) {
  .tabs__btn { font-size: 12px; padding: 10px 13px; }
}

/* ============================================================
   PANELS
   ============================================================ */
.panel { padding: 0; }
.panel:focus { outline: none; }

/* ============================================================
   THE POSTER
   ============================================================ */
.poster {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 26px 40px;
  background:
    linear-gradient(var(--paper), var(--paper-deep));
  box-shadow: var(--shadow);
  border: 1px solid rgba(58, 53, 43, 0.12);
  position: relative;
}

/* bunting */
.bunting {
  margin: 0 -26px;
  padding: 14px 18px 2px;
  display: flex;
  justify-content: center;
  gap: 3px;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(29,43,83,0.06) 14px 17px, transparent 17px 34px),
    #f6efdd;
}
.bunting__f {
  width: 26px;
  height: 34px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.bunting__f--navy   { background: var(--ink); }
.bunting__f--maroon { background: var(--maroon); }
.bunting__f--gold   { background: var(--gold); }

/* banner */
.poster__banner {
  margin: 18px -26px 0;
  padding: 22px 26px 26px;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  border-top: 4px solid var(--gold);
  border-bottom: 4px solid var(--gold);
  position: relative;
}
.poster__banner::before,
.poster__banner::after {
  content: "✦";
  position: absolute;
  top: -16px;
  color: var(--gold);
  font-size: 15px;
  background: var(--paper);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  line-height: 1;
}
.poster__banner::before { left: 30px; }
.poster__banner::after  { right: 30px; }
/* personal greeting (hidden until the platform injects a `name`) */
.poster__guest {
  margin: 0 0 10px;
  font-family: var(--font-type);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(251, 245, 230, 0.85);
}
.poster__guest[hidden] { display: none; }
.poster__eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-type);
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.poster__class {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 9vw, 64px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.poster__motto {
  margin: 10px 0 0;
  font-family: var(--font-type);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(251, 245, 230, 0.75);
}

/* headline */
.poster__headline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 34px;
}
.poster__years {
  font-family: var(--font-display);
  font-size: clamp(96px, 26vw, 190px);
  line-height: 0.9;
  color: var(--maroon);
  text-shadow: 3px 3px 0 rgba(122, 46, 61, 0.12);
  user-select: none;
}
.poster__words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.poster__word {
  font-family: var(--font-display);
  font-size: clamp(34px, 9vw, 62px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.poster__tagline {
  margin: 26px auto 0;
  max-width: 34em;
  text-align: center;
  font-size: 17px;
  line-height: 1.55;
  color: var(--charcoal);
}
.poster__tagline em {
  font-family: var(--font-type);
  font-style: normal;
  font-size: 14px;
  color: var(--muted);
}

/* polaroid yearbook photo */
.polaroid {
  margin: 34px auto 0;
  max-width: 420px;
  padding: 12px 12px 14px;
  background: #fffdf6;
  box-shadow: 4px 6px 18px rgba(52, 43, 20, 0.22);
  transform: rotate(-1.6deg);
  position: relative;
}
.polaroid__link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}
.polaroid__link:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}
.polaroid__img {
  overflow: hidden;
  background: linear-gradient(135deg, #d9cfae, #bfb28c); /* fallback while loading */
  line-height: 0;
}
.polaroid__img img { width: 100%; }
.polaroid__img picture img { width: 100%; } /* the platform may swap the photo for a <picture> on live invites */
.polaroid__tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 108px;
  height: 30px;
  margin-left: -54px;
  background: rgba(201, 155, 46, 0.55);
  transform: rotate(-2deg);
  box-shadow: 0 1px 3px rgba(52, 43, 20, 0.25);
  clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
}
.polaroid__caption {
  margin: 12px 4px 0;
  font-family: var(--font-type);
  font-size: 13px;
  text-align: center;
  color: var(--charcoal);
  letter-spacing: 0.04em;
}

/* ============================================================
   OFFICIAL FLYER / BANNER (optional) — a framed, taped strip
   on the poster for hosts who already have a designed event
   flyer; guests can confirm they're in the right place. Tap
   to view it full size + zoom (lightbox). Delete the whole
   <figure class="banner-flyer"> block in index.html to hide it.
   ============================================================ */
.banner-flyer {
  margin: 40px auto 0;
  max-width: 640px;
  text-align: center;
}
.banner-flyer a {
  display: block;
  padding: 8px; /* like a printed flyer pinned on the board */
  background: #fffdf6;
  border: 2px solid var(--ink);
  box-shadow: 0 10px 26px rgba(52, 43, 20, 0.18);
  transform: rotate(0.6deg);
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
@media (hover: hover) {
  .banner-flyer a:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 6px 10px 24px rgba(52, 43, 20, 0.28);
  }
}
.banner-flyer a:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}
.banner-flyer img {
  display: block;
  width: 100%;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  /* warm fallback while loading — and if a swapped-in flyer is missing,
     the inline onerror hides the <img> and this stays put */
  background: linear-gradient(135deg, #d9cfae, #bfb28c);
}
.banner-flyer__cap {
  margin-top: 10px;
  font-family: var(--font-type);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ============================================================
   PHOTO MEMORY WALL (optional Photos tab) — polaroids pinned
   to a notice board. Reuses the poster's polaroid language:
   tape, tilt, typewriter captions. Deleted section → tab
   auto-hides (main.js), so this whole block is optional.
   ============================================================ */
.gallery {
  max-width: 860px;
  margin: 0 auto;
  padding: 34px 26px 46px;
}
.gallery__head {
  max-width: 560px;
  margin: 0 auto;
}
.gallery__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.gallery__description {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}

/* masonry-ish wall: CSS columns handle mixed portrait/landscape
   ratios the way a real corkboard does */
.gallery__grid {
  margin-top: 26px;
  column-count: 3;
  column-gap: 20px;
}
@media (max-width: 820px) { .gallery__grid { column-count: 2; } }
@media (max-width: 540px) { .gallery__grid { column-count: 1; } }

.gallery-item {
  break-inside: avoid;
  margin: 0 0 22px;
  padding: 10px 10px 12px;
  background: #fffdf6;
  box-shadow: 4px 6px 18px rgba(52, 43, 20, 0.22);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
/* alternating tilt — pinned up by hand */
.gallery-item:nth-child(odd)  { transform: rotate(-1.4deg); }
.gallery-item:nth-child(even) { transform: rotate(1.1deg); }
.gallery-item:nth-child(3n)   { transform: rotate(-0.5deg); }
/* tape */
.gallery-item::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 88px;
  height: 26px;
  margin-left: -44px;
  background: rgba(201, 155, 46, 0.55);
  transform: rotate(-2deg);
  box-shadow: 0 1px 3px rgba(52, 43, 20, 0.25);
  clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
  z-index: 1;
}
.gallery-item:nth-child(even)::before { left: 40%; margin-left: 0; transform: rotate(2deg); }
.gallery-item:nth-child(3n)::before   { left: 60%; margin-left: 0; transform: rotate(-3deg); }
/* hover (mouse only): straighten + lift, like reaching for the pin */
@media (hover: hover) {
  .gallery-item:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 6px 10px 24px rgba(52, 43, 20, 0.28);
  }
}

/* the <button> wraps the <img>: it is what opens the lightbox */
.gallery-item__link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  line-height: 0;
}
.gallery-item__link:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}
.gallery-item__link img {
  width: 100%;
  height: auto;
  display: block;
  /* warm fallback while loading — and if a swapped-in photo is missing,
     the inline onerror hides the <img> and this stays put */
  background: linear-gradient(135deg, #d9cfae, #bfb28c);
}
.gallery-item__cap {
  margin: 10px 4px 0;
  font-family: var(--font-type);
  font-size: 12.5px;
  text-align: center;
  color: var(--charcoal);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ============================================================
   FREE PAGE (optional) — a free-text page: a heading, an intro
   and repeatable blocks, each with a title, a note and an
   optional photo. Matches the poster's ticket/polaroid language
   (cream paper, dashed ink border, typewriter captions). The
   whole page hides when the host leaves the Free Page Title
   empty (the platform removes #panel-free + #tab-free); the
   blocks container hides when no blocks exist; an empty photo
   figure collapses via the :empty rules below.
   ============================================================ */
.free-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 34px 26px 46px;
}
.free-section__head { max-width: 560px; margin: 0 auto; }
.free-page-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.free-intro {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}

.free-blocks {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 28px;
}
.free-block {
  background: #faf4e2;
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 28px);
}
.free-block__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 4.5vw, 28px);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.free-block__content {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--charcoal);
  white-space: pre-line; /* host line breaks from the textarea render as breaks */
  overflow-wrap: anywhere;
}
.free-block__media {
  margin: 0 0 18px;
  max-width: 420px;
}
.free-block__link {
  display: block;
  background: #fffdf6;
  border: 2px solid var(--ink);
  box-shadow: 0 10px 26px rgba(52, 43, 20, 0.18);
  transform: rotate(-0.8deg);
  cursor: zoom-in;
  line-height: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.free-block__link:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}
@media (hover: hover) {
  .free-block__link:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 6px 10px 24px rgba(52, 43, 20, 0.28);
  }
}
.free-block__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  /* warm fallback while loading — and if a swapped-in photo is missing,
     the inline onerror hides the <img> and this stays put */
  background: linear-gradient(135deg, #d9cfae, #bfb28c);
}
.free-block__cap {
  margin-top: 10px;
  font-family: var(--font-type);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
/* A block left without its optional photo / title / content collapses
   cleanly instead of leaving an empty frame (the platform removes the
   photo figure itself; these :empty rules are a defensive fallback). */
.free-block__media:empty,
.free-block__title:empty,
.free-block__content:empty { display: none; }

/* ticket-stub details */
.ticket {
  margin: 40px auto 0;
  max-width: 560px;
  /* solid fill so the perforation notches match exactly (they "punch"
     through the dashed border) */
  background: #faf4e2;
  border: 2px dashed var(--ink);
  position: relative;
  padding: 6px 0;
}
.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: #faf4e2;
  border: 2px solid var(--ink);
}
.ticket::before { left: -15px; }
.ticket::after  { right: -15px; }
.ticket__row {
  display: flex;
  gap: 18px;
  padding: 13px 26px;
  border-bottom: 1px dashed var(--line);
}
.ticket__row:last-child { border-bottom: 0; }
.ticket__row dt {
  flex: 0 0 86px;
  font-family: var(--font-type);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--maroon);
  padding-top: 2px;
}
.ticket__row dd {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
/* the main date is a <p> so it is a real first-screen text node (and the
   review first-screen scan can see it); kill the default p margins */
.ticket__row dd .ticket-date {
  margin: 0;
}
.ticket__row dd em {
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-type);
}
.ticket__row--last dd { color: var(--maroon); }

/* program */
.program {
  margin: 40px auto 0;
  max-width: 560px;
}
.program__title {
  margin: 0 0 14px;
  font-family: var(--font-type);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-align: center;
}
.program__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: prog;
}
.program__list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: prog;
}
.program__list li::before {
  content: "0" counter(prog);
  font-family: var(--font-display);
  color: var(--gold-deep);
  font-size: 14px;
  letter-spacing: 0.08em;
  flex: 0 0 30px;
}
.program__list time {
  flex: 0 0 56px;
  font-family: var(--font-type);
  font-size: 14px;
  color: var(--maroon);
}
.program__list span { font-size: 16px; color: var(--charcoal); }

/* fine print */
.poster__fineprint {
  margin: 34px auto 0;
  max-width: 560px;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.poster__fineprint strong { color: var(--ink); }

/* actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.btn--gold {
  color: var(--paper);
  background: linear-gradient(180deg, #d8a83a, var(--gold-deep));
  box-shadow: 0 3px 0 #7a5a12;
}
.btn--gold:hover { filter: brightness(1.05); }

.btn--ghost {
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
}
.btn--ghost:hover { background: rgba(29, 43, 83, 0.07); }

.btn--block { width: 100%; justify-content: center; }

/* committee footer */
.poster__committee {
  margin: 34px 0 6px;
  text-align: center;
  font-family: var(--font-type);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.9;
}
.poster__committee a { color: var(--gold-deep); }

/* ============================================================
   SHARED SECTION HEADERS (RSVP + guestbook)
   ============================================================ */
.eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-type);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--maroon);
}
.rsvp-wrap, .guestbook-section {
  max-width: 560px;
  margin: 0 auto;
  padding: 38px 26px 46px;
}
.rsvp-title, .guestbook-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.rsvp-description, .guestbook-description {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}
.rsvp-description strong, .guestbook-description strong { color: var(--charcoal); }

/* countdown (revealed by main.js only when the platform sets a deadline) */
.countdown-inline {
  margin-top: 16px;
  font-family: var(--font-display);
  color: var(--maroon);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.countdown-inline span:first-child {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  margin-right: 8px;
}
.countdown-inline i { font-style: normal; margin-right: 6px; color: var(--muted); }

/* ============================================================
   FORMS (RSVP + injected guestbook share these styles)
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.label-hint {
  font-weight: 400;
  font-size: 12.5px;
  color: var(--muted);
}
.form-control {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--charcoal);
  background: #fffdf6;
  border: 1.5px solid rgba(29, 43, 83, 0.4);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control::placeholder { color: #a49a85; }
.form-control:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(201, 155, 46, 0.25);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 64px; }

.error {
  display: block;
  min-height: 0;
  margin-top: 5px;
  font-size: 13px;
  color: var(--error);
}
.error:empty { display: none; }

.field-help {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* guest-count chips (UX: quick party-size selection) */
.guest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.chip {
  appearance: none;
  border: 1.5px solid rgba(29, 43, 83, 0.4);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--gold-deep); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* decline note (shown when attending = no) */
.rsvp-decline-note {
  margin: 4px 0 18px;
  padding: 13px 15px;
  border-left: 3px solid var(--gold);
  background: rgba(201, 155, 46, 0.12);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14.5px;
  color: var(--charcoal);
}

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

/* loading state (platform toggles it during AJAX) */
.loading {
  display: none;
  text-align: center;
  margin-top: 14px;
  font-family: var(--font-type);
  font-size: 13px;
  color: var(--muted);
}
.loading:not(:empty) { display: block; }

/* ============================================================
   INJECTED GUESTBOOK — style the platform's functional markup
   (docs/template-rsvp-guestbook-guide.md §3.4)
   ============================================================ */
.guestbook-body .form-group { margin-bottom: 14px; }

/* the injected submit button carries Bootstrap-ish classes; make
   them look like our .btn--gold without a Bootstrap dependency */
#guestbookForm .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 13.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(180deg, #d8a83a, var(--gold-deep));
  color: var(--paper);
  box-shadow: 0 3px 0 #7a5a12;
}
#guestbookForm .btn .ph { font-size: 16px; }
#guestbookForm .d-flex { display: flex; }
#guestbookForm .mx-auto { margin-left: auto; margin-right: auto; }
#guestbookForm .px-3 { padding-left: 16px; padding-right: 16px; }
#guestbookForm .mt-2 { margin-top: 8px; }
#guestbookForm .text-white { color: var(--paper); }

.guestbook-chapta { margin: 6px 0; }

#comments-container {
  margin-top: 26px;
  border-top: 2px dashed var(--line);
  padding-top: 8px;
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.guestbook-entry {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.guestbook-entry h5 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}
.guestbook-entry p { margin: 0 0 6px; font-size: 15px; line-height: 1.55; }
.guestbook-entry small { font-size: 12px; color: var(--muted); font-family: var(--font-type); }

.more-guestbook-wrap { text-align: center; margin-top: 16px; }
#load-more {
  appearance: none;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 20px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
#load-more:hover { background: rgba(29, 43, 83, 0.07); }

.loading-guestbook {
  text-align: center;
  margin-top: 12px;
  font-family: var(--font-type);
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   FILM FEATURE (optional video URL embed) — a poster + play
   button that lazy-loads an <iframe> from the URL in
   data-video-url (YouTube / Vimeo / any embeddable URL) on
   .film-card. Nothing loads until the guest taps play. Delete
   the whole <section class="film-card"> block in index.html to
   hide it.
   ============================================================ */
.film-card {
  margin-top: 34px;
  text-align: center;
}
.film-label {
  margin: 0 0 2px;
  font-family: var(--font-type);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--maroon);
}
.film-frame {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 12px auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink); /* mat behind the poster / while loading */
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}
.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;
  display: block;
  /* warm fallback while loading — and if the poster is missing,
     the inline onerror hides the <img> and this stays put */
  background: linear-gradient(135deg, #d9cfae, #bfb28c);
}
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(54px, 11vmin, 70px);
  height: clamp(54px, 11vmin, 70px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  background: radial-gradient(circle at 32% 28%, #e8c268, var(--gold) 58%, var(--gold-deep));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.65);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.film-play svg { width: 26px; height: 26px; margin-left: 3px; }
.film-open:hover .film-play,
.film-open:focus-visible .film-play { transform: translate(-50%, -50%) scale(1.08); }
.film-open:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(29, 43, 83, 0.66);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.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: rgba(251, 245, 230, 0.8);
  font-size: 13.5px;
  font-style: italic;
  text-align: center;
  background: var(--ink);
}
.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.film-external:hover { color: var(--ink); border-color: var(--ink); }
.film-external[hidden] { display: none; }

@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.65), 0 0 0 0 rgba(201, 155, 46, 0.35); }
  50% { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.65), 0 0 0 14px rgba(201, 155, 46, 0); }
}

/* ============================================================
   BRAND FOOTER — .app-footer (with a .footer-brand placeholder)
   is written after </main> so it survives the no-JS stacked
   document. main.js moves it into the last live panel; in the
   app shell it stays hidden until then, so it never eats space
   from the active panel.
   ============================================================ */
.app-footer {
  padding: 22px 18px 40px;
  text-align: center;
}
.invite-ready .app-footer { display: none; }
.invite-ready .panel .app-footer {
  display: block;
  margin-top: 34px;
  padding: 18px 26px 8px;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.footer-brand {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Full-width platform credit line (exact class 'powered-by'). Always
   shown by default; the platform's “Free Powered By” morph can edit
   the text. Spans the full footer width in both the stacked (no-JS)
   document and the app shell. */
.powered-by {
  width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-type);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* ============================================================
   PHOTO LIGHTBOX — built by main.js only when a [data-lightbox]
   photo exists (hero polaroid, memory wall, official flyer).
   Full-screen viewer: tap a photo to open it, zoom with click /
   double-tap / + − reset buttons / + − 0 keys, pan by scrolling
   while zoomed, navigate with ‹ › / arrow keys / swipe, close
   with Esc / backdrop / ×. Focus returns to the tapped photo.
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 43, 83, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lightbox-fade 0.25s ease both;
}
.lightbox[hidden] { display: none; }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }

/* the stage is the scroll container: when the photo is zoomed past the
   viewport you pan by scrolling (touch + trackpad + keyboard scroll) */
.lightbox__stage {
  max-width: min(900px, 92vw);
  max-height: 88dvh;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
}
.lightbox figure {
  margin: 0;
  display: inline-block;
  max-width: 100%;
}
.lightbox__img {
  display: block;
  max-width: min(86vw, 860px);
  max-height: 72dvh;
  object-fit: contain;
  background: #fffdf6;
  border: 8px solid #fffdf6;   /* polaroid frame in the viewer too */
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  cursor: zoom-in;
  transform-origin: 50% 50%;
  transition: transform 0.2s ease;
  touch-action: manipulation;
}
.lightbox__img.is-zoomed { cursor: zoom-out; }
.lightbox__caption {
  margin: 0;
  padding: 0 4px;
  text-align: center;
  font-family: var(--font-type);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--paper);
}
.lightbox__counter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  margin: 0;
  text-align: center;
  font-family: var(--font-type);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(251, 245, 230, 0.65);
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(251, 245, 230, 0.4);
  background: rgba(251, 245, 230, 0.08);
  color: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(251, 245, 230, 0.2); }
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.lightbox__close {
  top: 16px;
  right: 16px;
  font-size: 24px;
  line-height: 1;
}
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 26px; line-height: 1; padding-bottom: 3px; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__nav[hidden] { display: none; }

/* zoom controls — a small pill under the photo */
.lightbox__zoom {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(251, 245, 230, 0.1);
  border: 1px solid rgba(251, 245, 230, 0.25);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox__zoom button {
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(251, 245, 230, 0.35);
  background: rgba(251, 245, 230, 0.08);
  color: var(--paper);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}
.lightbox__zoom button:hover { background: rgba(251, 245, 230, 0.22); }
.lightbox__zoom button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lightbox__zoom button.is-dimmed { opacity: 0.4; }
.lightbox__zoom svg { width: 18px; height: 18px; }

/* narrow screens: nav + close sit inside the padding, zoom pill stays above the counter */
@media (max-width: 640px) {
  .lightbox { padding: 10px; }
  .lightbox__close { top: 10px; right: 10px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__zoom { bottom: 58px; }
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(29, 43, 83, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   MOTION — subtle, gated behind reduced-motion + fail-open
   ============================================================ */
.invite-ready .panel.is-active { animation: rise 0.5s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .polaroid { transform: none; }
}
.no-motion .invite-ready .panel.is-active { animation: none; }
.no-motion .lightbox, .no-motion .film-play { animation: none; }

/* ============================================================
   PRINT — flatten to a clean, readable page
   ============================================================ */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .stage { height: auto !important; min-height: 0 !important; display: block !important; overflow: visible !important; }
  .panels { display: block !important; }
  .invite-ready .panel { display: block !important; height: auto !important; overflow: visible !important; }
  .tabs, .actions, .btn, .toast, .bunting, .polaroid__tape { display: none !important; }
  .gallery-item::before, .lightbox { display: none !important; }
  .film-play { display: none !important; }
  .banner-flyer a, .polaroid { transform: none !important; }
  .poster {
    box-shadow: none !important;
    border: 0 !important;
    max-width: none !important;
    padding: 0 !important;
  }
  .poster__banner {
    margin: 0 0 20px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .poster__years { text-shadow: none !important; }
  .ticket { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ticket::before, .ticket::after { display: none; }
  .rsvp-wrap, .guestbook-section { padding: 24px 0; }
  #comments-container { max-height: none !important; overflow: visible !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 11px; color: #555; }
}
