/* ============================================================
   The Clarity Seminar — Clean/Minimal Seminar FLYER (poster)
   template/creative/html/seminar-clean-flyer-clarity-agenda
   ------------------------------------------------------------
   Design language: a Swiss-grid agenda poster. Warm paper ground,
   near-black ink, one restrained slate-blue accent, hairline rules
   and generous whitespace. Type is an editorial serif display over
   a clean system sans, with mono-spaced datelines. The keyline, the
   ruled agenda table and the meta strip are drawn in CSS, so the
   layout needs no decorative imagery. Photography is an OPTIONAL
   layer: the template ships local SVG placeholders (venue strip,
   speaker portraits, gallery grid) that hosts replace with their own
   photos or remove entirely — nothing hotlinks, nothing can 404.

   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:        #FAFAF7;
  --bg-2:      #F2F1EB;
  --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%; }
/* Robust hidden handling: any element toggled with the hidden attribute
   (photo blocks, countdown, lightbox caption, …) is truly hidden even if
   an author rule sets display on it. */
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, ol { 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(250, 250, 247, 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;
  border-top: 1px solid var(--line);
  background: rgba(250, 250, 247, 0.94);
  backdrop-filter: blur(12px);
  padding: 0.35rem 0.3rem env(safe-area-inset-bottom);
}
.app-tabs .tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.45rem 0.15rem;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  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; }
@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 poster ---------- */
.panel--poster { background: var(--bg); }
.poster-inner { display: flex; flex-direction: column; }

/* Thin accent keyline at the very top — the poster's signature */
.keyline {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  border-radius: 2px;
  margin-bottom: 1.4rem;
}

/* Poster masthead + colophon (mono dateline furniture) */
.masthead {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
  margin: 0 0 clamp(1.6rem, 5vh, 2.6rem);
}
.colophon {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  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.7rem;
  margin: clamp(1.6rem, 5vh, 2.6rem) 0 0;
}

.poster-head { text-align: center; max-width: 680px; margin: 0 auto clamp(1.8rem, 5vw, 2.8rem); }

/* Optional cover banner — the event's own official flyer/banner image.
   Sits at the very top of the poster (the cover). Delete the
   <figure class="cover-banner"> block (or add hidden) to hide it. It is a
   real <button>, so clicking opens the original image in the zoomable
   lightbox — guests can confirm the right event at full size. */
.cover-banner {
  max-width: 860px;
  margin: 0 auto clamp(1.6rem, 5vw, 2.4rem);
}
.cover-banner-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: none;
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cover-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(23, 26, 31, 0.14);
}
.cover-banner img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.cover-caption {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ed-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.8rem, 10vw, 6.4rem);
  line-height: 1.0;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}
.ed-title em { font-style: italic; color: var(--accent); font-weight: 500; }

.poster-sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  line-height: 1.7;
}

/* Optional poster photo strip — a quiet letterbox between the title
   and the agenda. Delete the <figure class="poster-photo"> block (or
   add hidden) to hide it; the heading keeps its normal spacing. */
.poster-head:has(+ .poster-photo) { margin-bottom: clamp(1rem, 3vw, 1.6rem); }
.poster-photo {
  display: block;
  max-width: 760px;
  margin: 0 auto clamp(1.8rem, 5vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.poster-photo:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 26, 31, 0.13);
}
.poster-photo .poster-photo-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.poster-photo img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 16 / 5;
  object-fit: cover;
}

/* ---------- Agenda (the poster's hero) ---------- */
.agenda {
  border-top: 2px solid var(--ink);
  max-width: 760px;
  margin: 0 auto;
}
.agenda-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line-strong);
}
.agenda-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.agenda-range {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.agenda-list { list-style: none; margin: 0; padding: 0; }
.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:last-child { border-bottom: 0; }
.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; }
}

/* ---------- Meta strip ---------- */
.meta-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  max-width: 760px;
  margin: clamp(1.6rem, 5vw, 2.4rem) auto 0;
}
@media (min-width: 720px) { .meta-strip { grid-template-columns: repeat(4, 1fr); } }
.meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  /* Swiss grid cell: a single ink keyline opens each column — no box, no
     fill, no accent stripe. Matches the ruled agenda/speakers language. */
  border-top: 2px solid var(--ink);
  padding: 0.7rem 0 0;
  text-align: left;
}
.meta-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta-cell > span:not(.meta-label) { font-size: 0.92rem; font-weight: 600; line-height: 1.35; }
.meta-sub { font-size: 0.78rem !important; font-weight: 400 !important; color: var(--muted); }

