/* ═══════════════════════════════════════════════════════════════════════════
   party-beach-flyer-tidal-wave — "Tidal Wave" (Beach Party · Flyer)
   Retro surf poster · ocean navy + lagoon turquoise + sand + coral + sun.

   Layout contract:
     · The single-viewport shell is gated on body.shell-on, added by main.js
       only when 2+ panels survive platform processing. Without it (no JS, or
       a single panel left), the page is a normal stacked, scrolling document.
     · With .shell-on, .app-shell locks to 100dvh and only the ACTIVE panel
       scrolls internally.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --navy:       #0b2e59;
  --navy-deep:  #081f3d;
  --ocean:      #145a8c;
  --lagoon:     #1287a8;
  --turquoise:  #2ec4b6;
  --foam:       #eafaf7;
  --sand:       #fdf0d5;
  --sand-soft:  #fbf4e2;
  --coral:      #ff6b5e;
  --coral-deep: #e84c3d;
  --sun:        #ffc145;
  --ink:        #0b2e59;
  --muted-dark: #5d7a8c;
  --muted-light:#b9cfd8;
  --danger:     #c0392b;
  --line-dark:  rgba(11, 46, 89, .14);
  --line-light: rgba(234, 250, 247, .16);
  --radius:     18px;
  --font-display: "Lilita One", "Arial Black", Impact, sans-serif;
  --font-script:  "Caveat", "Segoe Script", "Brush Script MT", cursive;
  --font-body:    "Nunito", -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(--foam);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--coral); color: #fff; }

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

.shell-on body { overflow: hidden; }

.shell-on .app-shell {
  height: 100vh;               /* fallback for older browsers */
  height: 100dvh;
  overflow: hidden;
}

.shell-on .panel {
  display: none;
  height: 100%;
}

.shell-on .panel.is-active {
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* Flex centering that stays scroll-safe: auto margins collapse to 0 when
   the content outgrows the panel, so the top is never unreachable. */
.panel-inner {
  max-width: 660px;
  margin: 0 auto;
  padding: calc(26px + env(safe-area-inset-top)) 24px calc(164px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.panel-inner > :first-child { margin-top: auto; }
.panel-inner > :last-child  { margin-bottom: auto; }

/* ── Panel themes (alternating poster rhythm) ──────────────────────────── */
.cover-panel  { background: var(--navy); position: relative; }
.plan-panel   { background: var(--sand); color: var(--ink); }
.detail-panel { background: var(--ocean); }
.rsvp-panel   { background: var(--sand); color: var(--ink); }
.guest-panel  { background: var(--navy-deep); }

/* ── Cover panel ───────────────────────────────────────────────────────── */

/* ── Poster copy ───────────────────────────────────────────────────────── */
.poster-body {
  margin: auto 0;
  text-align: center;
}

.guest-greeting {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--sun);
  letter-spacing: .02em;
}
.guest-greeting::before { content: "🏄 "; }

.kicker {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--sun);
}
.kicker-rule {
  display: inline-block;
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--sun);
  opacity: .7;
}
.kicker-dark { color: var(--coral-deep); }
.kicker-dark .kicker-rule { background: var(--coral-deep); }

.cover-title {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(58px, 15vw, 108px);
  line-height: .96;
  letter-spacing: .01em;
  color: var(--sand);
  text-shadow: 0 5px 0 rgba(4, 18, 38, .55), 0 0 40px rgba(255, 193, 69, .25);
}
.title-accent { color: var(--sun); }

.cover-script {
  margin: -4px 0 0;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.1;
  color: var(--foam);
  transform: rotate(-2deg);
}

.tagline {
  margin: 14px 0 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--turquoise);
}

.cover-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  font-weight: 700;
  color: var(--sand);
  background: rgba(234, 250, 247, .09);
  border: 1px solid var(--line-light);
  border-radius: 999px;
  padding: 8px 18px;
  backdrop-filter: blur(6px);
}
.cover-date svg { color: var(--sun); }

.hosted-by {
  margin: 8px 0 0;
  color: var(--muted-light);
  font-size: 15px;
}
.host-name { color: var(--sand); font-weight: 800; }

