/* ============================================================
   The Clarity Seminar — Clean/Minimal Seminar CARD (invitation)
   template/creative/html/seminar-clean-card-clarity-invitation
   ------------------------------------------------------------
   Design language: a formal letter invitation on a paper card.
   Same palette as the flyer (warm paper, near-black ink, one
   slate-blue accent, hairline rules) but the voice is quiet:
   serif letter body, small-caps mono detail labels, a printed
   "card plate" centred on the page. Everything is CSS-drawn —
   no image files.

   Behaviour:
   - No JS: a normal scrolling page (all panels stacked).
   - JS on: fixed 100dvh shell; exactly one panel visible,
     that panel scrolls internally. Tabs derive from the DOM, so
     removed sections (RSVP/Guestbook off) hide their tabs.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg:        #F4F3ED;
  --card:      #FBFAF6;
  --ink:       #171A1F;
  --ink-soft:  #3F444D;
  --muted:     #767C86;
  --line:      rgba(23, 26, 31, 0.12);
  --line-strong: rgba(23, 26, 31, 0.26);
  --accent:    #1E4E6F;
  --accent-deep: #163A54;
  --accent-soft: rgba(30, 78, 111, 0.09);
  --danger:    #B3261E;
  --ok:        #2E7D5B;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  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, dl, ul { margin-top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(30, 78, 111, 0.18); }

/* ---------- App shell ----------
   No-JS state: a normal document flow, page scrolls.
   JS state (.js on <html>): fixed viewport shell, one active panel. */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.stage { flex: 1 1 auto; position: relative; }
.panel { outline: none; }
.panel-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.6rem) clamp(1rem, 4vw, 1.75rem) clamp(2.4rem, 6vw, 3.5rem);
}

.js .app-shell { height: 100vh; height: 100dvh; overflow: hidden; }
.js .stage { overflow: hidden; }
.js .panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 78, 111, 0.4) transparent;
}
.js .panel.is-active { display: block; }
.js .panel:focus-visible { outline-offset: -2px; }
@media (prefers-reduced-motion: no-preference) {
  .js .panel { scroll-behavior: smooth; }
}

/* ---------- 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: relative;
  z-index: 5;
  background: rgba(244, 243, 237, 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(--accent);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  border-radius: 4px;
}
.brand-name {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-name em { font-style: normal; color: var(--accent); }

/* Desktop pill nav — hidden by default, shown in JS mode at wide widths */
.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(--accent); border-color: var(--accent); }

/* ---------- Bottom tab bar (touch) ---------- */
.app-tabs { display: none; }
.js .app-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-top: 1px solid var(--line);
  background: rgba(244, 243, 237, 0.94);
  backdrop-filter: blur(12px);
  /* Bottom padding stacks the base gap ON TOP of the home-indicator inset —
     env() alone would leave buttons glued to the screen edge on notchless
     phones (inset = 0). */
  padding: 0.35rem 0.3rem calc(0.4rem + env(safe-area-inset-bottom));
}
/* Inner scroll strip holds only the labelled tabs — the ‹ › steppers sit
   outside it, pinned at the bar's edges even when six labels overflow a
   narrow screen: the strip swipes sideways instead of squeezing the
   labels into each other. */
.app-tabs-strip {
  display: flex;
  align-items: stretch;
  gap: clamp(3px, 1.2vw, 8px);
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-tabs-strip::-webkit-scrollbar { display: none; }
.app-tabs .tab-btn {
  flex: 1 0 auto; /* share spare space equally, but never crush a label */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
  padding: 0.45rem 0.55rem;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 10px;
}
.app-tabs .tab-btn svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.app-tabs .tab-btn.is-active { color: var(--accent); }
.tab-btn[hidden] { display: none; }
/* ‹ › steppers flanking the tabs — one section per tap like a carousel.
   Disabled at the ends by main.js; the bar is mobile-only anyway
   (hidden ≥ 860px below), so no extra media query needed here. */
.tab-step {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}
.tab-step:hover:not(:disabled) { color: var(--accent); background: rgba(31, 58, 74, 0.07); }
.tab-step:active:not(:disabled) { transform: scale(0.94); }
.tab-step:disabled { opacity: 0.3; cursor: default; }
.tab-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Very narrow phones: slimmer steppers so the labelled tabs keep
   enough room to stay readable. */
@media (max-width: 400px) {
  .tab-step { width: 34px; height: 34px; font-size: 1.25rem; }
}
@media (min-width: 860px) { .js .app-tabs { display: none; } }

/* ---------- Shared type bits ---------- */
.kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.kicker::before, .kicker::after {
  content: "";
  height: 1px;
  width: 2.4rem;
  background: var(--line-strong);
}

.panel-head { text-align: center; max-width: 680px; margin: 0 auto clamp(1.8rem, 5vw, 2.6rem); }
.panel-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  line-height: 1.08;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.panel-sub { color: var(--ink-soft); font-size: clamp(0.98rem, 2vw, 1.08rem); line-height: 1.65; margin: 0; }

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-btn:hover { background: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 78, 111, 0.22); }
.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; }