/* ---------- Poster CTA ---------- */
.poster-cta {
  text-align: center;
  margin: clamp(1.8rem, 5vw, 2.6rem) auto 0;
}
.poster-hint {
  max-width: 460px;
  margin: 0.9rem auto 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Speakers (clean numbered roster) ---------- */
.speaker-list { max-width: 680px; margin: 0 auto; }
.speaker-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.speaker-row:first-child { border-top: 2px solid var(--ink); padding-top: 1.4rem; }
.speaker-row:last-child { border-bottom: 0; }
.speaker-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 0.25rem;
}
.speaker-meta { min-width: 0; }
.speaker-role {
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.3rem;
}
.speaker-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 0 0 0.25rem;
}
.speaker-mod { font-size: 0.85rem; font-weight: 400; color: var(--muted); font-family: var(--sans); }
.speaker-talk { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.55; margin: 0; }

/* Optional speaker portraits — each one is now a real <button>, so clicking
   opens the portrait in the zoomable lightbox. The grid gains a photo column
   only when a row actually contains a photo (:has), so removing any or all of
   the <button class="speaker-photo-btn"> elements reverts the roster to the
   classic clean list — no layout breaks. */
.speaker-row:has(.speaker-photo) { grid-template-columns: 3rem 5rem 1fr; gap: 1rem; }
.speaker-photo-btn {
  display: block;
  width: 5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: zoom-in;
  align-self: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.speaker-photo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(23, 26, 31, 0.14);
}
.speaker-photo {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
/* When the engine removes an empty optional portrait, the wrapper button
   must not leave a stray bordered box or a focusable dead-end behind —
   :has() is already the pattern the roster grid uses to reflow
   photo-less rows. */
.speaker-photo-btn:not(:has(img)) { display: none; }
@media (max-width: 560px) {
  .speaker-row:has(.speaker-photo) { grid-template-columns: 3rem 4.25rem 1fr; gap: 0.8rem; }
  .speaker-photo-btn { width: 4.25rem; }
}

/* ---------- RSVP ---------- */
.rsvp-inner { max-width: 760px; }
.rsvp-head { max-width: 640px; }
.guest-greeting {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0 0 0.9rem;
}

.rsvp-form { margin-top: clamp(0.6rem, 2vw, 1rem); }
.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-2);
}
.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(--bg);
  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 {
  /* Editorial ruled row — same hairline rhythm as the agenda and speakers
     lists. The accent lives in the title (h5) type, not in a stripe. */
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 1.1rem 0 1.2rem;
  background: none;
}
.guestbook-entry:first-child {
  border-top: 2px solid var(--ink);
  padding-top: 1.3rem;
}
.guestbook-entry:last-child { border-bottom: 0; }
.guestbook-entry h5 {
  font-family: var(--serif);
  font-size: 1.02rem;
  margin: 0 0 0.35rem;
  color: var(--accent);
}
.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); }

/* ---------- Gallery (optional photo panel) ----------
   Tabs are DOM-derived: deleting the <section data-panel="gallery">
   hides the Gallery tab automatically. Each photo is a real <button>
   so the lightbox is keyboard-accessible by default. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: clamp(1rem, 3vw, 1.5rem);
  max-width: 860px;
  margin: 0 auto;
}
.gallery-item { margin: 0; }
.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(23, 26, 31, 0.16);
}
.gallery-photo {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.gallery-item figcaption {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- 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 there are no blocks
   (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. The photo is a real
   <button> like every other photo slot, so it opens the zoomable lightbox;
   :has() keeps the button borderless when the optional photo is empty, so
   an image-less block never shows a broken frame. */
.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-media { margin: 0 auto 1.4rem; max-width: 560px; text-align: center; }
.free-media-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
/* Image-less block: drop the button entirely (it would otherwise stay
   focusable and open an empty lightbox). */
.free-media-btn:not(:has(img)) { display: none; }
.free-media-btn:has(img) {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.free-media-btn:has(img):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(23, 26, 31, 0.16);
}
.free-img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.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;
}

/* ---------- Video (optional panel) ----------
   A quiet 16:9 stage: poster image with a play mark. Clicking opens the
   video in its own viewer dialog. Deleting the <section data-panel="video">
   (or adding hidden) hides both the panel and its tab. The film URL lives on
   the trigger: data-video-src (embed URL or direct file) + data-video-link. */
