/* ═══════════════════════════════════════════════════════════════════════════
   party-beach-card-postcard-paradise — "Postcard from Paradise" (Beach Party · Card)
   Printed-stationery postcard · seafoam paper + sand + navy ink + 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 {
  --paper:      #fdf8ec;
  --paper-bright:#fffdf6;
  --seafoam:    #dff0ec;
  --sand:       #f3e6c8;
  --navy:       #0b2e59;
  --ocean:      #145a8c;
  --lagoon:     #1287a8;
  --turquoise:  #2ec4b6;
  --foam:       #eafaf7;
  --coral:      #ff6b5e;
  --coral-deep: #e84c3d;
  --sun:        #ffc145;
  --ink:        #0b2e59;
  --muted-dark: #6a8191;
  --muted-light:#b6cdd4;
  --danger:     #c0392b;
  --line-dark:  rgba(11, 46, 89, .14);
  --line-light: rgba(234, 250, 247, .16);
  --radius:     20px;
  --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(--ink);
  background: var(--seafoam);
  -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;
}

/* Host off-switch: any section given the `hidden` attribute is dropped from
   the layout here, and main.js removes it from the dot rail too (no dead
   dot). The platform's RSVP/guestbook gating already deletes its sections;
   this is the manual equivalent for the optional Photos panel. */
.panel[hidden] { display: none; }

/* 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: 680px;
  margin: 0 auto;
  padding: calc(26px + env(safe-area-inset-top)) 24px calc(128px + 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 stationery rhythm) ──────────────────────── */
.cover-panel  { background: linear-gradient(180deg, var(--seafoam) 0%, #eaf6f2 60%, var(--sand) 100%); }
.letter-panel { background: var(--sand); }
.banner-panel { background: linear-gradient(180deg, #fdf8ec 0%, #f3e6c8 100%); }
.photos-panel { background: linear-gradient(180deg, #fdeee0 0%, #f8dcc2 100%); }
.film-panel   { background: linear-gradient(180deg, var(--seafoam) 0%, #fdf3d7 100%); }
.rsvp-panel   { background: var(--seafoam); }
.guest-panel  { background: var(--navy); }

/* ── Cover: the postcard front ─────────────────────────────────────────── */
.postcard-wrap { justify-content: center; }

/* little ocean friends floating on the paper */
.doodle {
  position: absolute;
  width: 54px;
  height: 54px;
  pointer-events: none;
  z-index: 0;
}
.doodle--shell { top: 12%;  left: 4%;  transform: rotate(-18deg); }
.doodle--star  { bottom: 14%; right: 5%; transform: rotate(14deg); }
@media (max-width: 560px) {
  .doodle { display: none; }
}

.postcard {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto 16px;
  padding: 0 0 26px;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(11, 46, 89, .18);
}
.postcard::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(11, 46, 89, .35);
  border-radius: 12px;
  pointer-events: none;
}
/* scalloped bottom edge */
.postcard::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 13px;
  background-image: radial-gradient(circle at 11px 0, var(--paper) 11px, transparent 12px);
  background-size: 22px 13px;
  background-repeat: repeat-x;
}

/* the printed scene on the front */
.postcard-scene {
  position: relative;
  height: 156px;
  overflow: hidden;
  border-bottom: 2px dashed rgba(11, 46, 89, .35);
  background:
    radial-gradient(80% 100% at 30% 0%, rgba(255, 193, 69, .14), transparent 60%),
    linear-gradient(180deg, #f2fbf8 0%, #d9efe9 100%);
}
.postcard-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 0%, transparent 60%, rgba(11, 46, 89, .08) 100%);
}

/* Optional photo backdrop behind the printed scene (optional feature). The
   art (sunburst, palms, wave) stays layered on top so the postcard keeps its
   illustrated frame — like a real postcard with a photo and a drawn
   foreground. Delete the <img class="postcard-photo"> from index.html to
   return to the clean art-only scene. */
.postcard-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* The cover scene doubles as the "open the cover photo" target (main.js
   wires it only while the photo exists). The printed art stays decorative
   and click-transparent, so a tap anywhere on the scene reaches it and the
   zoom-in cursor shows across the whole strip. */
html.js .postcard-scene { cursor: zoom-in; }
html.js .postcard-scene img { cursor: zoom-in; }
html.js .postcard-scene .sunburst,
html.js .postcard-scene .card-wave { pointer-events: none; }

/* Small "View photo" chip on the cover scene — the keyboard-accessible way
   to open the cover photo full size. Only exists with JS (no JS → no
   viewer → no chip); main.js hides it if the cover photo is removed. */
.scene-photo-btn {
  position: absolute;
  top: calc(156px - 44px - 8px);
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid rgba(11, 46, 89, .25);
  border-radius: 999px;
  background: rgba(253, 248, 236, .94);
  color: var(--navy);
  font: 700 12px/1 var(--font-body);
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(11, 46, 89, .5);
  transition: transform .15s ease, box-shadow .15s ease;
}
.scene-photo-btn:hover { transform: translateY(-2px); }
.scene-photo-btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.scene-photo-btn[hidden] { display: none; }
html:not(.js) .scene-photo-btn { display: none; }

.sunburst {
  position: absolute;
  top: -80px;
  right: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 193, 69, .55) 0 9deg, rgba(255, 193, 69, 0) 9deg 18deg);
  animation: sunspin 70s linear infinite;
  z-index: 1;
}
@keyframes sunspin { to { transform: rotate(360deg); } }

.palm {
  position: absolute;
  bottom: 0;
  height: 150%;
  color: rgba(11, 46, 89, .14);
  pointer-events: none;
  z-index: 1;
}
.palm--left  { left: -18px; }
.palm--right { right: -18px; transform: scaleX(-1); }

.card-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* the stamp, cancelled */
.stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 66px;
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #fff;
  background: var(--coral);
  border-radius: 12px;
  transform: rotate(9deg);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--coral-deep);
}
.stamp svg { width: 26px; height: 26px; }
.stamp small {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* the message on the front */
.postcard-body {
  padding: 20px 26px 0;
  text-align: center;
}

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--coral-deep);
}
.kicker-dark { color: var(--coral-deep); }

