/* ============================================================
   The Meridian Summit — Business Conference CARD (invitation)
   template/creative/html/business-conference-card-meridian-summit
   ------------------------------------------------------------
   Design language: a premium printed invitation. Warm ivory paper
   with a subtle linen weave, double hairline gold plate, editorial
   serif letter, and a detachable "reply card" RSVP section.
   Everything is drawn in CSS — zero image files required.

   Behaviour:
   - Continuous scroll: every section (panel) is stacked in the normal
     document flow and the page scrolls from one to the next. Nav tabs
     and CTA buttons smooth-scroll to their section; a scroll-spy keeps
     the active tab in sync. Tabs derive from the DOM, so removed
     sections hide their tabs.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --paper:     #F7F3EA;
  --paper-2:   #EFE9DB;
  --card:      #FDFBF5;
  --ink:       #232A38;
  --muted:     #7A7468;
  --line:      rgba(35, 42, 56, 0.16);
  --gold:      #A8842C;
  --gold-soft: #C7A64E;
  --danger:    #B4483C;
  --ok:        #2E7D52;
  --serif: "Playfair Display", Didot, "Bodoni MT", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --header-h: 4rem; /* enforced .app-header height (see rule below) - cover caps and anchor offsets derive from it */
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(168, 132, 44, 0.25); }

/* ---------- App shell ----------
   All panels are stacked in normal document flow — the whole invitation
   reads as one continuous scroll. The .js class only adds the fixed
   chrome (sticky header, floating tab bar) and smooth anchor scrolling. */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.stage { flex: 1 1 auto; position: relative; }
.panel { outline: none; }
.panel-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.6rem) clamp(1rem, 4vw, 1.75rem) clamp(2.4rem, 6vw, 3.5rem);
}

/* Keep anchored panels clear of the sticky header when nav/CTAs scroll to them */
.js .panel { scroll-margin-top: 3.9rem; }
.js body { padding-bottom: calc(2.8rem + env(safe-area-inset-bottom)); } /* clears the powered-by strip */
.js .panel:focus-visible { outline-offset: -2px; }
@media (prefers-reduced-motion: no-preference) {
  html.js { scroll-behavior: smooth; }
}