.video-stage { max-width: 820px; margin: 0 auto; }
.video-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.video-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(23, 26, 31, 0.16);
}
.video-poster {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 4.2rem;
  height: 4.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(250, 250, 247, 0.92);
  color: var(--accent);
  box-shadow: 0 6px 18px rgba(23, 26, 31, 0.28);
  transition: transform 0.25s ease, background 0.25s ease;
}
.video-trigger:hover .video-play { transform: scale(1.06); background: #fff; }
.video-play svg {
  width: 1.5rem; height: 1.5rem;
  fill: currentColor;
  margin-left: 0.2rem;
}
.video-stage figcaption {
  margin: 0.6rem auto 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- Photo viewer (native <dialog> lightbox) ---------- */
.photo-lightbox {
  width: min(94vw, 1040px);
  max-width: none;
  max-height: 90vh;
  border: 0;
  padding: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
}
.photo-lightbox::backdrop {
  background: rgba(18, 21, 26, 0.74);
  backdrop-filter: blur(4px);
}
.lightbox-frame { position: relative; padding: 1.25rem 1.25rem 1rem; }
.lightbox-figure { margin: 0; }
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  margin: 0 auto;
  border-radius: 6px;
  object-fit: contain;
}
.lightbox-caption {
  margin: 0.9rem auto 0;
  max-width: 560px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(250, 250, 247, 0.8);
  text-align: center;
}
.lightbox-original {
  display: block;
  margin: 0.9rem auto 0;
  width: fit-content;
  font-size: 0.85rem;
  color: rgba(250, 250, 247, 0.72);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lightbox-original:hover { color: #fff; }

/* Zoom toggle: fit (whole image) ↔ actual size (1:1, scrollable frame).
   Clicking the zoom button or the image itself toggles. */
.lightbox-zoom {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 250, 247, 0.3);
  border-radius: 50%;
  background: rgba(250, 250, 247, 0.08);
  color: var(--bg);
  cursor: pointer;
}
.lightbox-zoom:hover { background: rgba(250, 250, 247, 0.18); }
.lightbox-zoom svg {
  width: 1.05rem; height: 1.05rem;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.lightbox-img { cursor: zoom-in; }
.photo-lightbox.is-zoomed .lightbox-img { cursor: zoom-out; }
.photo-lightbox.is-zoomed .lightbox-frame {
  overflow: auto;
  max-height: calc(90vh - 0.1px);
}
.photo-lightbox.is-zoomed .lightbox-img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}
.lightbox-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 250, 247, 0.3);
  border-radius: 50%;
  background: rgba(250, 250, 247, 0.08);
  color: var(--bg);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(250, 250, 247, 0.18); }
.photo-lightbox[open] { animation: lightbox-in 0.25s ease; }
@keyframes lightbox-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Video viewer (native <dialog>) ---------- */
.video-lightbox {
  width: min(94vw, 980px);
  max-width: none;
  border: 0;
  padding: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
}
.video-lightbox::backdrop {
  background: rgba(18, 21, 26, 0.74);
  backdrop-filter: blur(4px);
}
.video-frame { position: relative; padding: 1.25rem 1.25rem 1rem; }
.video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}
.video-player iframe,
.video-player video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.video-notice {
  margin: 0;
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(250, 250, 247, 0.82);
}
.video-open {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: rgba(250, 250, 247, 0.72);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.video-open:hover { color: #fff; }
.video-lightbox[open] { animation: lightbox-in 0.25s ease; }

/* ---------- Footer brand placeholder ---------- */
.app-footer { margin: clamp(2.2rem, 6vw, 3.4rem) auto 0; text-align: center; }
.footer-brand {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 1rem 1.4rem 0;
}
.footer-brand em { font-style: normal; color: var(--accent); }

/* ---------- 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(250, 250, 247, 0.94);
  backdrop-filter: blur(12px);
  font-size: 0.56rem;
}
.powered-by .link-footer { 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, .poster-hint, .powered-by, .no-print { display: none !important; }
  .panel { page-break-after: always; break-after: page; }
  .panel:last-child { page-break-after: auto; break-after: auto; }
  .panel--poster { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .photo-lightbox, .video-lightbox { display: none !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ── Guestbook (platform-injected form + message list) ─────────────── */
.guestbook-body .guestbook-form { text-align: left; }

.guestbook-body #guestbookForm {
  padding: clamp(1.4rem, 4vw, 2rem);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.guestbook-body #guestbookForm .form-group { margin: 0 0 1.05rem; }
.guestbook-body #guestbookForm .form-group label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.guestbook-body #guestbookForm .form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.guestbook-body #guestbookForm .form-control::placeholder { color: rgba(118, 124, 134, 0.65); }
.guestbook-body #guestbookForm .form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.guestbook-body #guestbookForm textarea.form-control { resize: vertical; min-height: 4.2rem; }

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

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

/* !important beats Bootstrap .bg-kundangan / .text-white / .px-3 */
.guestbook-body #guestbookForm button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--ink) !important;
  color: var(--bg) !important;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 0.9rem 1.7rem !important;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.guestbook-body #guestbookForm button[type="submit"]:hover { background: var(--accent) !important; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 78, 111, 0.22); }

.guestbook-body .loading-guestbook {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 10px;
}

#comments-container.guestbook-wrap {
  border-top: 1px solid var(--line) !important;
  margin-top: 1.75rem !important;
  max-height: none !important;
  padding-top: 1.25rem;
}

.guestbook-entry {
  padding: 1.1rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.guestbook-entry:last-child { border-bottom: 0; }
.guestbook-entry h5 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.guestbook-entry p {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.guestbook-entry small { font-size: 0.8rem; color: var(--muted); }

.more-guestbook-wrap { text-align: center; margin-top: 1.5rem; }
#load-more {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
#load-more:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