/* ---------- The invitation card (printed-card plate) ---------- */
.panel--paper { background: var(--bg); }
.card-inner { display: flex; justify-content: center; flex-wrap: wrap; }

.invite-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.6rem, 5vw, 2.8rem) clamp(1.2rem, 5vw, 2.6rem);
  box-shadow: 0 18px 50px rgba(23, 26, 31, 0.07);
  text-align: center;
}
/* Engraved double rule at the head — a fine-stationery keyline (one accent
   line, one ink hairline) instead of a flat accent bar across the top. */
.invite-card::before {
  content: "";
  position: absolute;
  left: clamp(1.2rem, 5vw, 2.6rem);
  right: clamp(1.2rem, 5vw, 2.6rem);
  top: 14px;
  height: 5px;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--line-strong);
}

.card-dateline {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.6rem;
}

.card-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}

.guest-greeting {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.15rem;
  margin: 0 0 0.9rem;
  text-align: left;
}

/* Letter body — serif, justified-ish, formal but warm */
.card-body {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 2.4vw, 1.12rem);
  line-height: 1.75;
  color: var(--ink-soft);
  text-align: left;
  margin: 0 0 1.8rem;
}
.card-body p { margin: 0 0 1rem; }
.card-body p:last-child { margin-bottom: 0; }
.card-body strong { color: var(--ink); font-weight: 700; }

/* Detail rows — small-caps mono labels, ink values */
.card-details {
  margin: 0 0 1.8rem;
  text-align: left;
  border-top: 1px solid var(--line);
}
.detail-row {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 0.6rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.detail-row dt {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-row dd { margin: 0; font-size: 0.98rem; line-height: 1.5; color: var(--ink); }

/* Programme in brief */
.card-programme {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  background: var(--bg);
  margin: 0 0 1.8rem;
}
.card-programme-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
}
.card-programme-list { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.card-programme-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.card-programme-list li:last-child { border-bottom: 0; }
.card-programme-list li span:first-child { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); padding-top: 0.2rem; white-space: nowrap; }
.card-programme-list li span:last-child { text-align: right; }
.card-programme-note { font-size: 0.82rem; color: var(--muted); margin: 0; font-style: italic; }

/* Signature + CTA */
.card-org {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0 0 1.6rem;
}
.card-cta { margin: 0 0 1.1rem; }
.card-hint { font-size: 0.82rem; color: var(--muted); margin: 0.8rem 0 0; line-height: 1.55; }
.card-contact {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  margin: 1.4rem 0 0;
}

/* ---------- Programme panel (agenda list) ---------- */
.agenda-list { max-width: 680px; margin: 0 auto; }
.agenda-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 0.4rem 1.1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.agenda-row:first-child { border-top: 2px solid var(--ink); }
.agenda-time {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.agenda-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.agenda-title { font-weight: 600; font-size: 1rem; line-height: 1.35; }
.agenda-detail { font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.agenda-place {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  white-space: nowrap;
}
/* On narrow screens the venue pill drops to its own row so long session
   titles keep the full text column. */
@media (max-width: 560px) {
  .agenda-row { grid-template-columns: 64px 1fr; row-gap: 0.45rem; }
  .agenda-place { grid-column: 2; justify-self: start; margin-top: 0.05rem; }
}

.detail-block { max-width: 680px; margin: 1.8rem auto 0; }
.block-title {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.55rem;
}
.detail-block p { color: var(--ink-soft); line-height: 1.65; font-size: 0.98rem; margin: 0; }
.detail-foot {
  max-width: 680px;
  margin: 1.8rem auto 0;
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.6;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}

/* ---------- RSVP ---------- */
.reply-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.6rem, 5vw, 2.6rem) clamp(1.2rem, 5vw, 2.4rem);
  box-shadow: 0 18px 50px rgba(23, 26, 31, 0.07);
}
/* Matching engraved double rule — see .invite-card::before. */
.reply-card::before {
  content: "";
  position: absolute;
  left: clamp(1.2rem, 5vw, 2.4rem);
  right: clamp(1.2rem, 5vw, 2.4rem);
  top: 14px;
  height: 5px;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--line-strong);
}
.reply-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  line-height: 1.1;
  margin: 0 0 0.8rem;
}
.reply-sub { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.65; margin: 0; }

