/* ==========================================================================
   feier.css — gemeinsames Gerüst aller Vorlagen der Kollektion.

   Jede Vorlage setzt in ihrer stil.css nur Variablen und ihre eigene
   Öffnung. Hier steht, was überall gleich FUNKTIONIERT, nicht wie es
   aussieht: Abstände, Countdown, Knöpfe, Formular, Blütenregen.

   Variablen (alle in :root der Vorlage):
     --seite                  Seitenfarbe
   Bilder (Papierkachel auf body, Kartenbild auf .karte-bild) setzt die
   stil.css der Vorlage SELBST mit url(): eine url() in einer Variable würde
   relativ zu DIESER Datei aufgelöst (_engine/), nicht zur Vorlage.
     --tinte --text --leise   Überschriften, Fließtext, Nebentext
     --akzent --linie         Kleine Versal-Labels, Haarlinien (nur Deko)
     --knopf --knopf-text     Gefüllter Knopf
     --f-display --f-text --f-label --f-script
     --ratio                  Seitenverhältnis der Karte
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--seite);
  background-size: 420px 420px;
  color: var(--text);
  font-family: var(--f-text);
  font-size: var(--grund, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a, button, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--tinte); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bis zum Öffnen steht die Seite still: nur die Hülle ist zu sehen. */
html.zu, html.zu body { overflow: hidden; height: 100%; }

/* --------------------------------------------------------------- Kopfleiste */
.leiste {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 70;
  display: flex; gap: 8px;
}
.leiste button {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 6px 20px -8px rgba(0, 0, 0, 0.25);
  font-family: var(--f-label); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--tinte); cursor: pointer;
}
.leiste svg { width: 18px; height: 18px; }

.muster-pill {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 70;
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px;
  border-radius: 999px; background: rgba(29, 29, 31, 0.78); color: #fff; text-decoration: none;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font: 500 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; letter-spacing: -0.01em;
}
.muster-pill span { opacity: 0.7; font-weight: 400; }
.eingebettet .muster-pill { display: none; }

/* ------------------------------------------------------------------- Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 72px 14px 40px;
}
.karte {
  position: relative;
  width: min(100%, var(--karte-max, 560px), calc((100svh - 120px) * var(--ratio)));
  aspect-ratio: var(--ratio);
  container-type: inline-size;
}
.innen { position: absolute; inset: 0; }
.karte-bild {
  position: absolute; inset: 0;
  background: center / 100% 100% no-repeat;
  filter: drop-shadow(0 30px 40px rgba(var(--schatten, 60, 40, 30), 0.18)) drop-shadow(0 4px 8px rgba(var(--schatten, 60, 40, 30), 0.12));
}
.karte-inhalt {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--tinte);
}
.weiter {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; color: var(--leise);
  opacity: 0; transition: opacity 0.6s 0.8s;
}
.offen .weiter { opacity: 1; }
.weiter svg { width: 22px; height: 22px; animation: wippen 2.4s ease-in-out infinite; }
@keyframes wippen { 50% { transform: translateY(5px); } }

/* Öffnen-Knopf: liegt unsichtbar über der ganzen Hülle */
.oeffnen {
  position: absolute; inset: 0; z-index: 40; width: 100%; height: 100%;
  border: 0; background: transparent; cursor: pointer;
}
.offen .oeffnen, .oeffnet .oeffnen { display: none; }
.tipp {
  font-family: var(--f-label); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--leise); animation: atmen 2.8s ease-in-out infinite;
}
@keyframes atmen { 50% { opacity: 0.45; } }

/* --------------------------------------------------------------- Abschnitte */
.inhalt { position: relative; padding-bottom: 40px; overflow-x: clip; }
.ab {
  position: relative; max-width: 600px; margin: 0 auto; padding: 64px 22px;
  text-align: center;
}
.ab + .ab { padding-top: 24px; }
.ab-kopf { margin: 0 0 28px; }
.ab-label {
  display: block; font-family: var(--f-label); font-size: 12px; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--akzent);
}
.ab-titel {
  margin: 10px 0 0; font-family: var(--f-display); font-weight: var(--display-gewicht, 400);
  font-size: clamp(32px, 9vw, 44px); line-height: 1.1; color: var(--tinte); letter-spacing: var(--display-lauf, 0);
}
.ab p { margin: 0 auto; max-width: 34em; }
.ab .leise { color: var(--leise); }
.trenner { display: flex; justify-content: center; margin: 8px auto; color: var(--linie); }
.trenner img { width: min(220px, 60vw); height: auto; }