/* ── Panel headers ─────────────────────────────────────────────────────── */
.panel-head { text-align: center; }

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 7vw, 46px);
  line-height: 1.05;
  color: var(--ink);
}
.plan-panel .panel-title, .rsvp-panel .panel-title { color: var(--ink); }
.detail-panel .panel-title { color: var(--foam); }
.guest-panel .panel-title  { color: var(--foam); }

.panel-lead {
  margin: 12px 0 0;
  font-size: 16px;
  color: var(--muted-dark);
}
.detail-panel .panel-lead { color: var(--muted-light); }
.guest-panel .panel-lead  { color: var(--muted-light); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 800 15px/1 var(--font-body);
  letter-spacing: .04em;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 0 var(--coral-deep);
}
.btn-primary:hover { background: #ff7d71; }

.btn-ghost {
  background: transparent;
  color: var(--foam);
  border: 1px solid var(--line-light);
}
.btn-ghost:hover { background: rgba(234, 250, 247, .08); }

.btn-block { width: 100%; }

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.panel-foot { margin-top: 36px; text-align: center; }
.foot-hint { margin: 14px 0 0; color: var(--muted-light); font-size: 14px; }
.detail-panel .foot-hint { color: var(--muted-light); }

/* ── Timeline (the game plan) ──────────────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 26px 1fr;
  gap: 8px;
  padding: 0 0 26px;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-time {
  padding-top: 2px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--coral-deep);
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.tl-dot {
  position: relative;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--sun);
  border: 3px solid var(--sand);
  box-shadow: 0 0 0 2px var(--sun);
}
.tl-item:not(:last-child) .tl-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  bottom: -40px;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, rgba(11, 46, 89, .25) 0 5px, transparent 5px 9px);
}

.tl-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
.tl-text { margin: 4px 0 0; font-size: 15px; color: var(--muted-dark); }

/* Narrow screens: keep the time column compact and wrap-safe so longer
   times (or unedited placeholders) never spill over the dot/title, and the
   body column keeps as much width as possible. */
@media (max-width: 560px) {
  .tl-item {
    grid-template-columns: 64px 22px 1fr;
    gap: 6px;
    padding: 0 0 24px;
  }
  .tl-time {
    font-size: 13px;
  }
  .tl-dot {
    width: 12px;
    height: 12px;
    margin-top: 4px;
  }
}

/* ── Callout / note ────────────────────────────────────────────────────── */
.note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 193, 69, .22);
  border: 1px dashed var(--coral-deep);
  border-radius: 14px;
  padding: 12px 16px;
}
.note svg { flex: 0 0 auto; color: var(--coral-deep); }

/* ── Details ───────────────────────────────────────────────────────────── */
.detail-list { margin: 30px 0 0; }
.detail-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-light);
}
.detail-row:last-child { border-bottom: 0; }
.detail-row dt {
  flex: 0 0 128px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sun);
}
.detail-row dd { margin: 0; font-size: 16px; color: var(--foam); }
.dd-sub { display: block; color: var(--muted-light); font-size: 14px; }

.swell-strip {
  height: 12px;
  margin: 30px 0 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 12' preserveAspectRatio='none'><path d='M0 8 Q 7 2 14 8 T 28 8 T 42 8 T 56 8' fill='none' stroke='%232ec4b6' stroke-width='2.5' stroke-linecap='round'/></svg>");
  background-repeat: repeat-x;
  background-size: 60px 12px;
}

.rain-note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted-light);
  background: rgba(234, 250, 247, .07);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 12px 16px;
}

/* ── Forms (RSVP) ──────────────────────────────────────────────────────── */
.rsvp-wrap { width: 100%; }
.rsvp-head { margin-bottom: 26px; text-align: center; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 7px;
  letter-spacing: .02em;
  color: var(--ink);
}
.form-control {
  width: 100%;
  padding: 13px 15px;
  font: 400 15px/1.4 var(--font-body);
  color: var(--ink);
  background: #fffdf6;
  border: 2px solid #e3d6b4;
  border-radius: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 107, 94, .22);
}
select.form-control { appearance: none; }
textarea.form-control { resize: vertical; }

.field-hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted-dark); }

.error {
  display: block;
  min-height: 1.2em;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
}

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

