/* ==========================================================================
   wedding-id-kabar-bahagia — "Kabar Bahagia"
   A poster-style Indonesian wedding announcement flyer.

   Design tokens / sections / platform mount points are all commented so
   a template admin can bind morphs (editable fields) to stable selectors.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --paper: #faf3e2;
  --paper-hi: #fffaf0;
  --paper-deep: #f2e3c6;
  --almond: #f6ead3;
  --forest: #223b33;
  --forest-deep: #172a24;
  --forest-soft: #2c4a40;
  --terra: #b2492f;
  --terra-deep: #8f351f;
  --gold: #c19a4b;
  --ink: #33241c;
  --ink-soft: rgba(51, 36, 28, .62);
  --cream: #f4ead6;
  --cream-soft: rgba(244, 234, 214, .66);
  --line-light: rgba(51, 36, 28, .22);
  --line-dark: rgba(244, 234, 214, .26);
  --err-dark: #ffb4a0;
  --serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --radius: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--forest-deep);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--forest);
  color: var(--cream);
  font-size: .85rem;
  border-radius: 0 0 10px 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   APP SHELL — one normal scrolling page. The sections stack vertically and
   the page scrolls the usual way (wheel, trackpad, touch, keyboard).
   ========================================================================== */
.app {
  position: relative;
  background: var(--forest-deep);
}

/* Every section is a full poster page that flows down the document. */
body.js .panel,
body.no-js .panel {
  position: relative;
  min-height: 100vh;
  overflow: visible;
}
body.js .panels,
body.no-js .panels { transform: none; }

/* No JS: the cover slideshow shows its first photo statically. */
body.no-js .cover-photo__slides img { opacity: 0; }
body.no-js .cover-photo__slides img:first-child { opacity: 1; }
body.no-js .cover-photo__dots { display: none; }

/* ---------- Sheet = one poster page ---------- */
.sheet {
  position: relative;       /* anchor for .frame / .orn / .cover-photo */
  min-height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: calc(72px + var(--safe-t)) 20px calc(40px + var(--safe-b));
}

.sheet--paper {
  background:
    radial-gradient(130% 100% at 50% 0%, var(--paper-hi) 0%, var(--paper) 46%, var(--paper-deep) 100%);
}
.sheet--almond {
  background:
    radial-gradient(130% 100% at 50% 0%, #faf1dc 0%, var(--almond) 50%, #ebd9b4 100%);
}
.sheet--forest {
  background:
    radial-gradient(140% 110% at 50% 0%, var(--forest-soft) 0%, var(--forest) 48%, var(--forest-deep) 100%);
  color: var(--cream);
}

.sheet__inner {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sheet__inner--center { justify-content: center; }

/* Poster double frame (cover only) */
.frame {
  position: absolute;
  inset: 14px;
  border: 1px solid var(--line-light);
  pointer-events: none;
}
.frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(51, 36, 28, .14);
}
.sheet--forest .frame { border-color: rgba(244, 234, 214, .22); }
.sheet--forest .frame::before { border-color: rgba(244, 234, 214, .12); }

.orn { position: absolute; width: 104px; height: 104px; color: var(--terra); opacity: .8; }
.orn--tl { top: 30px; left: 30px; }
.orn--br { bottom: 30px; right: 30px; transform: rotate(180deg); }
.sheet--forest .orn { color: var(--gold); opacity: .65; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn--primary {
  background: var(--terra);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(178, 73, 47, .65);
}
.btn--primary:hover { background: var(--terra-deep); transform: translateY(-1px); }

.btn--ghost {
  border-color: var(--line-light);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--terra); color: var(--terra); }
.sheet--forest .btn--ghost { border-color: var(--line-dark); color: var(--cream); }
.sheet--forest .btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn--block { width: 100%; }

/* ==========================================================================
   COVER — the poster announcement
   ========================================================================== */
.cover { padding: 40px 8px; }

.cover__kicker {
  font-family: var(--script);
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  line-height: 1.1;
  color: var(--terra);
  margin: 0 0 8px;
  text-shadow: 0 2px 18px rgba(178, 73, 47, .18);
}

.cover__names {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.5rem, 9.5vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 12px 0 0;
  overflow-wrap: anywhere;   /* very long names never overflow the poster */
}
.cover__names .bride-name { font-style: italic; color: var(--ink); }
.cover__names .groom-name { color: var(--ink); }

.cover__amp {
  display: block;
  font-family: var(--script);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 400;
  color: var(--terra);
  line-height: 1.35;
  margin: 2px 0;
}

.cover__line {
  margin: 18px 0 0;
  font-size: clamp(.95rem, 3vw, 1.05rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.cover__date {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.5vw, 1.6rem);
  font-weight: 600;
  color: var(--terra-deep);
}

.cover__parents {
  margin: 26px auto 0;
  max-width: 560px;
  font-size: .86rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: center;
}
.cover__sep { color: var(--terra); font-weight: 700; }

.cover__actions { margin-top: 34px; }

.cover__scroll {
  display: inline-flex;
  margin-top: 30px;
  color: var(--ink-soft);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-light);
  animation: nudge 2.2s ease-in-out infinite;
}
.cover__scroll svg { width: 18px; height: 18px; }

/* Optional full-bleed photo behind the poster (default: on).
   The presence of .cover-photo switches the cover to dark “photo mode” via
   .sheet--photo (added by main.js) plus the :has() selector for the no-JS
   case. Delete the .cover-photo block in index.html to return the cover to
   the plain paper poster — nothing else needs changing. */
.cover-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 16%, rgba(23, 42, 36, .3) 0%, rgba(23, 42, 36, .6) 58%, rgba(23, 42, 36, .84) 100%);
}