/* Einblenden beim Scrollen — nur mit JS (Klasse js), sonst sofort sichtbar */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); }
.js .rv.da { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ Knöpfe */
.knopf, .knopf-linie {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--rund, 999px);
  font-family: var(--f-label); font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: transform 0.15s, background-color 0.2s, border-color 0.2s;
}
.knopf { border: 0; background: var(--knopf); color: var(--knopf-text); }
.knopf-linie { border: 1px solid var(--linie-stark, var(--linie)); background: transparent; color: var(--tinte); }
.knopf:active, .knopf-linie:active { transform: scale(0.97); }
.knopf svg, .knopf-linie svg { width: 17px; height: 17px; flex: none; }
.knopf-reihe { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* --------------------------------------------------------------- Countdown */
.cd { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 420px; margin: 0 auto; }
.cd > div { display: flex; flex-direction: column; align-items: center; padding: 0 4px; }
.cd > div + div { border-left: 1px solid var(--linie); }
.cd b {
  font-family: var(--f-display); font-weight: var(--zahl-gewicht, 300); font-size: clamp(34px, 10vw, 46px);
  line-height: 1.1; color: var(--tinte); font-variant-numeric: lining-nums tabular-nums;
}
.cd small { margin-top: 6px; font-family: var(--f-label); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--leise); }
.heute { font-family: var(--f-display); font-size: 30px; color: var(--tinte); }

/* --------------------------------------------------------------- Programm */
.zeitleiste { list-style: none; margin: 0 auto; padding: 0; max-width: 400px; text-align: left; }
.zeitleiste li { position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 18px; padding: 0 0 26px; }
.zeitleiste li::before {
  content: ""; position: absolute; left: 82px; top: 10px; bottom: -6px; width: 1px; background: var(--linie);
}
.zeitleiste li:last-child::before { display: none; }
.zeitleiste li::after {
  content: ""; position: absolute; left: 79px; top: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--seite); box-shadow: 0 0 0 1px var(--akzent);
}
.zeitleiste time { font-family: var(--f-display); font-size: 22px; line-height: 1.2; color: var(--tinte); text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.zeitleiste strong { display: block; padding-left: 12px; font-weight: 500; color: var(--tinte); line-height: 1.35; }
.zeitleiste span { display: block; padding-left: 12px; color: var(--leise); font-size: 0.9em; }

/* Menükarte: Zeit rechts, gepunktete Führungslinie */
.menu { list-style: none; margin: 0 auto; padding: 0; max-width: 420px; }
.menu li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; text-align: left; }
.menu li strong { font-weight: 400; color: var(--tinte); }
.menu li i { flex: 1; border-bottom: 1px dotted var(--linie-stark, var(--linie)); transform: translateY(-5px); }
.menu li time { font-family: var(--f-display); color: var(--tinte); font-variant-numeric: lining-nums tabular-nums; }
.menu li span { display: block; font-size: 0.85em; color: var(--leise); }

/* Kacheln: zwei Spalten */
.kacheln { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 460px; }
.kacheln li { padding: 18px 14px; border-radius: 14px; background: var(--flaeche, rgba(255,255,255,.45)); border: 1px solid var(--linie); }
.kacheln time { display: block; font-family: var(--f-display); font-size: 26px; color: var(--tinte); line-height: 1.1; }
.kacheln strong { display: block; margin-top: 6px; font-weight: 500; color: var(--tinte); line-height: 1.3; }
.kacheln span { display: block; margin-top: 2px; color: var(--leise); font-size: 0.85em; }

/* ------------------------------------------------------------------- Orte */
.orte { display: grid; gap: 14px; }
.ort {
  padding: 26px 20px 22px; border-radius: var(--ecke, 18px);
  background: var(--flaeche, rgba(255, 255, 255, 0.5)); border: 1px solid var(--linie);
}
.ort .ab-label { margin-bottom: 8px; }
.ort h3 { margin: 0; font-family: var(--f-display); font-weight: var(--display-gewicht, 400); font-size: 26px; line-height: 1.2; color: var(--tinte); }
.ort .zeit { margin-top: 4px; color: var(--tinte); }
.ort address { margin-top: 10px; font-style: normal; color: var(--leise); line-height: 1.5; }
.ort .hinweis { margin-top: 8px; font-size: 0.88em; color: var(--leise); font-style: italic; }
.ort .knopf-reihe { margin-top: 16px; }

/* -------------------------------------------------------------- Dresscode */
.farben { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 22px; }
.farben figure { margin: 0; display: grid; justify-items: center; gap: 8px; }
.farben span { width: 48px; height: 48px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08), 0 4px 10px -4px rgba(0,0,0,0.25); }
.farben figcaption { font-size: 13px; color: var(--leise); }