.loading {
  display: none;
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: var(--coral-deep);
  font-weight: 800;
}
.loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 107, 94, .3);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fields that only matter when the guest is coming (shown by main.js) */
.form-group[hidden] { display: none; }
.rsvp-declined-note {
  margin: -4px 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 107, 94, .12);
  border: 1px dashed var(--coral);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.rsvp-declined-note[hidden] { display: none; }

/* RSVP deadline countdown (platform fills the numbers when a deadline is set) */
.rsvp-countdown { margin: 0 0 28px; text-align: center; }
.countdown-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--coral-deep);
}
.countdown-boxes { display: flex; justify-content: center; gap: 10px; }
.count-box {
  flex: 0 0 68px;
  background: var(--navy);
  color: var(--foam);
  border-radius: 14px;
  padding: 10px 4px;
  box-shadow: 0 5px 0 rgba(11, 46, 89, .25);
}
.count-box span {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  color: var(--sun);
}
.count-box small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-light);
}

/* "Thank you" / "RSVP closed" states — the platform swaps this into #rsvp-form */
.thank-you-message h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  color: var(--coral-deep);
}
.thank-you-message p { margin: 4px 0; color: var(--ink); }
.thank-you-message small { color: var(--muted-dark); }

/* ── Guestbook (platform injects the markup into .guestbook-body) ──────── */
.guestbook-head { margin-bottom: 22px; text-align: center; }

/* injected form */
.guestbook-body form,
.guestbook-body #guestbookForm {
  background: rgba(234, 250, 247, .06);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 22px;
}
.guestbook-body label { color: var(--foam); font-weight: 700; font-size: 14px; display: block; margin-bottom: 7px; }
.guestbook-body .form-control {
  color: var(--foam);
  background: rgba(234, 250, 247, .07);
  border-color: var(--line-light);
}
.guestbook-body .form-control::placeholder { color: var(--muted-light); opacity: .7; }
.guestbook-body .form-control:focus { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 193, 69, .18); }
.guestbook-body .error { color: #ff8a7f; }
.guestbook-body button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 800 15px/1 var(--font-body);
  color: #fff;
  background: var(--coral);
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--coral-deep);
}
.guestbook-body button[type="submit"]:hover { background: #ff7d71; }
.guestbook-chapta { margin: 12px 0; }

/* injected message list */
.guestbook-wrap {
  margin-top: 22px;
  max-height: 44vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line-light);
}
.guestbook-entry {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-light);
}
.guestbook-entry h5 { margin: 0 0 3px; font-size: 15px; color: var(--sun); }
.guestbook-entry p { margin: 0 0 3px; font-size: 15px; color: var(--foam); }
.guestbook-entry small { font-size: 12px; color: var(--muted-light); }

.loading-guestbook {
  display: none;
  text-align: center;
  color: var(--muted-light);
  font-size: 14px;
  padding: 10px 0;
}
.more-guestbook-wrap { text-align: center; margin-top: 14px; }
#load-more {
  font: 800 14px/1 var(--font-body);
  color: var(--foam);
  background: transparent;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  padding: 11px 24px;
  cursor: pointer;
}
#load-more:hover { background: rgba(234, 250, 247, .08); }

/* ── Photos: cover backdrop + snapshots gallery + full-screen viewer ──
   All photo features are optional and hideable — see README.md. The
   full-screen viewer is built by main.js only while a [data-lightbox]
   slot exists, so removing the photo blocks removes the viewer too:
   nothing orphaned, no platform contract. */

/* Cover backdrop (behind the poster copy) */
.cover-photo {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
}
.cover-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The clickable wrapper overlays the figure so the whole photo opens the
   viewer; the platform may swap the inner <img> for a <picture> when a
   cover-photo morph is bound, so the wrapper keeps the hook. */