/* Paper backdrop with a subtle linen weave */
.panel--paper {
  background:
    repeating-linear-gradient(45deg, rgba(35, 42, 56, 0.012) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(35, 42, 56, 0.012) 0 1px, transparent 1px 3px),
    radial-gradient(1100px 500px at 50% -8%, rgba(168, 132, 44, 0.10), transparent 62%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--header-h); /* locked: the cover's 100dvh cap depends on this number */
  background: rgba(247, 243, 234, 0.9);
  backdrop-filter: blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
.brand-name {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-name em { font-style: normal; color: var(--gold); }

/* Desktop pill nav */
.topnav { display: none; gap: 0.25rem; }
@media (min-width: 860px) { .js .topnav { display: flex; } }
.topnav .tab-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.topnav .tab-btn:hover { color: var(--ink); border-color: var(--line); }
.topnav .tab-btn.is-active { color: var(--gold); border-color: var(--gold); }

/* ---------- Mobile navigation: burger + dropdown menu (<860px) ----------
   Without JS the burger stays hidden — the continuous-scroll page needs
   no chrome to be readable. With JS the burger opens a slide-down
   section menu over a dimmed backdrop; the scroll-spy keeps its items
   in sync just like the desktop pills. */
.nav-burger { display: none; }
.js .nav-burger {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.js .nav-burger:hover { color: var(--gold); border-color: var(--gold); }
.nav-burger svg { width: 1.35rem; height: 1.35rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.nav-burger .icon-close { display: none; }
.nav-burger[aria-expanded="true"] .icon-open { display: none; }
.nav-burger[aria-expanded="true"] .icon-close { display: block; }
@media (min-width: 860px) { .js .nav-burger { display: none; } }

.menu-backdrop {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 43;
  background: rgba(19, 23, 31, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.menu-backdrop.is-open { opacity: 1; pointer-events: auto; }

.mobile-menu { display: none; }
.js .mobile-menu {
  display: block;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 44;
  padding: 0.3rem 0.9rem calc(0.55rem + env(safe-area-inset-bottom));
  background: rgba(247, 243, 234, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 44px -30px rgba(35, 42, 56, 0.55);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.js .mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}
.mobile-menu .tab-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 0.45rem;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.98rem;
  letter-spacing: 0.05em;
  text-align: left;
  cursor: pointer;
}
.mobile-menu .tab-btn:last-child { border-bottom: 0; }
.mobile-menu .tab-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  transition: color 0.15s ease;
}
.mobile-menu .tab-btn:hover,
.mobile-menu .tab-btn.is-active { color: var(--gold); }
.mobile-menu .tab-btn:hover svg,
.mobile-menu .tab-btn.is-active svg { color: var(--gold); }
.tab-btn[hidden] { display: none; }

/* ---------- Shared type bits ---------- */
.kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.2rem;
}
.kicker::before, .kicker::after {
  content: "";
  height: 1px;
  width: 2.6rem;
  background: var(--gold);
  opacity: 0.55;
}

.panel-head { text-align: center; max-width: 640px; margin: 0 auto clamp(1.8rem, 5vw, 2.6rem); }
.panel-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.08;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.panel-sub { color: var(--muted); font-size: clamp(0.96rem, 2vw, 1.05rem); line-height: 1.6; margin: 0; }

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #FBF8F0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(168, 132, 44, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(168, 132, 44, 0.4); }
.cta-btn:active { transform: translateY(0); }
.cta-btn svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cta-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.4rem;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(168, 132, 44, 0.55);
  padding: 0.35rem 0.15rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cta-ghost svg { width: 0.95rem; height: 0.95rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cta-ghost:hover { color: var(--gold-soft); border-color: var(--gold-soft); }

/* ---------- The invitation card ---------- */
.card-inner { max-width: 720px; }
.invite-card {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--card), var(--paper));
  border: 1px solid rgba(35, 42, 56, 0.14);
  border-radius: 4px;
  box-shadow: 0 26px 60px rgba(35, 42, 56, 0.16);
  padding: clamp(2rem, 7vw, 3.6rem) clamp(1.5rem, 6vw, 3.2rem);
  text-align: center;
}
/* Double hairline plate, like a letterpressed card */
.invite-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(168, 132, 44, 0.55);
  pointer-events: none;
  border-radius: 2px;
}

.crest {
  display: inline-grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  margin-bottom: 1.4rem;
}
.card-dateline {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.1rem;
}
.card-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 6.5vw, 3rem);
  line-height: 1.08;
  margin: 0 0 1.4rem;
  color: var(--ink);
}

.guest-greeting {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 0.9rem;
}

.card-body { max-width: 460px; margin: 0 auto; }
.card-body p {
  font-family: var(--serif);
  font-size: clamp(1rem, 2.6vw, 1.12rem);
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 1rem;
}
.card-body strong { font-weight: 700; color: var(--gold); }

.card-details {
  margin: 1.9rem auto 0;
  max-width: 440px;
  text-align: left;
  border-top: 1px solid var(--line);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--line);
}
.detail-row dt {
  flex: 0 0 auto;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.25rem;
}
.detail-row dd { margin: 0; text-align: right; font-size: 0.92rem; line-height: 1.5; }