/* ------------------------------------------------------------------ Zusage */
.zusage { max-width: 420px; margin: 0 auto; display: grid; gap: 14px; text-align: left; }
.wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wahl button {
  min-height: 52px; border-radius: 12px; border: 1px solid var(--linie-stark, var(--linie));
  background: transparent; color: var(--tinte); cursor: pointer; font-size: 16px;
}
.wahl button[aria-checked="true"] { background: var(--knopf); border-color: var(--knopf); color: var(--knopf-text); }
.feld { display: grid; gap: 6px; }
.feld > span { font-family: var(--f-label); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--leise); }
.feld input, .feld textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; font-size: 17px;
  border: 1px solid var(--linie-stark, var(--linie)); background: rgba(255, 255, 255, 0.7); color: var(--tinte);
}
.feld textarea { min-height: 84px; resize: vertical; }
.feld input:focus, .feld textarea:focus { outline: 2px solid var(--tinte); outline-offset: 1px; }
.anzahl { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.anzahl > div { display: flex; align-items: center; gap: 6px; }
.anzahl button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linie-stark, var(--linie));
  background: transparent; color: var(--tinte); font-size: 22px; line-height: 1; cursor: pointer;
}
.anzahl output { min-width: 40px; text-align: center; font-family: var(--f-display); font-size: 26px; color: var(--tinte); }
.fehler { color: #9b2c2c; font-size: 14px; margin: -6px 0 0; }
.zusage .knopf { width: 100%; }
.klein { font-size: 13px; color: var(--leise); text-align: center; line-height: 1.5; }

/* ---------------------------------------------------------------------- FAQ */
.fragen { max-width: 480px; margin: 0 auto; text-align: left; border-top: 1px solid var(--linie); }
.fragen details { border-bottom: 1px solid var(--linie); }
.fragen summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 14px 2px; cursor: pointer; list-style: none; color: var(--tinte);
}
.fragen summary::-webkit-details-marker { display: none; }
.fragen summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid var(--linie); color: var(--akzent); transition: transform 0.25s;
}
.fragen details[open] summary::after { transform: rotate(45deg); }
.fragen details p { margin: 0 0 18px; padding-right: 36px; color: var(--leise); }

/* ----------------------------------------------------------------- Kontakt */
.kontakte { display: grid; gap: 12px; max-width: 420px; margin: 0 auto; }
.kontakt { padding: 18px; border-radius: var(--ecke, 18px); border: 1px solid var(--linie); background: var(--flaeche, rgba(255,255,255,.45)); }
.kontakt strong { display: block; color: var(--tinte); font-weight: 500; }
.kontakt .knopf-reihe { margin-top: 12px; }

/* ------------------------------------------------------------------- Zitat */
.zitat { margin: 0 auto; max-width: 30em; font-family: var(--f-display); font-style: italic; font-size: 22px; line-height: 1.5; color: var(--tinte); }
.zitat footer { margin-top: 12px; font-family: var(--f-label); font-style: normal; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--leise); }

/* ---------------------------------------------------- Anfrage (nur Muster) */
.muster-ende {
  max-width: 560px; margin: 24px auto 0; padding: 34px 24px 30px; border-radius: 26px; text-align: center;
  background: rgba(255, 255, 255, 0.82); color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; letter-spacing: -0.01em;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.35);
}
.muster-ende p { margin: 0; color: #515154; font-size: 16px; line-height: 1.45; }
.muster-ende h2 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.muster-ende .reihe { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 20px; }
.muster-ende a.blau {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: #0071e3; color: #fff; text-decoration: none; font-size: 16px;
}
.muster-ende a.link { display: inline-flex; align-items: center; min-height: 44px; color: #0066cc; text-decoration: none; font-size: 16px; }
.eingebettet .muster-ende { display: none; }

/* --------------------------------------------------------------- Fußzeile */
.fuss { padding: 30px 20px calc(30px + env(safe-area-inset-bottom)); text-align: center; color: var(--leise); font-size: 13px; }
.fuss a { color: inherit; text-underline-offset: 3px; }
.fuss .studio { font-family: var(--f-label); letter-spacing: 0.18em; text-transform: uppercase; font-size: 11px; }
.fuss nav { display: flex; justify-content: center; gap: 18px; margin-top: 6px; }
.fuss nav a { display: inline-flex; min-height: 44px; align-items: center; }

/* ------------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 90;
  width: min(92vw, 420px); padding: 14px 18px; border-radius: 16px;
  background: rgba(29, 29, 31, 0.92); color: #fff; white-space: pre-line;
  font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), visibility 0s 0.35s;
}
.toast.da { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

/* ------------------------------------------------------------ Blütenregen */
.regen { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.regen.vorn { z-index: 60; }
.blatt { position: absolute; top: 0; will-change: transform; animation: fallen linear infinite; }
@keyframes fallen {
  0% { transform: translate3d(0, -14vh, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift), 114vh, 0) rotate(var(--dreh)); }
}
body.versteckt .blatt { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .regen { display: none; }
}

/* Vorschaubilder (?bild=1): nur Karte und Papier */
.bild .leiste, .bild .weiter, .bild .muster-pill, .bild .regen, .bild .toast { display: none !important; }
.bild .rv { opacity: 1 !important; transform: none !important; transition: none !important; }
.bildkarte, .bildkarte body { background: transparent !important; }
.bildkarte .hero { display: block; min-height: 0; padding: 0; }
.bildkarte .karte { width: 100vw !important; }
.bildkarte .karte-bild, .bildkarte .ef-vorn { filter: none !important; }
.bildkarte .inhalt, .bildkarte .fuss, .bildkarte .tipp { display: none !important; }