.cover-open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.cover-open picture { display: block; width: 100%; height: 100%; }
.cover-open:focus-visible { outline: 3px solid var(--sun); outline-offset: -3px; }
/* Scrim keeps the poster text readable over any photo. */
.cover-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none; /* decorative — must not eat clicks meant for the photo */
  background: linear-gradient(180deg, rgba(8, 31, 61, .58) 0%, rgba(11, 46, 89, .18) 46%, rgba(8, 31, 61, .88) 100%);
}
.cover-panel .panel-inner {
  position: relative;
  z-index: 1;
  /* The poster wrapper must not eat clicks meant for the cover photo
     beneath it (the photo opens the full-screen viewer). Only the
     interactive controls stay clickable. */
  pointer-events: none;
}
.cover-panel .panel-inner a,
.cover-panel .panel-inner button,
.cover-panel .panel-inner [role="button"] { pointer-events: auto; }

.cover-photo-cap {
  position: absolute;
  left: 24px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 8px 15px;
  font: 700 13px/1.2 var(--font-body);
  color: var(--foam);
  background: rgba(8, 31, 61, .62);
  border: 1px solid var(--line-light);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px -8px rgba(4, 18, 38, .6);
  pointer-events: none;
}

/* Snapshots gallery (a wall of sand-cream polaroids) */
.snap-panel { background: var(--navy-deep); }
.snap-panel .panel-title { color: var(--foam); }
.snap-panel .panel-lead  { color: var(--muted-light); }

.snap-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 28px;
}
.snap-item {
  margin: 0;
  padding: 8px 8px 12px;
  background: var(--sand);
  border-radius: 12px;
  box-shadow: 0 14px 28px -18px rgba(4, 18, 38, .8);
  transition: transform .18s ease, box-shadow .18s ease;
}
.snap-item:nth-child(odd)  { transform: rotate(-1.2deg); }
.snap-item:nth-child(even) { transform: rotate(1.1deg); }
.snap-item img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 7px;
}
.snap-item figcaption {
  margin-top: 9px;
  text-align: center;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink);
}
.snap-item img:focus-visible,
.cover-photo img:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

html.js .snap-item { position: relative; }
html.js .snap-item:hover,
html.js .snap-item:focus-within { transform: rotate(0deg) translateY(-3px); box-shadow: 0 18px 34px -18px rgba(4, 18, 38, .9); }
html.js .snap-item img, html.js .cover-photo img { cursor: zoom-in; }

/* Small "view full size" badge on hover / keyboard focus — shows a photo is
   clickable. Purely visual; without JS (no viewer) it never appears. */