.card-org {
  margin: 1.6rem auto 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-cta { margin: 1.7rem 0 0; }
.card-hint {
  margin: 1.1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Cover (Invitation): always exactly one screen ----------
   The cover reads as a poster face: it never grows past the viewport
   (100dvh minus the sticky header) and its content is vertically
   centred. Type, spacing and the letterhead photo scale with dvh
   clamps; on shorter screens secondary copy steps aside so the
   essentials — title, date line, facts, RSVP — always stay visible. */
.panel--cover {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-x: hidden;
  overflow-y: auto; /* safety valve for extreme text-zoom settings */
  scrollbar-width: thin;
}
.panel--cover .panel-inner {
  margin: auto;              /* safe vertical centring: no top-clipping when tight */
  max-width: 720px;
  width: 100%;
  padding-top: clamp(0.7rem, 2dvh, 2.6rem);
  padding-bottom: clamp(2.2rem, 5dvh, 3rem); /* room for the scroll cue */
}
.panel--cover .invite-card { padding: clamp(1.2rem, 3.4dvh, 3.6rem) clamp(1.2rem, 3vw, 3.2rem); }
.panel--cover .card-photo { margin-bottom: clamp(0.5rem, 1.4dvh, 1.5rem); }
.panel--cover .card-photo img { aspect-ratio: auto; height: clamp(64px, min(11dvh, 88px), 170px); }
.panel--cover .card-photo figcaption { padding: 0.3rem 0.5rem; font-size: 0.54rem; }
.panel--cover .crest {
  width: clamp(2.2rem, 5dvh, 3.4rem);
  height: clamp(2.2rem, 5dvh, 3.4rem);
  font-size: clamp(0.9rem, 1.6dvh, 1.15rem);
  margin-bottom: clamp(0.5rem, 1.3dvh, 1.4rem);
}
.panel--cover .card-dateline { margin-bottom: clamp(0.5rem, 1.2dvh, 1.1rem); }
.panel--cover .card-title {
  font-size: clamp(1.45rem, min(4dvh, 27px), 2.7rem);
  margin-bottom: clamp(0.7rem, 1.6dvh, 1.4rem);
}
.panel--cover .guest-greeting { margin-bottom: clamp(0.4rem, 1dvh, 0.9rem); font-size: clamp(0.95rem, min(2.2dvh, 17px), 1.08rem); }
.panel--cover .card-body p {
  font-size: clamp(0.82rem, min(1.9dvh, 14.5px), 1.05rem);
  line-height: 1.55;
  margin-bottom: 0.6em;
}
.panel--cover .card-details { margin-top: clamp(0.8rem, 1.8dvh, 1.6rem); }
.panel--cover .detail-row { padding: 0.32rem 0; }
.panel--cover .detail-row dt { font-size: 0.6rem; padding-top: 0.15rem; }
.panel--cover .detail-row dd { font-size: 0.82rem; line-height: 1.4; }
.panel--cover .card-org { margin-top: clamp(0.7rem, 1.5dvh, 1.6rem); }
.panel--cover .card-cta { margin-top: clamp(0.8rem, 1.7dvh, 1.7rem); }
.panel--cover .cta-btn { padding: 0.72rem 1.35rem; font-size: 0.92rem; }
.panel--cover .cta-ghost { margin-top: clamp(0.5rem, 1.2dvh, 1.4rem); }

/* Element hidden by the JS cover-fit routine (and reusable anywhere):
   trimmed purely to make the cover fit one screen — never removed. */
.panel--cover .fit-hidden { display: none !important; }

/* Height tiers: no-JS baseline compaction. With JS on, the cover-fit
   routine in main.js trims precisely per viewport; these tiers simply
   pre-hide the least important copy on shorter screens. */
@media (max-height: 880px) {
  .panel--cover .card-hint { display: none; }
}
@media (max-height: 800px) {
  .panel--cover .cta-ghost[data-goto="free"],
  .panel--cover .card-photo figcaption { display: none; }
  .panel--cover .card-photo img { height: clamp(56px, 9dvh, 110px); }
}
@media (max-height: 700px) {
  /* The letterhead art is placeholder decoration — on short screens the
     typographic face carries the cover instead. */
  .panel--cover .card-photo,
  .panel--cover .card-body p:nth-of-type(n+2),
  .panel--cover .detail-row.ed-row-address { display: none; }
  .panel--cover .card-title br { display: none; }
  .panel--cover .detail-row dd { font-size: 0.8rem; }
}

/* Last-resort squeeze (toggled by the JS cover-fit routine when even the
   trimmed essentials miss the viewport by a few pixels): shave breathing
   room, never content. */
.panel--cover.cover-squeeze .panel-inner { padding-top: 0.4rem; padding-bottom: 1.5rem; }
.panel--cover.cover-squeeze .invite-card { padding-top: 0.9rem; padding-bottom: 1.1rem; }
.panel--cover.cover-squeeze .card-details { margin-top: 0.5rem; }
.panel--cover.cover-squeeze .detail-row { padding: 0.26rem 0; }
.panel--cover.cover-squeeze .card-org { margin-top: 0.4rem; }
.panel--cover.cover-squeeze .card-cta { margin-top: 0.5rem; }
.panel--cover.cover-squeeze .cta-ghost { margin-top: 0.4rem; }

/* Scroll cue — invites the guest to continue below the cover. Reuses the
   data-goto handler from main.js, so it scrolls just like the tabs. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: max(0.45rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  background: none;
  color: var(--gold);
  cursor: pointer;
  opacity: 0.75;
}
.scroll-cue svg { width: 1.5rem; height: 1.5rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scroll-cue:hover, .scroll-cue:focus-visible { opacity: 1; color: var(--gold-soft); }
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue { animation: cue-bob 2.4s ease-in-out infinite; }
}
@keyframes cue-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(5px); }
}

/* ---------- Details panel ---------- */
.detail-block {
  position: relative;
  max-width: 620px;
  margin: 0 auto 1.6rem;
  border: 1px solid rgba(35, 42, 56, 0.14);
  border-radius: 4px;
  padding: 1.3rem 1.5rem;
  background: linear-gradient(180deg, var(--card), rgba(253, 251, 245, 0.7));
  text-align: left;
}
/* Double hairline plate, matching the invitation card */
.detail-block::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(168, 132, 44, 0.5);
  pointer-events: none;
  border-radius: 2px;
}
.block-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0 0 0.7rem;
  color: var(--gold);
}
.agenda-list { display: grid; gap: 0.9rem; }
.agenda-row { padding-bottom: 0.9rem; border-bottom: 1px dashed var(--line); }
.agenda-row:last-child { padding-bottom: 0; border-bottom: 0; }
.agenda-day {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.agenda-copy { margin: 0; font-size: 0.94rem; line-height: 1.6; color: var(--ink); }
.detail-block p { margin: 0; font-size: 0.95rem; line-height: 1.65; }
.detail-foot {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* ---------- Reply card (RSVP) ---------- */
.reply-card {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--card), var(--paper));
  border: 1px solid rgba(35, 42, 56, 0.14);
  border-radius: 4px;
  box-shadow: 0 26px 60px rgba(35, 42, 56, 0.16);
  padding: clamp(1.8rem, 6vw, 3rem) clamp(1.4rem, 5.5vw, 2.8rem);
  text-align: center;
}
.reply-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(168, 132, 44, 0.45);
  pointer-events: none;
  border-radius: 2px;
}
.reply-title { font-size: clamp(1.7rem, 5.5vw, 2.4rem); margin-bottom: 0.8rem; }
.reply-sub {
  max-width: 460px;
  margin: 0 auto 0.4rem;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--muted);
}