/* Cover slideshow (one or more photos; keep a single <img> for a static
   cover). Slides crossfade while the cover panel is active; the chip opens
   the current slide in the lightbox and the dots flip through them. */
.cover-photo__slides { position: absolute; inset: 0; }
.cover-photo__slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
}
.cover-photo__slides img.is-active { opacity: 1; }

.cover-photo__ui {
  position: absolute;
  z-index: 6;
  left: calc(18px + var(--safe-l));
  bottom: calc(16px + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.cover-photo__zoom,
.cover-photo__dots { pointer-events: auto; }

.cover-photo__zoom {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(23, 42, 36, .55);
  border: 1px solid rgba(244, 234, 214, .4);
  color: var(--cream);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .5);
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.cover-photo__zoom svg { width: 15px; height: 15px; }
.cover-photo__zoom:hover { background: rgba(23, 42, 36, .85); border-color: var(--gold); color: var(--gold); }
.cover-photo__zoom:active { transform: scale(.97); }

.cover-photo__dots { display: flex; gap: 8px; align-items: center; }
.cover-photo__dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(244, 234, 214, .6);
  background: transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.cover-photo__dots button:hover { border-color: var(--gold); }
.cover-photo__dots button.is-active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.25);
}

.sheet--photo,
.sheet:has(.cover-photo) { background: var(--forest-deep); }
.sheet--photo .frame,
.sheet:has(.cover-photo) .frame { border-color: rgba(244, 234, 214, .34); }
.sheet--photo .frame::before,
.sheet:has(.cover-photo) .frame::before { border-color: rgba(244, 234, 214, .18); }
.sheet--photo .orn,
.sheet:has(.cover-photo) .orn { color: var(--gold); opacity: .8; }
.sheet--photo .cover__kicker,
.sheet:has(.cover-photo) .cover__kicker { color: var(--gold); text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.sheet--photo .cover__names .bride-name,
.sheet:has(.cover-photo) .cover__names .bride-name,
.sheet--photo .cover__names .groom-name,
.sheet:has(.cover-photo) .cover__names .groom-name { color: var(--cream); }
.sheet--photo .cover__amp,
.sheet:has(.cover-photo) .cover__amp { color: var(--gold); }
.sheet--photo .cover__line,
.sheet:has(.cover-photo) .cover__line { color: rgba(244, 234, 214, .78); }
.sheet--photo .cover__date,
.sheet:has(.cover-photo) .cover__date { color: var(--gold); }
.sheet--photo .cover__parents,
.sheet:has(.cover-photo) .cover__parents { color: rgba(244, 234, 214, .82); }
.sheet--photo .cover__sep,
.sheet:has(.cover-photo) .cover__sep { color: var(--gold); }
.sheet--photo .cover__scroll,
.sheet:has(.cover-photo) .cover__scroll { border-color: rgba(244, 234, 214, .42); color: var(--cream); }

@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: .7; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ==========================================================================
   PRAYER PANEL
   ========================================================================== */
.bismillah {
  font-family: var(--script);
  font-size: clamp(1.9rem, 7vw, 2.7rem);
  color: var(--gold);
  margin: 0 0 20px;
  line-height: 1.2;
}

.verse {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 3.6vw, 1.22rem);
  font-style: italic;
  line-height: 1.75;
  max-width: 620px;
  margin: 0 auto;
  color: var(--cream);
}
.verse-ref {
  margin: 10px 0 0;
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

.rule {
  width: 90px;
  height: 1px;
  border: 0;
  background: var(--gold);
  opacity: .6;
  margin: 34px auto;
}

.guest-line {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  font-weight: 600;
  margin: 0 0 14px;
}
.guest-greeting { color: var(--gold); }

.welcome {
  max-width: 560px;
  margin: 0 auto;
  color: var(--cream-soft);
  font-size: .95rem;
}

/* ==========================================================================
   SECTION HEADS
   ========================================================================== */
.section-head { margin-bottom: 34px; }
.section-head__kicker {
  margin: 0 0 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--terra);
}
.section-head--light .section-head__kicker { color: var(--gold); }
.section-head__title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}
.section-head--light .section-head__title { color: var(--cream); }

