/* Event-Galerie — Gast-Ansicht.
   Eigenes Erscheinungsbild, bewusst nichts aus den Senti-Vini-Werkzeugen:
   das hier sehen Gäste einer privaten Feier, nicht Mitarbeiter.

   Die Akzentfarben kommen pro Event aus theme_json und werden zur Laufzeit
   auf :root gesetzt — die Werte hier sind nur der Rückfall. */

:root {
  --papier:   #faf7f2;
  --papier-2: #f2ede4;
  --flaeche:  #ffffff;
  --tinte:    #23201c;
  --tinte-2:  #5d574e;
  --leise:    #8c857a;
  --linie:    #e4ddd1;
  --akzent:   #8a7a5c;
  --akzent-2: #6f6248;
  --warnung:  #b4453a;
  --dunkel:   #17140f;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--tinte);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Zugang */

.tor {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--papier);
}
/* [hidden] muss display:flex schlagen — sonst bleibt das Tor sichtbar.
   Genau diese Falle hat in der Vorgänger-Instanz Zeit gekostet. */
.tor[hidden] { display: none; }
.tor-karte { max-width: 380px; width: 100%; text-align: center; }
.tor-karte h1 { font-family: var(--serif); font-size: 34px; font-weight: 500; margin: 0 0 8px; }
.tor-karte p { color: var(--tinte-2); margin: 0 0 20px; }
.tor input {
  width: 100%; padding: 14px 16px; text-align: center;
  border: 1px solid var(--linie); border-radius: 10px;
  background: var(--flaeche); letter-spacing: .04em;
}
.tor-fehler { color: var(--warnung); font-size: 14px; margin-top: 12px; min-height: 20px; }

/* ---------------------------------------------------------------- Kopf */

.kopf {
  position: relative; height: 62vh; min-height: 340px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
  /* Solange kein Titelbild gesetzt ist, ein ruhiger Verlauf in der Akzentfarbe
     statt einer grauen Fläche — die meisten Events starten ohne Bild. */
  background: linear-gradient(155deg, var(--akzent) 0%, var(--tinte) 100%);
}
.kopf-bild { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kopf::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.06) 0%, rgba(0,0,0,.42) 100%);
}
.kopf-text { position: relative; z-index: 1; text-align: center; color: #fff; padding: 0 24px 44px; }
.kopf-datum {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  opacity: .9; margin-bottom: 10px;
}
.kopf-text h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(38px, 11vw, 68px); line-height: 1.05; margin: 0;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.kopf-unter { font-family: var(--serif); font-size: clamp(17px, 4.5vw, 21px); opacity: .95; margin-top: 10px; }

/* ---------------------------------------------------------------- Mitmachen */

.mitmachen { max-width: 640px; margin: 0 auto; padding: 40px 20px 8px; text-align: center; }
.mitmachen h2 { font-family: var(--serif); font-size: 27px; font-weight: 500; margin: 0 0 10px; }
.mitmachen p { color: var(--tinte-2); margin: 0 0 18px; }

.schalter {
  background: none; border: 1px solid var(--linie); border-radius: 999px;
  padding: 10px 20px; color: var(--tinte-2); font-size: 14px;
}
.schalter:hover { border-color: var(--akzent); color: var(--akzent); }

.feld {
  width: 100%; padding: 13px 15px; margin-bottom: 12px;
  border: 1px solid var(--linie); border-radius: 10px; background: var(--flaeche);
}
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 15px 22px; border: 0; border-radius: 10px;
  background: var(--akzent); color: #fff; font-size: 16px; font-weight: 500;
}
.knopf:hover { background: var(--akzent-2); }
.knopf:disabled { opacity: .5; }
.knopf-still { background: none; border: 1px solid var(--linie); color: var(--tinte-2); }
.knopf-still:hover { background: var(--papier-2); }

.wahl {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  flex-wrap: wrap; margin-top: 12px; font-size: 14.5px; color: var(--tinte-2);
}
.wahl select { padding: 9px 12px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); }
.stand { min-height: 22px; margin-top: 12px; font-size: 14px; color: var(--tinte-2); }
.stand.fehler { color: var(--warnung); }

/* ---------------------------------------------------------------- Galerie */