.cover-script {
  margin: 2px 0 0;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.15;
  color: var(--lagoon);
  transform: rotate(-1.5deg);
}

.cover-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 11vw, 64px);
  line-height: 1;
  color: var(--navy);
  letter-spacing: .01em;
}

.cover-sub {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted-dark);
}

.cover-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
  background: rgba(255, 193, 69, .28);
  border: 1.5px solid var(--sun);
  border-radius: 999px;
  padding: 7px 16px;
}
.cover-date svg { color: var(--coral-deep); }

.cover-place {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted-dark);
}

.hosted-by {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted-dark);
}
.host-name { color: var(--navy); font-weight: 800; }

/* ── 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-block { width: 100%; }

.cover-actions { margin-top: 20px; }
.panel-foot { margin-top: 30px; text-align: center; }
.foot-hint { margin: 14px 0 0; color: var(--muted-dark); font-size: 14px; }

/* ── The letter (postcard back) ────────────────────────────────────────── */
.letter-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 30px 30px 28px;
  background: var(--paper-bright);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(11, 46, 89, .16);
}

.stamp--ghost {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 58px;
  height: 58px;
  opacity: .92;
}
.stamp--ghost svg { width: 22px; height: 22px; }

.letter-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 6vw, 36px);
  color: var(--navy);
}

.letter-greeting {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 6vw, 36px);
  color: var(--navy);
}

.letter-body {
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--ink);
}
.letter-body + .letter-body { margin-top: 12px; }

.letter-sign {
  margin: 22px 0 0;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 26px;
  color: var(--lagoon);
}
.letter-sign .host-name { color: var(--lagoon); }