/* ==========================================================================
   COUPLE
   ========================================================================== */
.portraits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 34px;
  width: 100%;
  max-width: 680px;
}

.portrait { margin: 0; }

.portrait__frame {
  position: relative;
  border-radius: 6px 6px 26px 6px;
  overflow: hidden;
  box-shadow: 0 22px 44px -24px rgba(51, 36, 28, .55);
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(120% 120% at 30% 20%, var(--paper-hi) 0%, var(--paper-deep) 100%);
  border: 1px solid rgba(51, 36, 28, .14);
}
.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, .55);
  pointer-events: none;
}
.portrait__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

/* The whole portrait is a clickable zoom target (opens the lightbox). */
.portrait__link {
  display: block;
  border-radius: 6px 6px 26px 6px;
  text-decoration: none;
  color: inherit;
}
.portrait__link.is-fallback { pointer-events: none; }
.portrait__link .portrait__frame {
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.portrait__link:hover .portrait__frame,
.portrait__link:focus-visible .portrait__frame {
  transform: translateY(-3px);
  box-shadow: 0 28px 52px -26px rgba(51, 36, 28, .62);
}
.portrait__link:hover .portrait__frame img { transform: scale(1.03); }

.portrait__zoom-hint {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(23, 42, 36, .5);
  border: 1px solid rgba(244, 234, 214, .4);
  color: var(--cream);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.portrait__zoom-hint svg { width: 16px; height: 16px; }
.portrait__link:hover .portrait__zoom-hint,
.portrait__link:focus-visible .portrait__zoom-hint { opacity: 1; transform: translateY(0); }

/* On touch there is no hover — keep the hint gently visible instead. */
@media (pointer: coarse) {
  .portrait__zoom-hint { opacity: .55; transform: none; }
}
.portrait__fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 5rem;
  font-weight: 900;
  color: var(--terra);
  opacity: .9;
}
.portrait__frame.is-fallback .portrait__fallback { display: flex; }
.portrait__frame.is-fallback img { display: none; }

.portrait figcaption { margin-top: 14px; text-align: center; }
.portrait__name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.28rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.portrait__parents {
  margin: 4px 0 0;
  font-size: .82rem;
  color: var(--ink-soft);
}

.couple-note {
  margin: 40px auto 0;
  max-width: 540px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ==========================================================================
   GALLERY — optional photo mosaic (delete the #gallery section to hide)
   ========================================================================== */
.gallery-note {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--ink-soft);
  font-size: .9rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 150px;
  grid-auto-flow: dense;      /* keeps the mosaic tight when items are removed */
  gap: 12px;
  width: 100%;
  max-width: 760px;
}

.gallery-item {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 16px 34px -26px rgba(51, 36, 28, .5);
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gallery-item:hover { box-shadow: 0 22px 40px -22px rgba(51, 36, 28, .6); }
.gallery-item:focus-visible { outline-offset: 2px; }
.gallery-item--tall { grid-row: span 2; }
.gallery-item--wide { grid-column: span 2; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.gallery-item:hover img { transform: scale(1.04); }

.gallery-item__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 14px 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--cream);
  text-align: left;
  background: linear-gradient(to top, rgba(23, 42, 36, .72), rgba(23, 42, 36, 0));
}

/* Fallback when a gallery photo fails to load */
.gallery-item.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 120% at 30% 20%, var(--paper-hi) 0%, var(--paper-deep) 100%);
}
.gallery-item.is-fallback::before {
  content: "📷";
  font-size: 2rem;
  opacity: .5;
}
.gallery-item.is-fallback .gallery-item__cap {
  background: linear-gradient(to top, rgba(51, 36, 28, .38), rgba(51, 36, 28, 0));
  color: var(--ink-soft);
}