.rsvp-form { margin-top: 1.2rem; text-align: left; }
.form-row { display: grid; gap: 0 1rem; }
.form-row.two { grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.form-group { margin: 0 0 1.05rem; }
.form-group label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.form-group label small { text-transform: none; letter-spacing: 0.02em; font-size: 0.82em; opacity: 0.85; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  color: var(--ink);
  font-size: 0.98rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(122, 116, 104, 0.55); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(168, 132, 44, 0.2);
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A8842C' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}
.form-group textarea { resize: vertical; min-height: 4.2rem; }

.error {
  display: block;
  min-height: 1.05em;
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.3rem;
}

/* Decline-friendly: fields that only matter when attending are softly dimmed */
.form-group.is-muted { opacity: 0.45; }
.attend-hint {
  font-size: 0.8rem;
  color: var(--gold);
  margin: 0.35rem 0 0;
}

.rsvp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
}

/* Loading node — hidden by default; the platform script reveals it while sending */
.loading { display: none; }
.loading[style*="display: block"], .loading[style*="display:block"], .loading.is-visible {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.loading .spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Countdown — visible only when the platform sets an RSVP deadline */
.rsvp-countdown { margin: 1.3rem auto 0; max-width: 400px; }
.countdown-label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
}
.countdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.count-cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.3rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}
.count-cell > span:first-child {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: var(--gold);
  line-height: 1.1;
}
.count-cell > span:last-child {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---------- Guestbook (styles apply to the platform-injected UI) ---------- */
.guestbook-body { max-width: 620px; margin: 0 auto; }
.guestbook-body input[type="text"],
.guestbook-body input[type="email"],
.guestbook-body input[type="tel"],
.guestbook-body textarea,
.guestbook-body .form-control {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  color: var(--ink);
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}
.guestbook-body input:focus, .guestbook-body textarea:focus, .guestbook-body .form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(168, 132, 44, 0.2);
}
.guestbook-body textarea { resize: vertical; min-height: 5rem; }
.guestbook-body button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #FBF8F0;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  margin-top: 0.4rem;
}
.guestbook-body .guestbook-chapta { margin: 0.6rem 0; }
.guestbook-wrap { margin-top: 2rem; display: grid; gap: 0.9rem; }
.guestbook-entry {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  background: rgba(253, 251, 245, 0.8);
  text-align: left;
}
.guestbook-entry h5 {
  font-family: var(--serif);
  font-size: 1.02rem;
  margin: 0 0 0.35rem;
  color: var(--gold);
}
.guestbook-entry p { margin: 0 0 0.4rem; line-height: 1.6; font-size: 0.95rem; }
.guestbook-entry small { color: var(--muted); font-size: 0.76rem; }
.more-guestbook-wrap { text-align: center; margin-top: 1.4rem; }
.more-guestbook-wrap #load-more {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
}
.more-guestbook-wrap #load-more:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- Photos (all optional: letterhead photo + gallery) ---------- */
/* Letterhead photo on the invitation card. Delete the <figure> to hide. */
.card-photo {
  margin: 0 0 clamp(1.3rem, 4vw, 1.8rem);
  border: 1px solid rgba(168, 132, 44, 0.4);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-2);
  text-align: left;
}
.card-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 12 / 5;
  object-fit: cover;
  background: var(--paper-2);
}
.card-photo figcaption {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 0.45rem 0.5rem;
  border-top: 1px solid rgba(35, 42, 56, 0.1);
}