.galerie-kopf {
  max-width: 1280px; margin: 34px auto 0; padding: 0 14px;
  display: flex; align-items: baseline; gap: 12px;
}
.galerie-kopf h2 { font-family: var(--serif); font-size: 27px; font-weight: 500; margin: 0; }
.anzahl { color: var(--leise); font-size: 14px; }

.reiter {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 14px 4px;
  max-width: 1280px; margin: 0 auto; scrollbar-width: none;
}
.reiter::-webkit-scrollbar { display: none; }
.reiter button {
  flex: 0 0 auto; padding: 9px 17px; border-radius: 999px;
  border: 1px solid var(--linie); background: var(--flaeche);
  color: var(--tinte-2); font-size: 14.5px; white-space: nowrap;
}
.reiter button.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }

.kontext { max-width: 1280px; margin: 0 auto; padding: 10px 14px 0; color: var(--leise); font-size: 14px; }

.abschnitt {
  max-width: 1280px; margin: 26px auto 10px; padding: 0 14px;
  font-family: var(--serif); font-size: 21px; color: var(--tinte-2);
}
.abschnitt span { color: var(--leise); font-family: var(--sans); font-size: 13px; margin-left: 8px; }

/* Masonry: Flex-Spalten, gefüllt von JavaScript. CSS column-count kann das
   nicht — es füllt spaltenweise, dadurch läuft die Zeitfolge erst die linke
   Spalte hinunter und dann die rechte. Die Bilder müssen aber über die Zeilen
   hinweg chronologisch liegen. */
.raster { display: flex; gap: 8px; max-width: 1280px; margin: 0 auto; padding: 0 14px; align-items: flex-start; }
.spalte { flex: 1 1 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.kachel {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  border-radius: 6px; overflow: hidden; background: var(--papier-2); line-height: 0;
}
.kachel img { width: 100%; height: auto; display: block; }
.kachel-name {
  position: absolute; left: 7px; bottom: 7px;
  background: rgba(0,0,0,.52); color: #fff; font-size: 11.5px;
  padding: 3px 8px; border-radius: 999px; line-height: 1.4;
  max-width: calc(100% - 14px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kachel-video {
  position: absolute; top: 7px; right: 7px;
  background: rgba(0,0,0,.52); color: #fff; font-size: 11px;
  padding: 3px 8px; border-radius: 999px; line-height: 1.4;
}
.leer { text-align: center; color: var(--leise); padding: 60px 20px; }

/* ---------------------------------------------------------------- Lichtkasten */

/* height:100dvh statt inset:0 — auf iOS schnitt inset:0 die Bedienleiste unter
   der Browserleiste ab und die Galerie schien durch. Solider Hintergrund und
   overflow:hidden gehören zum selben Fund. */
.licht {
  position: fixed; top: 0; left: 0; right: 0; height: 100dvh; z-index: 70;
  background: var(--dunkel); overflow: hidden;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
}
.licht[hidden] { display: none; }
.licht-buehne { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.licht-buehne img, .licht-buehne video { max-width: 100%; max-height: 100%; object-fit: contain; }

.licht-zu, .licht-nav {
  position: absolute; z-index: 2; background: rgba(255,255,255,.12); color: #fff;
  border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 20px; line-height: 1;
}
.licht-zu { top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; }
.licht-nav { top: 50%; transform: translateY(-50%); }
.licht-nav.zurueck { left: 10px; }
.licht-nav.weiter { right: 10px; }

.licht-leiste {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  color: #cfc7ba; font-size: 14px; background: rgba(0,0,0,.3);
}
.licht-meta { flex: 1; min-width: 0; }
.licht-leiste button, .licht-leiste a {
  background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 14px; font-size: 14px; text-decoration: none;
}
.licht-leiste .gefahr { background: rgba(180,69,58,.9); }
.licht-nachricht { padding: 0 18px 12px; color: #e8e2d8; font-size: 15px; }

/* ---------------------------------------------------------------- Fuß */

.fuss { text-align: center; color: var(--leise); font-size: 13.5px; padding: 52px 20px 40px; }
.fuss .herz { color: var(--akzent); }

@media (min-width: 720px) {
  .mitmachen { padding-top: 52px; }
  .raster, .reiter, .galerie-kopf, .abschnitt, .kontext { padding-left: 24px; padding-right: 24px; }
}
