/* ════════════════════════════════════════════════════════════════════════
   PrimeEvent — public microsite ("Immersive Premium").
   Consumes the per-tenant theme variables injected at <style>:root{…}</style>
   (colors, fonts, radius, btn-*). The :root below are only fallbacks + the
   DERIVED tokens (spacing, fluid type, elevation, motion) that are not
   tenant-tunable. Never hardcode brand colors/fonts — always var(--…).
   ════════════════════════════════════════════════════════════════════════ */
/* Webfont @font-face lives in /static/fonts.css (loaded by public + admin). */
:root {
  /* tenant-overridable fallbacks (the injected :root wins) */
  --maxw: 760px;
  --color-primary: #1d4ed8; --color-on-primary: #fff; --color-bg: #fff;
  --color-surface: #f8fafc; --color-text: #111827; --color-muted: #6b7280;
  --color-link: #1d4ed8; --color-accent: #b45309;
  --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --base-size: 16px; --radius: .5rem;
  --btn-radius: .5rem; --btn-bg: #1d4ed8; --btn-fg: #fff; --btn-border: transparent;

  /* derived (not tenant-tunable) */
  --content-pad: clamp(1rem, 4vw, 2rem);
  /* section rhythm follows the per-tenant theme "density" knob (--section-rhythm) */
  --section-gap: var(--section-rhythm, clamp(2.75rem, 7vw, 5.5rem));
  --fs-sm: .875rem;
  --fs-lg: 1.25rem;
  --fs-2xl: clamp(1.9rem, 4.5vw, 3rem);
  --fs-hero: clamp(2.75rem, 8vw, 5.5rem);
  --shadow-1: 0 1px 2px rgb(0 0 0 / .06), 0 1px 3px rgb(0 0 0 / .10);
  --shadow-2: 0 6px 18px -4px rgb(0 0 0 / .14), 0 3px 8px -4px rgb(0 0 0 / .10);
  --shadow-3: 0 22px 48px -16px rgb(0 0 0 / .30);
  --ring: 0 0 0 3px color-mix(in srgb, var(--color-primary) 38%, transparent);
  --dur: .5s; --dur-fast: .2s; --ease: cubic-bezier(.16, 1, .3, 1);
  --scrim-top: color-mix(in srgb, var(--color-bg) 30%, transparent);
  --scrim-bot: color-mix(in srgb, var(--color-bg) 90%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: var(--base-size); line-height: 1.65;
  overflow-x: hidden; /* let the hero break full-bleed (100vw) without scroll */
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading); line-height: 1.12; letter-spacing: -.02em;
  font-weight: 700; margin: 0 0 .5em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--color-link); text-decoration-thickness: .08em; text-underline-offset: .18em; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* ── Layout: centered content column; hero breaks full-bleed ──────────── */
.site { max-width: var(--maxw); margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem) var(--content-pad); }
.site-header { display: flex; justify-content: center; padding: 1.25rem var(--content-pad) 0; }
.site-logo { max-height: 64px; width: auto; }

.blk { margin: 0 0 var(--section-gap); }
.blk:last-child { margin-bottom: 0; }
.reveal { margin: 0 0 var(--section-gap); }
.reveal > .blk { margin-bottom: 0; }
.reveal:last-child { margin-bottom: 0; }

/* ── Per-element style overrides (editor: size + palette colour + align) ──
   Both size and colour use a custom-property indirection: the utility class sets
   ONLY a variable (--blk-fs / --blk-color) and the target element consumes it with
   a fallback to its own default. This sidesteps the specificity war (a plain
   .txt-* would lose to e.g. ".blk-hero .subtitle") and keeps the default when no
   class is set. Only whitelisted keys ever become classes (cms.TextSizeKeys /
   TextColorKeys), so no user text reaches CSS. */
.fs-s   { --blk-fs: clamp(1.05rem, 2.5vw, 1.3rem); }
.fs-m   { --blk-fs: clamp(1.4rem, 4vw, 1.9rem); }
.fs-l   { --blk-fs: clamp(2rem, 6vw, 3rem); }
.fs-xl  { --blk-fs: clamp(2.6rem, 8vw, 4.5rem); }
.fs-xxl { --blk-fs: clamp(3.25rem, 11vw, 6.5rem); }
.fw-light { --blk-weight: 300; } .fw-normal { --blk-weight: 400; } .fw-medium { --blk-weight: 500; }
.fw-semibold { --blk-weight: 600; } .fw-bold { --blk-weight: 700; } .fw-extrabold { --blk-weight: 800; }
.txt-text { --blk-color: var(--color-text); }
.txt-muted { --blk-color: var(--color-muted); }
.txt-primary { --blk-color: var(--color-primary); }
.txt-accent { --blk-color: var(--color-accent); }
.txt-link { --blk-color: var(--color-link); }

/* ── Heading block (standalone Überschrift) ──────────────────────────── */
.blk-heading-text { font-family: var(--font-heading); font-weight: var(--blk-weight, 700); line-height: 1.2; letter-spacing: -.02em; margin: 0; color: var(--blk-color, inherit); font-size: var(--blk-fs, var(--fs-2xl)); }
.blk-heading-text.lvl-h3 { font-size: var(--blk-fs, var(--fs-lg)); } /* h3 default smaller than h2 */
.blk-heading.al-center { text-align: center; }