.letter-divider {
  margin: 28px 0 4px;
  border-top: 2px dashed rgba(11, 46, 89, .3);
}

/* letter detail rows */
.detail-list { margin: 18px 0 0; }
.detail-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-dark);
}
.detail-row:last-child { border-bottom: 0; }
.detail-row dt {
  flex: 0 0 110px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--coral-deep);
}
.detail-row dd { margin: 0; font-size: 15px; color: var(--ink); }

/* Empty labels (host left a detail blank) collapse the row cleanly instead
   of leaving a bare icon/whitespace gap — the label cell has no fixed icon
   anymore (repeatance clones would duplicate it), so an empty dt is just
   dropped. A row whose value is empty (label-only) is meaningless to a
   guest, so hide the whole row rather than show a dangling label. */
.detail-row dt:empty { display: none; }
.detail-row:has(dd:empty) { display: none; }

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

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 6.5vw, 42px);
  line-height: 1.05;
  color: var(--navy);
}
.guest-panel .panel-title { color: var(--foam); }

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

.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: var(--paper-bright);
  border: 2px solid #d8cfae;
  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); }
/* The platform injects the message list into #comments-container (guestbook.js
   writes response.comments_html into it) - style it as the scrollable wrapper
   that .guestbook-wrap above was designed for. */
#comments-container {
  margin-top: 22px;
  max-height: 44vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line-light);
}

/* ── Photos: "Party in pictures" gallery (optional photo feature) ─────── */
.photos-wrap { width: 100%; }
.photos-head, .flyer-head, .film-head { margin-bottom: 22px; text-align: center; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.gallery-item { margin: 0; }
.gallery-item img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 14px;
  box-shadow: 0 10px 24px -16px rgba(11, 46, 89, .55);
}
.gallery-item figcaption { margin-top: 8px; text-align: center; }
.gallery-tag {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--coral-deep);
}
.gallery-cap {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  color: var(--navy);
}

/* ── Flyer / banner (optional feature) ──────────────────────────────────
   The event's official flyer or poster shown large, so guests can confirm
   they're in the right place with the right link. Clicking opens it
   full-size in the viewer (main.js). Delete the section to hide it. */
.banner-flyer { margin: 0; }
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  padding: 5px;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 14px;
  box-shadow: 0 12px 26px -18px rgba(11, 46, 89, .45);
}
.banner-flyer figcaption {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--muted-dark);
}

/* ── Video (optional feature) ───────────────────────────────────────────
   Accepts any video URL in data-video-url on .film-card; tapping play
   lazy-loads the embed. Ships with a poster + play button; while the URL
   is empty a gentle note appears instead of a dead button. Delete the
   section to hide the feature. */
.film-card { margin-top: 2px; }

.film-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 5px;
  border-radius: 14px;
  background: var(--paper);
  border: 2px solid var(--navy);
  box-shadow: 0 12px 26px -18px rgba(11, 46, 89, .45);
  overflow: hidden;
}
.film-open {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
}
.film-open img { display: block; width: 100%; height: 100%; object-fit: cover; }
.film-open:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.film-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--coral-deep);
  box-shadow: 0 8px 24px rgba(11, 46, 89, .35);
  animation: film-pulse 2.6s ease-in-out infinite;
}
.film-play svg { width: 26px; height: 26px; margin-left: 3px; }
.film-open:hover .film-play { transform: translate(-50%, -50%) scale(1.08); }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(11, 46, 89, .35), 0 0 0 0 rgba(255, 107, 94, .35); }
  50%      { box-shadow: 0 8px 24px rgba(11, 46, 89, .35), 0 0 0 12px rgba(255, 107, 94, 0); }
}

.film-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--navy);
  background: rgba(253, 248, 236, .9);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
}

.film-note {
  margin: 0;
  padding: 26px 18px;
  text-align: center;
  font-size: 14px;
  font-style: italic;
  color: var(--muted-dark);
}