/* ==========================================================================
   POSTER / BANNER (optional section — delete #poster to hide)
   ========================================================================== */
.poster-note {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--ink-soft);
  font-size: .9rem;
}

.poster-flyer {
  margin: 28px 0 0;
  width: 100%;
  max-width: 660px;
}
.poster-flyer__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line-light);
  box-shadow: 0 30px 60px -30px rgba(51, 36, 28, .6);
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 120% at 30% 20%, var(--paper-hi) 0%, var(--paper-deep) 100%);
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.poster-flyer__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.poster-flyer__frame:hover { transform: translateY(-3px); box-shadow: 0 36px 66px -32px rgba(51, 36, 28, .68); }
.poster-flyer__frame:hover img { transform: scale(1.02); }

.poster-flyer__zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(23, 42, 36, .55);
  border: 1px solid rgba(244, 234, 214, .4);
  color: var(--cream);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.poster-flyer__zoom svg { width: 15px; height: 15px; }
.poster-flyer__frame:hover .poster-flyer__zoom { background: rgba(23, 42, 36, .85); color: var(--gold); }
.poster-flyer__cap {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: .98rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   VIDEO (optional section — delete #video to hide)
   ========================================================================== */
.video-note {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--ink-soft);
  font-size: .9rem;
}

.video {
  margin-top: 28px;
  width: 100%;
  max-width: 720px;
}
.video__play {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #172a24;
  box-shadow: 0 30px 60px -30px rgba(51, 36, 28, .6);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.video__play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.video__play:hover img { transform: scale(1.02); }

.video__play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.video__play-icon::before {
  content: "";
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(23, 42, 36, .45);
  border: 1px solid rgba(244, 234, 214, .45);
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55);
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.video__play-icon svg {
  position: relative;
  width: 30px;
  height: 30px;
  margin-left: 4px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
}
.video__play:hover .video__play-icon::before { transform: scale(1.1); background: rgba(178, 73, 47, .85); }

.video__hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(23, 42, 36, .55);
  border: 1px solid rgba(244, 234, 214, .35);
  color: var(--cream);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.video__note {
  margin: 16px auto 0;
  max-width: 560px;
  font-size: .86rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .55);
  border: 1px dashed var(--line-light);
  border-radius: 10px;
  padding: 12px 16px;
}
.video__note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  color: var(--terra);
}
.video__external { margin-top: 16px; }

/* ==========================================================================
   EVENTS
   ========================================================================== */
.event-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  width: 100%;
  max-width: 720px;
}

.event-item {
  position: relative;
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 30px 26px;
  text-align: center;
  box-shadow: 0 16px 34px -26px rgba(51, 36, 28, .5);
}
.event-item::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--terra);
}