/* Gallery grid — remove the whole <section data-panel="gallery"> to hide */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
  max-width: 880px;
  margin: 0 auto;
}
.photo-cell {
  margin: 0;
  background: var(--card);
  border: 1px solid rgba(35, 42, 56, 0.14);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(35, 42, 56, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.photo-cell:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(35, 42, 56, 0.16); }
.photo-cell a {
  position: relative;
  display: block;
}
.photo-cell a::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: rgba(247, 243, 234, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23232A38' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / 1.1rem no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.photo-cell a:hover::after, .photo-cell a:focus-visible::after { opacity: 1; }

/* Every photo is clickable: the card letterhead and the optional official
   flyer open full-size in the same lightbox as the gallery. */
.card-photo a, .banner-flyer a { position: relative; display: block; }
html.js .card-photo a, html.js .banner-flyer a { cursor: zoom-in; }
.card-photo a::after, .banner-flyer a::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: rgba(247, 243, 234, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23232A38' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / 1.1rem no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card-photo a:hover::after, .card-photo a:focus-visible::after,
.banner-flyer a:hover::after, .banner-flyer a:focus-visible::after { opacity: 1; }
.photo-cell img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--paper-2);
}
.photo-cell figcaption {
  font-size: 0.8rem;
  color: var(--ink);
  padding: 0.6rem 0.75rem 0.7rem;
}
.photo-note {
  max-width: 880px;
  margin: 1.4rem auto 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}
.photo-note code { font-family: var(--mono); font-size: 0.82em; font-style: normal; color: var(--gold); }

/* Lightbox — built by main.js only when gallery photos exist in the DOM */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(19, 23, 31, 0.93);
  padding: 1rem;
  overscroll-behavior: contain;
}
.lightbox.is-open { display: flex; }
body.lb-open { overflow: hidden; }  /* lock the document behind the open lightbox */
.lightbox-figure { max-width: min(960px, 94vw); margin: 0; text-align: center; }
.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  background: #10131A;
}
.lightbox-caption {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: #E9E2D0;
  margin: 0.9rem 0 0;
}
.lightbox-count {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--gold-soft);
}
.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 0;
  background: rgba(247, 243, 234, 0.92);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.lightbox-btn:hover { transform: scale(1.06); background: #FDFBF5; }
.lightbox-btn svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.06); }