html.js .snap-item::after,
html.js .cover-photo::before {
  content: "";
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(253, 240, 213, .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='%230b2e59' 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(11, 46, 89, .15);
  box-shadow: 0 4px 12px -4px rgba(4, 18, 38, .5);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
html.js .snap-item:hover::after,
html.js .snap-item:focus-within::after,
html.js .cover-photo:hover::before,
html.js .cover-photo:focus-within::before { opacity: 1; transform: none; }

/* Full-screen photo viewer (lightbox) — markup built by main.js */
.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(8, 31, 61, .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(--sand);
  border-radius: 12px;
  background: var(--navy-deep); /* mat while loading / if the file is missing */
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
}
.photo-viewer figcaption {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 24px;
  color: var(--sand);
}
.photo-viewer .pv-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(72vw, 520px);
  height: min(46vh, 360px);
  border: 6px solid var(--sand);
  border-radius: 12px;
  background: var(--navy-deep);
  color: var(--muted-light);
  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 rgba(234, 250, 247, .5);
  background: var(--sand);
  color: var(--navy);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  transition: transform .18s ease, background-color .18s ease;
}
.pv-btn:hover { transform: scale(1.06); background: #fff; }
.pv-close { top: calc(14px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
.pv-prev  { left: 12px; top: 50%; transform: translateY(-50%); }
.pv-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.pv-prev:hover, .pv-next:hover { transform: translateY(-50%) scale(1.06); }
.photo-viewer :focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

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

/* ── Optional official banner (Details panel) ─────────────────────────
   Shows the event's own flyer/banner so guests confirm they're in the
   right place. Clicking opens it in the full-screen viewer. Hide it by
   deleting the .banner-wrap block or `display:none` on it. */
.banner-wrap { margin-top: 30px; text-align: center; }
.banner-title {
  margin: 0 0 14px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  color: var(--sun);
}
.banner-card {
  margin: 0;
  padding: 10px 10px 14px;
  background: var(--sand);
  border-radius: 14px;
  transform: rotate(-.8deg);
  box-shadow: 0 14px 28px -18px rgba(4, 18, 38, .8);
  transition: transform .18s ease, box-shadow .18s ease;
}
html.js .banner-card:hover,
html.js .banner-card:focus-within { transform: rotate(0deg) translateY(-3px); box-shadow: 0 18px 34px -18px rgba(4, 18, 38, .9); }
.banner-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}
/* Clickable wrapper (same reasoning as .cover-open): survives the platform's
   <picture> swap when a banner-photo morph is bound. */
.banner-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 8px;
  cursor: zoom-in;
}
.banner-open picture { display: block; width: 100%; }
.banner-open:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
html.js .banner-card img { cursor: zoom-in; }
.banner-card img:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.banner-card figcaption {
  margin-top: 10px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink);
}

/* ── Optional party video (aftermovie card, Snapshots panel) ────────────
   Hidden by default; main.js reveals it only when data-video-embed holds
   a URL. Clicking plays it full-screen in the viewer. Hide it by deleting
   the .video-card block, leaving data-video-embed empty, or `display:none`
   on .video-card. */
.video-card { margin-top: 30px; text-align: center; }
.video-card[hidden] { display: none; }
.video-title {
  margin: 0 0 14px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  color: var(--sun);
}
.video-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--navy);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 28px -18px rgba(4, 18, 38, .8);
  transition: transform .18s ease, box-shadow .18s ease;
}
.video-open:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -18px rgba(4, 18, 38, .9); }
.video-open:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.video-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* Poster file missing → soft gradient tile (still clickable, still plays). */
.video-open.video-open-plain {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background: linear-gradient(135deg, var(--ocean), var(--lagoon));
}
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(253, 240, 213, .95);
  color: var(--navy);
  font-size: 26px;
  padding-left: 5px;              /* optical centering of ▶ */
  border: 3px solid rgba(255, 255, 255, .35);
  box-shadow: 0 10px 30px rgba(4, 18, 38, .45);
  transition: transform .18s ease;
}
.video-open:hover .video-play { transform: translate(-50%, -50%) scale(1.08); }
.video-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  font: 800 13px/1 var(--font-body);
  letter-spacing: .04em;
  color: var(--sand);
  background: rgba(11, 46, 89, .72);
  border: 1px solid var(--line-light);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.video-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted-light); }

/* Video mode inside the full-screen viewer (opened from the video card) */
.pv-video {
  display: none;
  width: 100%;
  max-width: min(94vw, 940px);
}
.photo-viewer.is-video .pv-video { display: block; }
.photo-viewer.is-video figure { display: none; }
.photo-viewer.is-video .pv-prev,
.photo-viewer.is-video .pv-next { display: none; }
.pv-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 6px solid var(--sand);
  border-radius: 12px;
  background: #000;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
}

/* ── Free page (optional host-defined page) ──────────────────────────
   Repeatable .free-block cards: a free title, free text and an OPTIONAL
   photo (a block renders as title + text without its photo). Leaving
   every block empty removes the whole page (and its pill) at render;
   main.js drops the pill when the panel is gone. */
.free-panel {
  background: linear-gradient(165deg, var(--ocean) 0%, var(--navy-deep) 78%);
}
.free-blocks {
  display: grid;
  gap: 22px;
  margin-top: 8px;
}
.free-block {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: rgba(8, 31, 61, .55);
  text-align: center;
}
.free-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 5.5vw, 36px);
  line-height: 1.1;
  color: var(--sun);
}
.free-content {
  margin: 12px auto 0;
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--foam);
  white-space: pre-line;              /* host line breaks are kept */
}
.free-figure {
  margin: 18px auto 0;
  max-width: 560px;
}
.free-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: 4px;
  background: var(--sand);
  border-radius: 10px;
  box-shadow: 0 14px 28px -18px rgba(4, 18, 38, .8);
}
html.js .free-figure img { cursor: zoom-in; }
html.js .free-figure img:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
/* When the Free Image field is left empty, the render engine removes the
   <img> from the block; hide the whole frame so no empty box or "An optional
   photo" caption leaks to guests. */
.free-figure:not(:has(img)) { display: none; }
.free-cap {
  margin: 10px 0 0;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
  color: var(--muted-light);
}