.event-label {
  margin: 0 0 10px;
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid var(--terra);
  color: var(--terra);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.event-date {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.14rem;
  margin: 0;
}
.event-time {
  margin: 2px 0 14px;
  font-size: .86rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.event-venue {
  font-family: var(--serif);
  font-size: 1.08rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.event-address {
  margin: 4px 0 0;
  font-size: .84rem;
  color: var(--ink-soft);
}
.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.event-actions .btn { padding: 9px 18px; font-size: .8rem; }

/* Countdown band */
.countdown-band {
  margin-top: 30px;
  width: 100%;
  max-width: 720px;
  background: var(--terra);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: 0 20px 40px -24px rgba(178, 73, 47, .7);
}
.countdown-band__label {
  margin: 0 0 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  opacity: .85;
}
.countdown-band__number {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.6rem, 10vw, 4rem);
  line-height: 1;
}
.countdown-band__number small {
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .1em;
  margin-left: 10px;
  text-transform: uppercase;
}
.countdown-band__past { display: none; margin: 0; font-weight: 600; font-size: 1.05rem; }
.countdown-band.is-past .countdown-band__number { display: none; }
.countdown-band.is-past .countdown-band__past { display: block; }

/* Dress note + FAQ */
.event-extras {
  width: 100%;
  max-width: 720px;
  margin-top: 26px;
  text-align: left;
}
.dress-note {
  background: rgba(255, 255, 255, .5);
  border: 1px dashed var(--line-light);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .88rem;
}

.faq {
  margin-top: 14px;
  border: 1px solid var(--line-light);
  border-radius: 10px;
  background: rgba(255, 255, 255, .4);
}
.faq summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.1rem;
  color: var(--terra);
  transition: transform .25s var(--ease);
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 16px 14px; font-size: .86rem; color: var(--ink-soft); }

/* Map */
.map {
  width: 100%;
  max-width: 720px;
  margin-top: 26px;
}
.map__title {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0 0 10px;
  text-align: left;
}
.map__frame {
  width: 100%;
  height: 260px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  filter: saturate(.9) contrast(.98);
}
.map__cta { margin-top: 12px; }

/* ==========================================================================
   RSVP (wrapped in .rsvp-wrap — the platform strips it when RSVP is off)
   ========================================================================== */
.rsvp-wrap {
  width: 100%;
  max-width: 640px;
}

.rsvp-description { margin: 10px 0 0; color: var(--cream-soft); font-size: .92rem; }

/* Platform RSVP-deadline countdown (hidden until the host sets a deadline) */
.rsvp-countdown { margin: 26px 0 4px; }
.rsvp-countdown__label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}
.rsvp-countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 380px;
  margin: 0 auto;
}
.rsvp-count {
  background: rgba(244, 234, 214, .08);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  padding: 12px 4px;
}
.rsvp-count span {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.rsvp-count small {
  display: block;
  margin-top: 6px;
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream-soft);
}

/* The RSVP form itself */
.rsvp-form {
  margin-top: 26px;
  background: rgba(244, 234, 214, .06);
  border: 1px solid var(--line-dark);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: left;
  backdrop-filter: blur(2px);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-group { margin-top: 16px; }
.form-group--full { margin-top: 16px; }
.form-row .form-group:first-child { margin-top: 16px; }

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--cream);
}
.label-opt { opacity: .7; font-weight: 400; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--cream);
  background: rgba(244, 234, 214, .07);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(244, 234, 214, .4); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(244, 234, 214, .1);
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c19a4b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.form-group select option { color: var(--ink); background: var(--paper); }

.form-group textarea { resize: vertical; min-height: 58px; }

.error {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--err-dark);
  min-height: 0;
}

.rsvp-hint {
  margin: 10px 2px 0;
  font-size: .78rem;
  color: var(--cream-soft);
}

.rsvp-attend-note {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--gold);
}

.rsvp-form #submit-button { margin-top: 22px; }

.loading {
  text-align: center;
  margin-top: 14px;
  font-size: .85rem;
  color: var(--gold);
}

.is-hidden { display: none !important; }

/* Injected thank-you / RSVP-closed state */
.thank-you-message { text-align: center; padding: 10px 0; }
.thank-you-message h3 {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 0 0 10px;
  color: var(--gold);
}
.thank-you-message p { margin: 4px 0; color: var(--cream-soft); font-size: .92rem; }
.thank-you-message small { color: var(--cream-soft); opacity: .8; }

/* ==========================================================================
   GUESTBOOK (platform injects the form + list into .guestbook-body)
   ========================================================================== */