/* ---------- Official flyer / banner (optional — .banner-flyer in Details) ---------- */
.banner-flyer {
  max-width: 720px;
  margin: 0 auto clamp(1.6rem, 4vw, 2.2rem);
  border: 1px solid rgba(168, 132, 44, 0.4);
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 10px 26px rgba(35, 42, 56, 0.1);
  text-align: left;
}
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  background: var(--paper-2);
}
.banner-flyer figcaption {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(35, 42, 56, 0.1);
}

/* ---------- Video feature (optional — .film-card in the Gallery) ---------- */
.film-card {
  max-width: 720px;
  margin: 0 auto clamp(1.8rem, 5vw, 2.6rem);
  text-align: center;
}
.film-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--gold);
  margin: 0 0 0.35rem;
}
.film-sub {
  max-width: 520px;
  margin: 0 auto 1.1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}
.film-frame {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid rgba(168, 132, 44, 0.45);
  box-shadow: 0 16px 34px -22px rgba(35, 42, 56, 0.55);
}
.film-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.film-open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(3.2rem, 11vmin, 4.2rem);
  height: clamp(3.2rem, 11vmin, 4.2rem);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  background: radial-gradient(circle at 32% 28%, var(--card), var(--paper) 60%, var(--paper-2));
  border: 1px solid var(--gold-soft);
  box-shadow: 0 12px 28px -12px rgba(35, 42, 56, 0.65);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform 0.2s ease;
}
.film-play svg { width: 1.5rem; height: 1.5rem; margin-left: 0.2rem; }
.film-open:hover .film-play { transform: translate(-50%, -50%) scale(1.08); }
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(19, 23, 31, 0.62);
  color: #F7F3EA;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}
.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  background: var(--paper-2);
}
.film-external {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-soft);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.film-external:hover { color: var(--gold-soft); border-color: var(--gold-soft); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px -12px rgba(35, 42, 56, 0.65), 0 0 0 0 rgba(168, 132, 44, 0.35); }
  50% { box-shadow: 0 12px 28px -12px rgba(35, 42, 56, 0.65), 0 0 0 14px rgba(168, 132, 44, 0); }
}

/* ---------- Free page (optional - title + text + optional photo blocks) ----------
   Repeatable "free blocks": the editor clones .free-block per row and stamps the
   title, text and optional photo. Styled like the Details cards so the page reads
   as part of the same printed-letter invitation. */