.rsvp-form { margin-top: clamp(1.2rem, 3vw, 1.8rem); }
.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.68rem;
  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: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  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(118, 124, 134, 0.65); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.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='%231E4E6F' 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 select option { color: var(--ink); background: var(--bg); }
.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(--accent);
  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(--accent);
  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.5rem auto 0; max-width: 430px; }
.countdown-label {
  font-size: 0.66rem;
  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: var(--radius);
  padding: 0.7rem 0.3rem;
  text-align: center;
  background: var(--bg);
}
.count-cell > span:first-child {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: var(--accent);
  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: 640px; 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: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  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(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.guestbook-body textarea { resize: vertical; min-height: 5rem; }
.guestbook-body button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: var(--bg);
  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 button[type="submit"]:hover { background: var(--accent); }
.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: var(--card);
}
.guestbook-entry h5 {
  font-family: var(--serif);
  font-size: 1.02rem;
  margin: 0 0 0.35rem;
  color: var(--accent);
}
/* Short accent rule above the name — a section marker, not a heavy side bar. */
.guestbook-entry h5::before {
  content: "";
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 0 0.5rem;
}
.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-strong);
  color: var(--ink-soft);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
}
.more-guestbook-wrap #load-more:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Photos: card accent + gallery panel ---------- */
/* Optional venue photo on the invitation card — a quiet, centred image
   on the letter plate. To hide it, remove the <figure class="venue-photo">
   block from index.html. */
.venue-photo { margin: 0 0 1.8rem; text-align: center; }
.venue-photo img {
  display: inline-block;
  width: min(100%, 420px);
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.venue-photo figcaption {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.6rem auto 0;
}

/* Gallery panel — a calm photo grid. Photos are real <img> tags pointing
   at local placeholder SVGs (assets/img/gallery/), so every slot shows
   something on-brand out of the box and the platform morph can re-point
   any src. To hide the gallery entirely, remove the whole
   <section data-panel="photos"> block — the matching tab then disappears
   by itself (tabs derive from the DOM). */
.gallery-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 3vw, 1.6rem);
}
@media (min-width: 560px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

.gallery-item { margin: 0; }
.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  line-height: 0;
}
.gallery-trigger:focus-visible { outline-offset: 3px; }
.gallery-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-trigger:hover .gallery-img { transform: scale(1.03); }
.gallery-caption {
  margin: 0.55rem 0.1rem 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}
.gallery-foot { max-width: 980px; }

/* Lightbox — opened by main.js when a gallery photo is clicked. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: rgba(16, 18, 22, 0.88);
  backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1100px, 92vw); }
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  background: var(--bg);
}
.lightbox-caption {
  text-align: center;
  color: var(--bg);
  font-size: 0.9rem;
  margin: 0.9rem auto 0;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(244, 243, 237, 0.35);
  background: rgba(23, 26, 31, 0.55);
  color: var(--bg);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.lightbox-close:hover { background: var(--accent); border-color: var(--accent); }
.lightbox-close svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
body.lightbox-open { overflow: hidden; }

/* ---------- Optional flyer / banner (Programme panel) ----------
   A quiet framed slot for hosts who already have a designed flyer or
   poster for the event — display it so guests can confirm they are in
   the right place with the right link. Shown UNCROPPED (object-fit:
   contain) so a portrait poster keeps every line; the paper mat behind
   it keeps odd aspect ratios tidy. Click it to view it full size.
   To hide it, remove the <figure class="banner-flyer"> block. */
.banner-flyer {
  margin: 0 auto clamp(1.8rem, 5vw, 2.6rem);
  max-width: 480px;
  text-align: center;
}
.banner-flyer img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px rgba(23, 26, 31, 0.35);
}
.banner-flyer figcaption {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.6rem auto 0;
}

/* ---------- Optional film feature (video URL embed, Gallery panel) ----------
   A poster + play button that lazy-loads an <iframe> from the URL in
   data-video-url (YouTube / Vimeo / any embeddable URL). Nothing loads
   until the guest taps play — fast, and consent-friendly. To hide it,
   remove the <section class="film-card"> block. */
.film-card {
  max-width: 640px;
  margin: 0 auto clamp(1.8rem, 5vw, 2.6rem);
  text-align: center;
}
.film-card .gallery-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}
.film-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -24px rgba(23, 26, 31, 0.35);
}
.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(56px, 12vw, 72px);
  height: clamp(56px, 12vw, 72px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent-deep);
  box-shadow: 0 12px 28px -12px rgba(23, 26, 31, 0.55);
  animation: film-pulse 2.6s ease-in-out infinite;
  transition: transform 0.2s ease, background 0.2s ease;
}
.film-play svg { width: 26px; height: 26px; margin-left: 3px; }
.film-open:hover .film-play {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--accent-deep);
}
.film-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.film-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(23, 26, 31, 0.62);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.film-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
}
.film-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.film-external:hover { color: var(--accent-deep); border-color: var(--accent); }
.film-external[hidden] { display: none; }
@keyframes film-pulse {
  0%, 100% { box-shadow: 0 12px 28px -12px rgba(23, 26, 31, 0.55), 0 0 0 0 rgba(30, 78, 111, 0.35); }
  50% { box-shadow: 0 12px 28px -12px rgba(23, 26, 31, 0.55), 0 0 0 14px rgba(30, 78, 111, 0); }
}