.guestbook-section { width: 100%; max-width: 640px; }
.guestbook-description { margin: 10px 0 0; color: var(--cream-soft); font-size: .92rem; }

.guestbook-body { margin-top: 22px; }

.guestbook-body .guestbook-form { text-align: left; }

.guestbook-body .form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--cream);
}
.guestbook-body .form-control {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--cream);
  background: rgba(244, 234, 214, .07);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.guestbook-body .form-control:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(244, 234, 214, .1);
}
.guestbook-body .error {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--err-dark);
}
.guestbook-body .guestbook-chapta { margin-top: 12px; }

/* The injected submit button carries Bootstrap classes; style it on-brand */
.guestbook-body .btn {
  width: 100%;
  margin-top: 18px;
  background: var(--terra);
  border-color: var(--terra);
  color: #fff;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
}
.guestbook-body .btn:hover { background: var(--terra-deep); }

.loading-guestbook {
  text-align: center;
  margin-top: 12px;
  font-size: .85rem;
  color: var(--gold);
}

/* Message list (injected #comments-container.guestbook-wrap) */
.guestbook-body .guestbook-wrap {
  max-height: none !important;
  overflow: visible !important;
  border-top: 1px solid var(--line-dark) !important;
  margin-top: 26px;
  padding-top: 22px;
  display: grid;
  gap: 12px;
}

.guestbook-entry {
  background: rgba(244, 234, 214, .07);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: left;
}
.guestbook-entry h5 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--gold);
}
.guestbook-entry p { margin: 6px 0 0; font-size: .9rem; color: var(--cream); overflow-wrap: anywhere; }
.guestbook-entry small { display: block; margin-top: 8px; font-size: .72rem; color: var(--cream-soft); }

.more-guestbook-wrap { text-align: center; margin-top: 18px; }
.more-guestbook-wrap #load-more {
  background: transparent;
  border: 1px solid var(--line-dark);
  color: var(--cream);
  border-radius: 999px;
  padding: 11px 26px;
  font-size: .85rem;
  font-weight: 600;
}
.more-guestbook-wrap #load-more:hover { border-color: var(--gold); color: var(--gold); }

/* ==========================================================================
   AMPLOP DIGITAL
   ========================================================================== */
.amplop-note {
  margin: 12px auto 0;
  max-width: 540px;
  color: var(--ink-soft);
  font-size: .9rem;
}

.gift-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 680px;
  margin-top: 30px;
}

.gift-item {
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .55);
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 16px 34px -26px rgba(51, 36, 28, .5);
}
.gift-name {
  margin: 0;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terra);
}
.gift-account {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.gift-holder { margin: 4px 0 0; font-size: .84rem; color: var(--ink-soft); }
.gift-copy { margin-top: 16px; }

.qris { margin-top: 34px; text-align: center; }
.qris__note { font-size: .84rem; color: var(--ink-soft); margin: 0 0 14px; }
.qris__frame {
  position: relative;
  display: inline-block;
  width: 220px;
  height: 220px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: 14px;
  box-shadow: 0 18px 38px -24px rgba(51, 36, 28, .55);
  text-decoration: none;
  cursor: zoom-in;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.qris__frame:hover {
  border-color: var(--terra);
  transform: translateY(-2px);
  box-shadow: 0 24px 44px -22px rgba(51, 36, 28, .62);
}
.qris__frame.is-placeholder { pointer-events: none; }
.qris__frame img { width: 100%; height: 100%; object-fit: contain; }
.qris__placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: .2em;
  color: var(--ink-soft);
}
.qris__frame.is-placeholder .qris__placeholder { display: flex; }

/* ==========================================================================
   FREE PAGE (optional section — delete #free-page to hide)
   ========================================================================== */
.free-page__intro {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--ink-soft);
  font-size: .9rem;
}

.free-blocks {
  display: grid;
  gap: 22px;
  width: 100%;
  max-width: 680px;
  margin-top: 30px;
}