.free-blocks {
  display: grid;
  gap: 1.6rem;
  max-width: 620px;
  margin: 0 auto;
}
.free-block {
  position: relative;
  border: 1px solid rgba(35, 42, 56, 0.14);
  border-radius: 4px;
  padding: 1.4rem 1.5rem;
  background: linear-gradient(180deg, var(--card), rgba(253, 251, 245, 0.7));
  text-align: left;
}
/* Double hairline plate, matching the invitation card and detail blocks */
.free-block::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(168, 132, 44, 0.5);
  pointer-events: none;
  border-radius: 2px;
}
.free-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 0 0 0.85rem;
  color: var(--gold);
  overflow-wrap: anywhere;
}
.free-content {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
/* Optional photo slot - the block works fine without it. Clicking opens the
   photo full-size in the lightbox (same pattern as the card letterhead). */
.free-figure {
  margin: 0 0 1rem;
  max-width: 520px;
  border: 1px solid rgba(168, 132, 44, 0.4);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-2);
  text-align: left;
}
.free-figure a { position: relative; display: block; }
html.js .free-figure a { cursor: zoom-in; }
.free-figure a::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: rgba(247, 243, 234, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23232A38' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / 1.1rem no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.free-figure a:hover::after, .free-figure a:focus-visible::after { opacity: 1; }
.free-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-2);
}
.free-cap {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 0.45rem 0.5rem;
  border-top: 1px solid rgba(35, 42, 56, 0.1);
}

/* ---------- Powered-by brand line (full-width footer div, class .powered-by) ----------
   "Powered by Kundangi" - the platform swaps the brand name at render and the
   "Free Powered By" editor field replaces the whole line. Full-width strip pinned
   above the bottom tab bar in the JS shell (desktop: flush at the bottom); a
   plain closing bar at the end of the stacked document without JS. */
.powered-by {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  text-align: center;
  padding: 0.22rem 0.75rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(247, 243, 234, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.powered-by .link-footer {
  font-family: var(--serif);
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--gold);
}
@media (min-width: 860px) {
  .powered-by { bottom: 0; } /* single rule keeps it flush on every viewport */
}
html:not(.js) .powered-by { position: static; }

/* ---------- Brand footer (placeholder) ----------
   No-JS: a plain closing line at the end of the stacked document. JS shell:
   hidden where it starts (after </main>), then initFooter() tucks it into the
   last existing panel so it reads as the closing line — even when the RSVP or
   Guestbook panel is stripped. */
html:not(.js) .app-footer { display: block; padding: 1.2rem 1rem 2.4rem; text-align: center; }
html.js .app-footer { display: none; }
html.js .panel .app-footer {
  display: block;
  margin-top: clamp(1.8rem, 5vw, 2.8rem);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-brand {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-brand-name {
  font-family: var(--serif);
  font-size: 1.25em;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--gold);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print: every panel prints as its own page ---------- */
@page { margin: 14mm; }
@media print {
  html, body { height: auto; background: #fff; }
  .js .app-shell, .js .stage { height: auto; overflow: visible; }
  .js .panel { display: block !important; overflow: visible; height: auto; }
  .panel--cover {
    display: block;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
  .panel--cover .panel-inner { margin: 0 auto; }
  .panel--cover .card-photo img { height: auto; aspect-ratio: 12 / 5; }
  /* restore everything the height tiers / fit routine hid on screen */
  .panel--cover .card-body p,
  .panel--cover .cta-ghost[data-goto="free"],
  .panel--cover .card-hint { display: block !important; }
  .panel--cover .detail-row.ed-row-address { display: flex !important; }
  .panel--cover .card-photo { display: block !important; }
  .panel--cover .crest { display: inline-grid !important; }
  .scroll-cue { display: none !important; }
  .app-header, .nav-burger, .mobile-menu, .menu-backdrop, .topnav, .card-hint, .no-print, .lightbox, .powered-by { display: none !important; }
  .film-frame iframe { display: none; } /* a playing video can't print — the poster prints instead */
  .panel { page-break-after: always; break-after: page; }
  .panel:last-child { page-break-after: auto; break-after: auto; }
  .invite-card, .reply-card {
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Guestbook (platform-injected form + message list) ─────────────── */
/* The template's own .form-group / .error / .guestbook-* rules already
   style the injected fields, labels, entries and load-more; this block
   only fills the gaps: the form card shell, the loading text and the
   list divider (overriding the inline border-top on #comments-container). */
#guestbookForm {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: 0 10px 26px rgba(35, 42, 56, 0.08);
}
#guestbookForm .form-control { height: auto; }
.loading-guestbook {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
#comments-container.guestbook-wrap {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