.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font: 800 14px/1 var(--font-body);
  color: var(--coral-deep);
  text-decoration: none;
  border: 1.5px solid rgba(232, 76, 61, .35);
  border-radius: 999px;
  padding: 11px 18px;
  transition: background .15s ease;
}
.film-external:hover { background: rgba(255, 107, 94, .1); }
.film-external[hidden] { display: none; }

/* ── Free page (optional "Notes" panel) ───────────────────────────────
   A repeatable page filled by the platform's Free Page feature: blocks
   with a free title, free text and an optional image. With zero blocks the
   platform removes the whole panel server-side (its nav tab never renders);
   blocks reorder from the editor. The image is optional: when a block has
   none, the platform removes the img AND its figure wrapper so the block
   stays tidy (title + text remain) — the :has() rule below is a client-side
   safety net for the same state. Clicking an image opens it full size in
   the viewer (main.js [data-lightbox]). */
.free-panel { background: linear-gradient(180deg, #eafaf7 0%, #d9efe9 100%); }
.free-head { margin-bottom: 22px; text-align: center; }

.free-blocks {
  display: grid;
  gap: 22px;
  width: 100%;
}

.free-block {
  margin: 0;
  padding: 22px;
  background: var(--paper-bright);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 0 14px 30px -22px rgba(11, 46, 89, .55);
}

.free-block-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 4.5vw, 26px);
  line-height: 1.15;
  color: var(--navy);
}

.free-block-text {
  margin: 10px 0 0;
  font-size: 15.5px;
  color: var(--ink);
}

.free-block-figure {
  margin: 16px 0 0;
  position: relative;
}
.free-block-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 14px;
  box-shadow: 0 10px 24px -16px rgba(11, 46, 89, .55);
}
/* Optional image: when a block has none, drop the whole frame so the block
   keeps just its title + text. (The engine also removes it server-side.) */
.free-block-figure:not(:has(img)) { display: none; }

/* ── Photo viewer (lightbox) — click any gallery photo to view it full-screen ──
   Pure enhancement over the optional photo slots ([data-lightbox]). The
   viewer markup is built by main.js only when a photo slot exists, so
   removing those blocks removes the viewer entirely — nothing orphaned, no
   platform contract. */
html.js .gallery-photo,
html.js .banner-flyer img,
html.js .free-block-figure img { cursor: zoom-in; }

/* Small "view full size" badge on hover / keyboard focus — shows the photo
   is clickable. Purely visual; without JS (no viewer) it never appears. */
html.js .gallery-item, html.js .banner-flyer, html.js .free-block-figure { position: relative; }
html.js .gallery-item::after,
html.js .banner-flyer::after,
html.js .free-block-figure::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(253, 248, 236, .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, .25);
  box-shadow: 0 4px 12px -4px rgba(11, 46, 89, .45);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
html.js .gallery-item:hover::after,
html.js .gallery-item:focus-within::after,
html.js .banner-flyer:hover::after,
html.js .banner-flyer:focus-within::after,
html.js .free-block-figure:hover::after,
html.js .free-block-figure:focus-within::after {
  opacity: 1;
  transform: none;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(11, 46, 89, .92);
  -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;
}

/* Scrollable pan area — becomes the zoom surface when .is-zoomed. */
.photo-viewer .pv-scroll {
  max-width: 100%;
  max-height: 76vh;
  max-height: 76dvh;
  overflow: hidden;
  border-radius: 12px;
}
.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  max-height: 76dvh;
  width: auto;
  height: auto;
  border: 6px solid var(--paper);
  border-radius: 12px;
  background: var(--paper); /* mat while loading / if the file is missing */
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
}
.photo-viewer.is-zoomed .pv-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.photo-viewer.is-zoomed img {
  width: 200%;
  max-width: none;
  max-height: none;
  height: auto;
}
.photo-viewer figcaption {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: .02em;
  color: var(--foam);
}
.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);
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted-dark);
  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: rgba(253, 248, 236, .94);
  color: var(--navy);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  transition: transform .2s ease, background-color .2s 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-zoom  { top: calc(14px + env(safe-area-inset-top)); left: calc(14px + env(safe-area-inset-left)); }