/* ── Footer (brand placeholder, tucked into the last panel by main.js) ── */
.site-foot,
.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line-light);
}
.site-foot p,
.app-footer p { margin: 0; font-size: 13px; color: var(--muted-light); }
.footer-brand {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sun);
}
/* The footer can land on the sand RSVP panel too — keep it legible there. */
.rsvp-panel .site-foot,
.rsvp-panel .app-footer { border-top-color: var(--line-dark); }
.rsvp-panel .site-foot p,
.rsvp-panel .app-footer p { color: var(--muted-dark); }
.rsvp-panel .footer-brand { color: var(--coral-deep); }
.shell-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--navy-deep), inset 0 0 0 4px var(--sun);
}

/* Full-width powered-by brand strip — a slim "Powered by Kundangi" line
   that reads at the end of the invitation. main.js tucks it into the last
   panel that survives, like the app-footer; the engine swaps the literal
   Kundangi token inside .link-footer for the app name at render, and the
   cockpit's Free Powered By field can override the whole line. */
.powered-by {
  width: 100%;
  margin-top: 26px;
  text-align: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line-light);
  background: var(--navy-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.powered-by .link-footer { color: var(--sun); }
/* The strip can land on the sand RSVP panel too — keep it legible. */
.rsvp-panel .powered-by { border-top-color: var(--line-dark); }

/* ── Section switcher (text-labelled pill bar) ──────────────────────────
   Built by main.js from the panels that survive platform processing.
   Labels are short section names so the nav reads clearly; on narrow
   phones the bar scrolls horizontally instead of shrinking the pills. */
.panel-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 20px);
  padding: 7px;
  background: rgba(11, 46, 89, .9);
  border: 1px solid var(--line-light);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(4, 18, 38, .45);
  overflow-x: auto;               /* many sections → swipe, never clipped */
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.panel-nav::-webkit-scrollbar { display: none; }
.panel-nav[hidden] { display: none; }

.panel-nav button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;               /* comfortable touch target */
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: 800 13px/1 var(--font-body);
  letter-spacing: .05em;
  color: var(--muted-light);
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.panel-nav button:hover { color: var(--foam); }
.panel-nav button.is-current {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 4px 0 var(--coral-deep);
}
.panel-nav button:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.panel-nav .nav-label { white-space: nowrap; }

/* ── Mobile prev/next section arrows ──────────────────────────────────
   The pill bar swipes horizontally on narrow screens; these icon buttons
   give an explicit previous/next control too (same wrap-around behaviour
   as the arrow keys). Built/armed by main.js only when 2+ panels exist
   (body.shell-on) and shown on narrow screens only — the pill bar stays
   the primary navigation everywhere. */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;                        /* below the photo viewer (z 100) */
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-light);
  background: rgba(11, 46, 89, .9);
  color: var(--sand);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(4, 18, 38, .45);
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background-color .15s ease;
}
.nav-arrow:hover { transform: translateY(-50%) scale(1.06); background: var(--ocean); }
.nav-arrow:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.nav-arrow--prev { left: calc(10px + env(safe-area-inset-left)); }
.nav-arrow--next { right: calc(10px + env(safe-area-inset-right)); }
@media (max-width: 640px) {
  .shell-on .nav-arrow:not([hidden]) { display: flex; }
}

/* ── 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 invitation prints ──────────── */
@media print {
  body { background: #fff; color: #000; }
  .panel-nav { display: none !important; }
  .app-shell { height: auto !important; overflow: visible !important; }
  .panel { display: block !important; height: auto !important; overflow: visible !important; }
  .panel-inner {
    max-width: none;
    min-height: 0;
    padding: 20px 26px;
    page-break-after: always;
  }
  .swell-strip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .guest-greeting, .cover-actions, .panel-foot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cover-photo { position: relative; height: 260px; margin-bottom: 24px; }
  .cover-photo-cap { position: static; display: inline-block; margin-top: 8px; }
  .snap-item, .banner-card, .video-card, .free-figure, .free-block { page-break-inside: avoid; }
  .video-open { border-radius: 10px; }
  .photo-viewer { display: none !important; }
  a[href]::after { content: ""; }
}