/* ---------- Clickable photo affordance (venue photo + flyer/banner) ----------
   Any photo that opens the viewer shows a zoom cursor, plus a small
   magnifier badge on hover / keyboard focus. Purely visual — without JS
   (no viewer) it never appears. */
.js .venue-photo, .js .banner-flyer, .js .free-media { position: relative; }
.js .venue-photo { display: inline-block; }  /* hug the image so the badge sits on its corner */
.js .free-media { display: inline-block; }   /* same for the free-page photo */
.js .venue-photo img[data-lightbox], .js .banner-flyer img[data-lightbox], .js .free-media img { cursor: zoom-in; }
.js .venue-photo::after,
.js .banner-flyer::after,
.js .free-media::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(251, 250, 246, 0.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='%231E4E6F' 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 var(--line-strong);
  box-shadow: 0 4px 12px -4px rgba(23, 26, 31, 0.45);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.js .venue-photo:hover::after,
.js .venue-photo:focus-within::after,
.js .banner-flyer:hover::after,
.js .banner-flyer:focus-within::after,
.js .free-media:hover::after,
.js .free-media:focus-within::after {
  opacity: 1;
  transform: none;
}

/* ---------- Free page (optional host-filled panel) ----------
   Repeatable blocks: a title, free text and an OPTIONAL photo. The render
   engine removes the whole .panel-free section when no blocks exist (or
   when the host toggles the Free Page section off), so the tab -- derived
   from the DOM -- disappears with it. The first block reads as the page
   heading; add as many blocks as you need. */
.free-blocks {
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.4rem);
}
.free-block { margin: 0; text-align: center; }
.free-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  line-height: 1.15;
  margin: 0 0 1.2rem;
  color: var(--ink);
  text-wrap: balance;
}
.free-title:focus { outline: none; }
.free-media {
  margin: 0 auto 1.4rem;
  max-width: 560px;
  text-align: center;
}
.free-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.free-content {
  margin: 0 auto;
  max-width: 34em;
  text-align: left;
  font-size: clamp(0.98rem, 2vw, 1.05rem);
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ---------- Powered-by brand strip (full width) ----------
   A slim, full-width line written after </main>: at the end of the stacked
   document without JS, and pinned between the stage and the tab bar in the
   JS shell. The engine swaps the literal brand name inside .link-footer
   for the platform name; the cockpit's Free Powered By field can override
   the whole line. */
.powered-by {
  width: 100%;
  text-align: center;
  padding: 0.9rem 1rem 1.4rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.js .powered-by {
  flex: 0 0 auto;
  padding: 0.4rem 0.9rem;
  background: rgba(244, 243, 237, 0.94);
  backdrop-filter: blur(12px);
  font-size: 0.56rem;
}
.powered-by .link-footer { color: var(--accent); }

/* ---------- 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 invitation's closing line —
   even when RSVP / Guestbook are stripped by the platform. */
.app-footer { padding: 1.4rem 1rem 2.6rem; text-align: center; }
.js .app-footer { display: none; }
.js .panel .app-footer {
  display: block;
  width: 100%;
  flex: 0 0 100%; /* keep the footer on its own full-width line even inside the card-inner flex row */
  margin-top: clamp(1.8rem, 5vw, 2.6rem);
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line);
}
.footer-brand {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-brand-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* ---------- 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: 12mm; }
@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; }
  .app-header, .app-tabs, .topnav, .powered-by, .card-hint, .no-print { display: none !important; }
  .lightbox { 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; }
  .panel--paper { -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 main guestbook styles sit mid-file (see "Guestbook
   (styles apply to the platform-injected UI)"); this trailing block only
   fills the gaps: a form card, input contrast on it, the loading node
   class the platform actually uses, and the message-list inline border
   override. */
.guestbook-form { width: 100%; }

#guestbookForm {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}
#guestbookForm .form-control {
  font-family: var(--sans);
  background: var(--bg); /* keep fields distinct from the form card */
}
#guestbookForm .error:empty { display: none; }

.loading-guestbook {
  display: block;
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: var(--muted);
}

#comments-container.guestbook-wrap {
  border-top: 1px solid var(--line) !important;
  padding-top: 20px;
}