/* ── Buttons (premium: lift on hover, focus ring) ────────────────────── */
.btn, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.65rem; border-radius: var(--btn-radius);
  background: var(--btn-bg); color: var(--btn-fg); border: 2px solid var(--btn-border);
  font: inherit; font-weight: 600; font-size: 1.05rem; line-height: 1;
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-2);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), filter var(--dur-fast);
}
.btn:hover, .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); filter: brightness(1.05); text-decoration: none; }
.btn:active, .btn-primary:active { transform: translateY(0); }
.btn:focus-visible, .btn-primary:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-2); }

/* ── Hero (full-bleed) ───────────────────────────────────────────────── */
.blk-hero {
  position: relative; isolation: isolate;
  width: 100vw; margin-left: 50%; transform: translateX(-50%);
  min-height: clamp(28rem, 70vh, 48rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: var(--section-gap) var(--content-pad); overflow: hidden;
  background:
    radial-gradient(130% 120% at 50% 0%, color-mix(in srgb, var(--color-accent) 14%, transparent), transparent 62%),
    linear-gradient(180deg, var(--color-surface), var(--color-bg));
}
.blk-hero:first-child { margin-top: calc(-1 * clamp(1.25rem, 4vw, 2.5rem)); } /* flush to top */
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.blk-hero.has-bg::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--scrim-top), var(--scrim-bot));
}
.hero-inner { max-width: var(--maxw); width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1.15rem; }
.blk-hero h1 { font-size: var(--blk-fs, var(--fs-hero)); font-weight: var(--blk-weight, 700); color: var(--blk-color, inherit); margin: 0; letter-spacing: -.035em; }
.blk-hero .subtitle { font-size: var(--blk-fs, var(--fs-lg)); font-weight: var(--blk-weight, 400); color: var(--blk-color, var(--color-muted)); max-width: 42ch; margin: 0; }
.blk-hero.has-bg .hero-inner { text-shadow: 0 1px 14px color-mix(in srgb, var(--color-bg) 72%, transparent); }
/* per-hero text legibility presets (chosen in the editor; override theme color
   + scrim so text stays readable over any background image) */
.blk-hero.hero-text-light { color: #fff; }
.blk-hero.hero-text-light .subtitle { color: var(--blk-color, rgb(255 255 255 / .88)); }
.blk-hero.hero-text-light.has-bg::after { background: linear-gradient(180deg, rgb(0 0 0 / .30), rgb(0 0 0 / .62)); }
.blk-hero.hero-text-light.has-bg .hero-inner { text-shadow: 0 2px 18px rgb(0 0 0 / .55); }
.blk-hero.hero-text-dark { color: #0f172a; }
.blk-hero.hero-text-dark .subtitle { color: var(--blk-color, rgb(15 23 42 / .72)); }
.blk-hero.hero-text-dark.has-bg::after { background: linear-gradient(180deg, rgb(255 255 255 / .45), rgb(255 255 255 / .80)); }
.blk-hero.hero-text-dark.has-bg .hero-inner { text-shadow: 0 1px 12px rgb(255 255 255 / .7); }
.blk-hero .btn { margin-top: .4rem; }
/* staggered entrance (above the fold → on load) */
.hero-inner > * { animation: rise .9s var(--ease) both; }
.hero-inner > *:nth-child(1) { animation-delay: .05s; }
.hero-inner > *:nth-child(2) { animation-delay: .18s; }
.hero-inner > *:nth-child(3) { animation-delay: .31s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }

/* ── Generic block bits ──────────────────────────────────────────────── */
.subtitle { color: var(--color-muted); }
.note { color: var(--color-muted); font-size: var(--fs-sm); }

/* ── Agenda (timeline) ───────────────────────────────────────────────── */
.agenda { list-style: none; margin: 0; padding: 0; border-left: 2px solid color-mix(in srgb, var(--color-accent) 45%, var(--color-surface)); }
.agenda li { position: relative; display: flex; gap: 1rem; align-items: baseline; padding: .8rem 0 .8rem 1.4rem; }
.agenda li::before {
  content: ""; position: absolute; left: -7px; top: 1.15rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 4px var(--color-bg);
}
.agenda .time { font-weight: 700; color: var(--color-accent); font-variant-numeric: tabular-nums; min-width: 4.5rem; }
.agenda .title { color: var(--color-text); }
/* Optional per-item description wraps to its own line, indented under the title. */
.agenda li { flex-wrap: wrap; }
.agenda .desc { flex-basis: 100%; margin: .25rem 0 0; padding-left: 5.5rem; color: color-mix(in srgb, var(--color-text) 72%, var(--color-surface)); font-size: .95rem; line-height: 1.5; }

/* ── RSVP call-to-action ─────────────────────────────────────────────── */
.blk-cta { text-align: center; }
.blk-cta .btn, .blk-cta .btn-primary { font-size: 1.15rem; padding: 1rem 2.1rem; }
.blk-cta .note { margin-top: .85rem; }

/* ── Countdown (live, Datastar-driven) ───────────────────────────────── */
.blk-countdown { text-align: center; }
.cd-headline { font-family: var(--font-heading); font-size: var(--fs-lg); font-weight: 700; margin: 0 0 1.1rem; }
.cd { display: flex; justify-content: center; gap: clamp(.5rem, 2vw, 1.25rem); flex-wrap: wrap; }
.cd-unit {
  display: flex; flex-direction: column; align-items: center; min-width: 4.75rem;
  padding: 1rem .85rem; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.cd-num { font-family: var(--font-heading); font-weight: 700; font-size: clamp(1.75rem, 5vw, 2.75rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--color-primary); }
.cd-lbl { margin-top: .4rem; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--color-muted); }

/* ── FAQ (styled accordion) ──────────────────────────────────────────── */
.blk-faq { display: flex; flex-direction: column; gap: .65rem; }
.blk-faq details { background: var(--color-surface); border: 1px solid color-mix(in srgb, var(--color-text) 9%, transparent); border-radius: var(--radius); overflow: hidden; }
.blk-faq summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.blk-faq summary::-webkit-details-marker { display: none; }
.blk-faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--color-accent); transition: transform var(--dur-fast) var(--ease); }
.blk-faq details[open] summary::after { transform: rotate(45deg); }
.blk-faq details > p { margin: 0; padding: 0 1.2rem 1.1rem; color: var(--color-muted); }