.free-block {
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 30px 26px;
  text-align: center;
  box-shadow: 0 16px 34px -26px rgba(51, 36, 28, .5);
}
.free-block__title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.3rem;
  margin: 0;
  overflow-wrap: anywhere;
}
.free-block__content {
  margin: 10px auto 0;
  max-width: 520px;
  font-size: .93rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* Optional photo slot — delete the .free-figure block and the entry still
   works without an image. Clicking the photo opens it in the lightbox. */
.free-figure {
  margin: 18px auto 0;
  max-width: 520px;
}
.free-block__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line-light);
  box-shadow: 0 18px 38px -24px rgba(51, 36, 28, .55);
  text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.free-block__frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.free-block__frame:hover { transform: translateY(-3px); box-shadow: 0 26px 48px -24px rgba(51, 36, 28, .62); }
.free-block__frame:hover img { transform: scale(1.03); }

.free-block__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(23, 42, 36, .55);
  border: 1px solid rgba(244, 234, 214, .4);
  color: var(--cream);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.free-block__zoom svg { width: 14px; height: 14px; }
.free-block__frame:hover .free-block__zoom { background: rgba(23, 42, 36, .85); color: var(--gold); }

/* Fallback when the free-page photo fails to load */
.free-block__frame.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 120% at 30% 20%, var(--paper-hi) 0%, var(--paper-deep) 100%);
  pointer-events: none;
}
.free-block__frame.is-fallback::before {
  content: "📷";
  font-size: 2rem;
  opacity: .5;
}
.free-block__frame.is-fallback .free-block__zoom { display: none; }

.free-cap {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: .9rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   CLOSING
   ========================================================================== */
.thanks__script {
  font-family: var(--script);
  font-size: clamp(2.6rem, 10vw, 3.8rem);
  color: var(--gold);
  margin: 0;
  line-height: 1.1;
}
.thanks__body {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--cream-soft);
  font-size: .95rem;
}
.thanks__names {
  margin: 34px 0 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.thanks__amp {
  font-family: var(--script);
  color: var(--gold);
  font-size: 1.4em;
}
.thanks__farewell {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--gold);
}
.thanks__year {
  margin: 8px 0 0;
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cream-soft);
}
.thanks__parents {
  margin: 36px 0 0;
  font-size: .8rem;
  color: var(--cream-soft);
  line-height: 1.9;
  opacity: .85;
}

/* Brand placeholder footer — the platform binds/swaps this */
.footer-brand {
  margin: 44px 0 0;
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cream-soft);
  opacity: .75;
}
.footer-brand-name { color: var(--gold); }

/* ==========================================================================
   POWERED BY — full-width brand strip at the foot of the invitation
   ========================================================================== */
.powered-by {
  width: 100%;
  text-align: center;
  padding: 14px 16px calc(16px + var(--safe-b));
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cream-soft);
  background: var(--forest-deep);
}
.powered-by .link-footer { color: var(--gold); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   LIGHTBOX — fullscreen photo viewer (gallery)
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }
body.lightbox-open { overflow: hidden; } /* lock the page while the lightbox is open */

.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 14, .9);
  backdrop-filter: blur(6px);
  animation: fade .25s var(--ease);
}