.pv-prev  { left: 12px; top: 50%; transform: translateY(-50%); }
.pv-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.pv-prev:hover, .pv-next:hover { transform: translateY(-50%) scale(1.06); }
.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 .pv-scroll, .photo-viewer img { max-height: 62vh; max-height: 62dvh; }
  .photo-viewer.is-zoomed img { max-height: none; }
  .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)); }
  .photo-viewer .pv-zoom { top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); }
}

/* ── Footer: brand placeholder, tucked into the last panel by main.js ── */
.app-footer {
  margin-top: 34px;
  padding: 18px 0 0;
  text-align: center;
  border-top: 1px solid var(--line-dark);
}
.footer-brand {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.foot-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 0;
}
.footer-line {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
/* On the navy guestbook panel the footer flips to light ink. */
.guest-panel .app-footer { border-top-color: var(--line-light); }
.guest-panel .footer-brand { color: var(--foam); }
.guest-panel .footer-line { color: var(--muted-light); }
.shell-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--navy), inset 0 0 0 4px var(--sun);
}

/* ── Powered by: full-width platform brand line ────────────────────────
   The .powered-by bar (class name is the platform contract) sits at the
   very end of the invitation. Its text can be replaced via the "Powered By"
   morph (Footer section; default "Powered by Kundangi"); main.js carries
   the bar into the last panel that exists, so it reads as the closing line
   and survives RSVP/Guestbook being stripped. */
.powered-by {
  width: 100%;
  text-align: center;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--muted-dark);
}
.powered-by-brand {
  font-weight: 800;
  color: var(--coral-deep);
}
/* On the navy guestbook panel the bar flips to light ink. */
.guest-panel .powered-by { color: var(--muted-light); }
.guest-panel .powered-by-brand { color: var(--sun); }

/* ── Section switcher — TEXT tabs with icons, built by main.js ──────────
   A fixed bottom pill of labeled buttons (icon + text), so navigation is
   easy to spot and operate on any screen. It scrolls sideways on narrow
   phones (masked fade at the edges) and never leaves a dead tab: sections
   the platform strips vanish here too. */
.panel-nav {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: min(96vw, 780px);
  padding: 8px;
  border-radius: 999px;
  background: rgba(11, 46, 89, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-light);
  box-shadow: 0 8px 24px rgba(4, 18, 38, .4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.panel-nav[hidden] { display: none; }
/* No tabs built (no-JS or single panel) → no bar at all. */
.panel-nav:empty { display: none; }
.panel-nav::-webkit-scrollbar { display: none; }

.panel-nav .nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(234, 250, 247, .85);
  font: 600 13.5px/1 var(--font-body);
  letter-spacing: .03em;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.panel-nav .nav-tab svg { width: 15px; height: 15px; flex: none; opacity: .9; }
.panel-nav .nav-tab:hover { background: rgba(234, 250, 247, .14); }
.panel-nav .nav-tab.is-current {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(255, 107, 94, .7);
}
.panel-nav .nav-tab:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

/* Wider screens: let the pill stretch so all tabs sit visible — scrolling
   is only needed on phones. */
@media (min-width: 700px) {
  .panel-nav { max-width: min(94vw, 960px); }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .sunburst { animation: none; }
  .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;
  }
  .postcard, .letter-card, .stamp, .sunburst, .card-wave, .palm {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .postcard-photo, .gallery-photo, .banner-flyer img, .film-open img, .free-block-figure img {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .photo-viewer { display: none !important; }
  .film-frame iframe { display: none; } /* a playing video can't print — the poster prints instead */
  .postcard { break-inside: avoid; }
  .letter-card { break-inside: avoid; }
  a[href]::after { content: ""; }
}
