/* KitaPortal — Oberfläche für Eltern.
   Für Handy gebaut (eine Spalte, große Flächen), am Rechner auf Lesebreite begrenzt.
   Später füllt genau diese Oberfläche die App-Hülle. */

:root {
  --gruen:      #1c6b52;
  --gruen-dunkel:#14503d;
  --hinter:     #f2f7f4;
  --karte:      #ffffff;
  --rand:       #dbe8e2;
  --text:       #14342a;
  --text-leise: #5b7268;
  --rot:        #b3261e;
  --gelb:       #fff6e5;
  --gelb-rand:  #f0c479;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--hinter);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ─── Kopf und Fuß ─────────────────────────────────────────────────────── */
header.kopf {
  background: var(--gruen);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
header.kopf .titel { font-weight: 700; font-size: 17px; flex: 1; }
header.kopf button {
  background: rgba(255,255,255,.16); border: 0; color: #fff;
  border-radius: 9px; padding: 7px 11px; font-size: 14px; cursor: pointer;
}
header.kopf button:hover { background: rgba(255,255,255,.28); }
header.kopf .zurueck { font-size: 20px; line-height: 1; padding: 4px 10px; }

main { max-width: 680px; margin: 0 auto; padding: 14px 16px 80px; }

nav.leiste {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--karte); border-top: 1px solid var(--rand);
  display: flex; justify-content: space-around;
  padding: 6px 4px 8px;
}
nav.leiste a {
  flex: 1; text-align: center; text-decoration: none; color: var(--text-leise);
  font-size: 11.5px; padding: 4px 2px; border-radius: 10px;
}
nav.leiste a .zeichen { display: block; font-size: 21px; line-height: 1.2; }
nav.leiste a.aktiv { color: var(--gruen); font-weight: 700; background: #eef5f1; }
nav.leiste a .punkt {
  display: inline-block; min-width: 17px; padding: 0 4px; margin-left: 3px;
  background: var(--rot); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700;
}

/* ─── Bausteine ────────────────────────────────────────────────────────── */
.karte {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 12px;
}
.karte.klickbar { cursor: pointer; }
.karte.klickbar:hover { border-color: #9dc0b2; }
h1 { font-size: 21px; margin: 4px 0 14px; }
h2 { font-size: 16px; margin: 18px 0 8px; color: var(--text-leise); text-transform: uppercase; letter-spacing: .03em; }
h3 { font-size: 17px; margin: 0 0 6px; }
p  { margin: 0 0 10px; }
.leise { color: var(--text-leise); font-size: 14px; }
.klein { font-size: 13px; }

.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kachel {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 14px;
  padding: 14px 12px; text-align: center; text-decoration: none; color: var(--text);
  position: relative;
}
.kachel:hover { border-color: #9dc0b2; }
.kachel .zeichen { font-size: 26px; display: block; margin-bottom: 4px; }
.kachel .name { font-weight: 600; font-size: 14.5px; }
.kachel .punkt {
  position: absolute; top: 8px; right: 10px; background: var(--rot); color: #fff;
  border-radius: 9px; min-width: 20px; padding: 1px 5px; font-size: 12px; font-weight: 700;
}

.zeile { display: flex; gap: 12px; align-items: flex-start; }
.zeile + .zeile { border-top: 1px solid var(--rand); padding-top: 12px; margin-top: 12px; }
.zeile .inhalt { flex: 1; min-width: 0; }
.zeile .titelzeile { font-weight: 600; }
.zeile .datum { color: var(--text-leise); font-size: 13.5px; }
.ungelesen { width: 9px; height: 9px; border-radius: 50%; background: var(--gruen); margin-top: 7px; flex: 0 0 auto; }
.abstand { width: 9px; flex: 0 0 auto; }
/* Speiseplan: das Zeichen der Mahlzeit steht vor der Zeile, dafuer ist
   .abstand mit seinen 9px zu schmal. */
.zeile .zeichen-mz { width: 26px; flex: 0 0 auto; text-align: center;
                     font-size: 19px; line-height: 1.25; }
.karte.vergangen { opacity: .6; }
/* Speiseplan: Nachtisch und Getraenk haengen unter dem Gericht derselben
   Mahlzeit – etwas eingerueckt und leiser als die Hauptzeile. */
.zeile .posten { margin-top: 6px; }
.zeile .beigabe { color: var(--text-leise); font-size: 14px; }

.merker { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 2px 7px; }
.merker.wichtig { background: #fde8e6; color: var(--rot); }
.merker.art     { background: #eef5f1; color: var(--gruen-dunkel); }

.knopf {
  display: inline-block; background: var(--gruen); color: #fff; border: 0; border-radius: 11px;
  padding: 12px 18px; font-size: 15.5px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.knopf:hover { background: var(--gruen-dunkel); }
.knopf.weit { display: block; width: 100%; text-align: center; }
.knopf.leise { background: #eef5f1; color: var(--gruen-dunkel); }
.knopf:disabled { opacity: .5; cursor: default; }

.hinweis { background: var(--gelb); border: 1px solid var(--gelb-rand); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.fehler  { background: #fde8e6; border: 1px solid #f1b0ab; color: #8c1d18; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.erfolg  { background: #e6f4ec; border: 1px solid #9ed3b4; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }

label { display: block; font-weight: 600; font-size: 14.5px; margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], textarea, select {
  width: 100%; padding: 12px 13px; font-size: 16px; border: 1px solid #c9d8d1;
  border-radius: 11px; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid var(--gruen); outline-offset: 1px; }

.inhalt-html { line-height: 1.6; }
.inhalt-html h2, .inhalt-html h3 { text-transform: none; letter-spacing: 0; color: var(--text); }
.inhalt-html a { color: var(--gruen-dunkel); }
.inhalt-html ul, .inhalt-html ol { padding-left: 22px; }

/* Anmeldung */
.anmelden { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.anmelden .logo { text-align: center; font-size: 30px; margin-bottom: 6px; }
.anmelden h1 { text-align: center; margin-bottom: 4px; }
.anmelden .leise { text-align: center; margin-bottom: 18px; }
.wechsel { text-align: center; margin-top: 14px; }
.wechsel button { background: none; border: 0; color: var(--gruen-dunkel); text-decoration: underline; cursor: pointer; font-size: 14.5px; }

.laden { text-align: center; color: var(--text-leise); padding: 30px 0; }

@media (min-width: 620px) {
  .kacheln { grid-template-columns: repeat(3, 1fr); }
  nav.leiste { max-width: 680px; margin: 0 auto; border-radius: 16px 16px 0 0; }
}

/* Abstaende, die frueher als style="" im HTML standen. Inline-Stile werden von
   der Inhaltsrichtlinie (style-src 'self') genauso verworfen wie Inline-Skripte. */
.abstand-oben       { margin-top: 16px; }
.abstand-oben-klein { margin: 10px 0 0; }
.abstand-oben-eng   { margin: 8px 0 0; }

/* Anklickbare Zeilen in den Listen: sichtbar anklickbar und mit Tastatur bedienbar. */
.zeile.klickbar { cursor: pointer; border-radius: 8px; }
.zeile.klickbar:hover { background: #f1f7f4; }
.zeile.klickbar:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }

/* ─── Fotos am Speiseplan ──────────────────────────────────────────────────
   Die Miniatur steht links neben dem Posten. Der Platz wird VOR dem Laden
   belegt (fester Rahmen mit Teller-Zeichen), damit die Seite nicht springt,
   wenn das Bild eintrifft. */
.zeile .posten.mit-bild, .zeile div.mit-bild { display: flex; gap: 10px; align-items: flex-start; }
.zeile .posten-text { flex: 1; min-width: 0; }

.bild-platz {
  position: relative; flex: 0 0 auto;
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  background: #e6efea;
  border: 1px solid var(--rand); cursor: zoom-in;
}
.bild-platz:hover  { border-color: #9dc0b2; }
.bild-platz:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }
.bild-platz img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .25s;
}
.bild-platz img.da { opacity: 1; }
/* Lädt ein Bild nicht, bleibt die leere Fläche stehen – aber ohne den
   Eindruck, man könne sie antippen. */
.bild-platz.ohne { cursor: default; }

/* ─── Lichtkasten ────────────────────────────────────────────────────────── */
body.fest { overflow: hidden; }

.lichtkasten {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 26, 20, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.lichtkasten figure { margin: 0; max-width: 100%; text-align: center; }
.lichtkasten img {
  max-width: 92vw; max-height: 74vh; width: auto; height: auto;
  border-radius: 12px; display: block; margin: 0 auto;
  background: #fff;
}
.lichtkasten figcaption { color: #fff; margin-top: 12px; line-height: 1.45; }
.lichtkasten figcaption b { display: block; font-size: 17px; }
.lichtkasten figcaption .klein { display: block; color: #cfe3d9; margin-top: 3px; }
.lichtkasten .lk-laden {
  color: #cfe3d9; padding: 40px 20px; font-size: 14.5px;
}
.lichtkasten .zu {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,255,255,.18); border: 0; color: #fff;
  font-size: 19px; line-height: 1; border-radius: 50%;
  width: 40px; height: 40px; cursor: pointer;
}
.lichtkasten .zu:hover { background: rgba(255,255,255,.32); }

/* Überschrift je Kategorie im Speiseplan („Hauptgericht", „Nachtisch", „Getränk").
   Sie erscheint nur, wenn es etwas zu unterscheiden gibt — und damit nie über
   einer leeren Stelle, denn die steht gar nicht erst in der Antwort. */
.zeile .kat-titel {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-leise); margin: 12px 0 2px;
}
.zeile .datum + .kat-titel { margin-top: 6px; }
/* Mit Überschrift braucht der Posten darunter keinen eigenen Abstand mehr. */
.zeile .kat-titel + .posten { margin-top: 0; }

/* ─── Bild einer Mitteilung ───────────────────────────────────────────────
   Gross ueber dem Text: Bei einer Einladung ist oft das Bild die eigentliche
   Mitteilung. In der Liste nur als schmale Vorschau, damit zehn Mitteilungen
   nicht zu zehn Bildschirmseiten werden. */
.news-bild {
  margin: 10px 0 12px; border-radius: 12px; overflow: hidden;
  background: #e6efea; cursor: zoom-in; min-height: 60px;
}
.news-bild img { width: 100%; height: auto; display: block; opacity: 0; transition: opacity .25s; }
.news-bild img.da { opacity: 1; }
.news-bild:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }

.news-mini { width: 100%; max-height: 120px; overflow: hidden;
  border-radius: 10px; margin-top: 8px; background: #e6efea; }
.news-mini img { width: 100%; height: 120px; object-fit: cover; display: block;
  opacity: 0; transition: opacity .25s; }
.news-mini img.da { opacity: 1; }

/* ─── Teilnahme ───────────────────────────────────────────────────────────
   Zwei gleich grosse Knoepfe nebeneinander, am Handy untereinander. Die
   Absage ist bewusst nicht rot: Sie ist eine Antwort, kein Fehler. */
.teilnahme { margin-top: 14px; }
.tn-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.tn-knoepfe .knopf { flex: 1 1 160px; text-align: center; }
.teilnahme .erfolg, .teilnahme .hinweis {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 0;
}
.teilnahme .knopf.leise { padding: 7px 13px; font-size: 14px; }