.lightbox__figure {
  position: relative;
  margin: 0;
  max-width: min(920px, 94vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  animation: lb-in .3s var(--ease);
}
.lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  background: var(--paper);
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transition: transform .2s var(--ease);
}
.lightbox__stage.is-zoomed .lightbox__img { cursor: grab; }
.lightbox__stage.is-zoomed .lightbox__img:active { cursor: grabbing; }
.lightbox__stage.is-panning .lightbox__img { transition: none; }
.lightbox__cap {
  margin-top: 14px;
  text-align: center;
  color: var(--cream-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
}

.lightbox__video {
  width: min(880px, 90vw);
  aspect-ratio: 16 / 9;
  max-height: 78vh;
}
.lightbox__video iframe,
.lightbox__video video {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

/* Zoom tools (images) + count + "open original" */
.lightbox__tools {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  gap: 8px;
}
.lightbox__tool {
  min-width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(244, 234, 214, .35);
  background: rgba(23, 42, 36, .6);
  color: var(--cream);
  font-size: 1.05rem;
  line-height: 1;
  backdrop-filter: blur(4px);
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease);
}
.lightbox__tool:hover { border-color: var(--gold); color: var(--gold); }
.lightbox__tool:disabled { opacity: .3; cursor: default; }
.lightbox__tool--readout {
  width: auto;
  padding: 0 14px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.lightbox__original {
  position: absolute;
  right: calc(16px + var(--safe-r));
  bottom: calc(18px + var(--safe-b));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 234, 214, .35);
  background: rgba(23, 42, 36, .6);
  color: var(--cream);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.lightbox__original:hover { border-color: var(--gold); color: var(--gold); }
.lightbox__count {
  position: absolute;
  top: calc(18px + var(--safe-t));
  left: calc(18px + var(--safe-l));
  z-index: 2;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(23, 42, 36, .55);
  border: 1px solid rgba(244, 234, 214, .3);
  color: var(--cream-soft);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(244, 234, 214, .35);
  background: rgba(23, 42, 36, .6);
  color: var(--cream);
  font-size: 1.4rem;
  line-height: 1;
  backdrop-filter: blur(4px);
  transition: border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.lightbox__close:hover, .lightbox__nav:hover { border-color: var(--gold); color: var(--gold); }
.lightbox__close { top: calc(16px + var(--safe-t)); right: calc(16px + var(--safe-r)); }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: calc(14px + var(--safe-l)); }
.lightbox__nav--next { right: calc(14px + var(--safe-r)); }
.lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }

@keyframes lb-in {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
/* Guarantee the hidden attribute always wins, even over author display
   rules (e.g. .btn is display:inline-flex, which would otherwise keep a
   hidden button visible). */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   REVEAL-ON-SCROLL
   ========================================================================== */
body.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
body.js .reveal.is-in { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  body.js .reveal { opacity: 1; transform: none; }
  .cover__scroll { animation: none; }
  .cover-photo__slides img { transition: none; }
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  body.js .panel {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
    page-break-after: always;
  }
  .powered-by, .skip-link, .cover__scroll, .lightbox { display: none !important; }
  .cover-photo { display: none; }            /* the plain paper poster prints */
  .cover-photo__ui, .poster-flyer__zoom, .video, .portrait__zoom-hint { display: none !important; }
  .sheet { padding: 24px 16px; }
  .sheet--paper, .sheet--almond, .sheet--forest { background: #faf3e2 !important; color: var(--ink) !important; }
  .sheet--forest * { color: var(--ink) !important; }
  .sheet--forest .section-head__kicker, .sheet--forest .verse-ref,
  .sheet--forest .guest-greeting, .sheet--forest .thanks__script,
  .sheet--forest .thanks__farewell, .sheet--forest .rsvp-attend-note,
  .sheet--forest .thank-you-message h3 { color: var(--terra) !important; }
  .frame { display: none; }
  body.js .reveal { opacity: 1; transform: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ==========================================================================
   RESPONSIVE NICETIES
   ========================================================================== */
@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-row .form-group:first-child { margin-top: 16px; }
  .form-row .form-group + .form-group { margin-top: 16px; }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 118px;
  }
  .gallery-item--wide { aspect-ratio: auto; }
  .lightbox__close, .lightbox__nav { width: 40px; height: 40px; }
  .orn { width: 74px; height: 74px; }
  .orn--tl { top: 22px; left: 22px; }
  .orn--br { bottom: 22px; right: 22px; }
  .sheet { padding-top: calc(64px + var(--safe-t)); }
  .cover-photo__ui { left: calc(14px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); gap: 10px; }
  .cover-photo__zoom { padding: 8px 12px; font-size: .74rem; }
  .lightbox__tools { left: 10px; bottom: 10px; gap: 6px; }
  .lightbox__tool { min-width: 38px; height: 38px; }
  .lightbox__tool--readout { padding: 0 12px; }
  .lightbox__original { padding: 8px 12px; font-size: .72rem; }
}


/* ── Guestbook (platform-injected form + message list) ─────────────── */
/* The existing .guestbook-body rules cover fields + list; this adds a
   subtle card shell for the injected form on the dark sheet. */
.guestbook-body #guestbookForm {
  padding: clamp(18px, 4vw, 26px);
  background: rgba(244, 234, 214, 0.04);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
}

.guestbook-body #guestbookForm .guestbook-chapta {
  max-width: 304px;
  margin: 12px auto 0;
}