/* ── Rich text + Image ───────────────────────────────────────────────── */
.blk-richtext { font-size: 1.05rem; }
.blk-richtext h2, .blk-richtext h3 { margin-top: 1.5rem; }
.blk-richtext img { border-radius: var(--radius); margin: 1rem 0; box-shadow: var(--shadow-2); }
.block-image { margin: 0; }
.block-image img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-2); }
.block-image figcaption { margin-top: .6rem; text-align: center; color: var(--color-muted); font-size: var(--fs-sm); }

/* ── Scroll-reveal (Datastar data-on:intersect adds .in) ──────────────── */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ── RSVP form (premium) ─────────────────────────────────────────────── */
.rsvp-form {
  display: flex; flex-direction: column; gap: 1.15rem;
  background: var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.25rem, 4vw, 2rem); box-shadow: var(--shadow-2);
}
.rsvp-form .field { margin: 0; }
.rsvp-form > label, .rsvp-form .field > label { display: block; font-weight: 600; margin-bottom: .4rem; color: var(--color-text); }
.rsvp-form .req { color: var(--color-accent); margin-left: .15rem; }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea {
  width: 100%; padding: .72rem .9rem; min-height: 2.9rem; font: inherit; color: var(--color-text);
  background: var(--color-bg); border: 1.5px solid color-mix(in srgb, var(--color-text) 16%, transparent);
  border-radius: var(--radius); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.rsvp-form textarea { min-height: 6.5rem; resize: vertical; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--ring); }
.rsvp-form select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center; background-size: 1.1rem;
}
/* select_multi rendered as selectable chip-rows */
.rsvp-form .checkbox {
  display: flex; align-items: center; gap: .6rem; font-weight: 400; cursor: pointer; margin-bottom: .45rem;
  padding: .6rem .8rem; background: var(--color-bg);
  border: 1.5px solid color-mix(in srgb, var(--color-text) 14%, transparent); border-radius: var(--radius);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.rsvp-form .checkbox:hover { border-color: var(--color-primary); }
.rsvp-form .checkbox input { width: auto; min-height: 0; accent-color: var(--color-primary); }
.rsvp-form button[type="submit"] { align-self: flex-start; margin-top: .3rem; }
.rsvp-spinner { width: 1.05em; height: 1.05em; border: 2px solid color-mix(in srgb, var(--btn-fg) 35%, transparent); border-top-color: var(--btn-fg); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RSVP Done / Error states ────────────────────────────────────────── */
.error { background: color-mix(in srgb, #dc2626 9%, var(--color-bg)); border: 1px solid color-mix(in srgb, #dc2626 35%, transparent); color: #b91c1c; padding: .75rem .95rem; border-radius: var(--radius); }
.rsvp-done { text-align: center; }
.done-check {
  width: 5rem; height: 5rem; margin: 1.5rem auto; border-radius: 50%; font-size: 2.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--color-primary) 14%, transparent); color: var(--color-primary);
  animation: pop .6s var(--ease) both;
}
.rsvp-done .btn { margin-top: 1rem; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

/* ── Error page (ADR 0040) ───────────────────────────────────────────── */
.site-error { text-align: center; max-width: 34rem; }
.site-error h1 { margin-bottom: .6rem; }
.site-error .lead { color: color-mix(in srgb, var(--color-text) 72%, transparent); }
.error-ref { margin-top: 2rem; font-size: .85rem; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.error-ref code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-inner > * { animation: none; }
}

/* ── Small screens ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .blk-hero { min-height: 56vh; }
  .agenda .time { min-width: auto; }
  .agenda .desc { padding-left: 0; }
}
