/* Heimatpuls – Gestaltung. Farben und Schriften als Variablen, damit eine
   andere Region später ein eigenes Farbschema bekommen kann. */

/* Schriften liegen auf unserem Server (kein Abruf bei Google). Lizenz: SIL OFL 1.1 */
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../schriften/figtree-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(../schriften/bricolage-grotesque-latin.woff2) format('woff2');
}

:root {
  --rot: #B42318;
  --rot-hell: #FDECEA;
  --auf-akzent: #FFFFFF;
  --grund: #F4F6F5;
  --flaeche: #FFFFFF;
  --text: #15231F;
  --text-leise: #4D5C57;
  --linie: #DCE3E0;
  --linie-stark: #CBD5D1;
  --akzent: #0D6B5B;
  --akzent-dunkel: #09493E;
  --akzent-hell: #DDEFEA;
  --warm-text: #9A4312;
  --warm-hell: #FCEBDD;
  --radius: 16px;
  --schrift: 'Figtree', system-ui, sans-serif;
  --titel: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --nav-hoehe: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0F1714;
    --flaeche: #18231F;
    --text: #E8EFEC;
    --text-leise: #A5B5AF;
    --linie: #2A3732;
    --linie-stark: #3A4A44;
    --akzent: #5CC4AE;
    --akzent-dunkel: #8ADBC9;
    --akzent-hell: #183B33;
    --warm-text: #F2B48C;
    --warm-hell: #3A2618;
    --rot: #FF9C92;
    --rot-hell: #3D1A17;
    --auf-akzent: #0F1714;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--akzent); text-decoration: none; }
a:hover { color: var(--akzent-dunkel); }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 8px; }
h1, h2 { font-family: var(--titel); font-weight: 700; letter-spacing: -0.3px; margin: 0; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 21px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rahmen { max-width: 560px; margin: 0 auto; }
.inhalt {
  display: flex; flex-direction: column; gap: 20px;
  padding: 24px 16px calc(var(--nav-hoehe) + 32px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
.laden { color: var(--text-leise); }

/* Kopf der Startseite */
.start-kopf { display: flex; flex-direction: column; gap: 12px; }
.markenzeile { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.marke { display: flex; align-items: center; gap: 6px; font-family: var(--titel); font-weight: 700; font-size: 21px; color: var(--text); flex-shrink: 0; }
.marke .symbol { color: var(--akzent); }
.ort-pille {
  display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 11px; min-width: 0;
  border-radius: 999px; background: var(--flaeche); color: var(--text); font-size: 13px; font-weight: 600;
}
.ort-pille .symbol { flex-shrink: 0; }
.ort-pille .symbol:first-child { color: var(--akzent); }
.ort-pille-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h1[tabindex]:focus { outline: none; }
.datum { margin: 0; color: var(--text-leise); font-size: 14px; font-weight: 500; }

/* Suchfeld */
.suchfeld {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px;
  background: var(--flaeche); border: 1.5px solid var(--akzent); border-radius: var(--radius);
}
.suchfeld .symbol { color: var(--akzent); flex-shrink: 0; }
.suchfeld input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: inherit; font-size: 16px; color: var(--text);
}
.suchfeld:focus-within { outline: 3px solid var(--akzent-hell); }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kachel { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--flaeche); border-radius: 18px; color: var(--text); }
.kachel:hover { color: var(--text); outline: 1.5px solid var(--linie-stark); }
.kachel-symbol { width: 40px; height: 40px; border-radius: 12px; background: var(--akzent-hell); color: var(--akzent); display: flex; align-items: center; justify-content: center; }
.kachel-name { font-weight: 600; }

/* Listen und Karten */
.abschnitt { display: flex; flex-direction: column; gap: 12px; }
.liste { display: flex; flex-direction: column; gap: 10px; }
.karte { background: var(--flaeche); border-radius: var(--radius); }
.eintrag { display: flex; align-items: center; gap: 14px; padding: 12px 14px; color: var(--text); min-height: 64px; }
.eintrag:hover { color: var(--text); outline: 1.5px solid var(--linie-stark); }
.eintrag-zeit { width: 52px; flex-shrink: 0; text-align: center; font-family: var(--titel); font-weight: 700; font-size: 17px; color: var(--akzent); }
.eintrag-symbol { width: 52px; flex-shrink: 0; display: flex; justify-content: center; color: var(--akzent); }
.eintrag-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.eintrag-titel { font-weight: 600; }
.eintrag-zeile { font-size: 14px; color: var(--text-leise); }
.eintrag-preis { font-family: var(--titel); font-weight: 700; flex-shrink: 0; }

.leer { display: flex; flex-direction: column; gap: 6px; padding: 24px 20px; background: var(--flaeche); border-radius: var(--radius); text-align: center; color: var(--text-leise); }
.leer strong { color: var(--text); font-family: var(--titel); font-size: 18px; }

/* Kopf mit Zurück */
.kopf-zurueck { display: flex; align-items: center; gap: 12px; }
.kopf-titel { color: var(--text-leise); font-size: 14px; }
.knopf-rund { width: 44px; height: 44px; border-radius: 14px; background: var(--flaeche); color: var(--text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.unterzeile { margin: -8px 0 0; color: var(--text-leise); }

/* Ortswahl */
.ortwahl { display: flex; flex-direction: column; gap: 16px; }
.ortliste { border: none; margin: 0; padding: 0; overflow: hidden; }
.ortzeile { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border-bottom: 1px solid var(--linie); cursor: pointer; font-weight: 500; }
.ortzeile:last-child { border-bottom: none; }
.ortzeile input { position: absolute; opacity: 0; pointer-events: none; }
.ortzeile-haken { color: var(--akzent); visibility: hidden; }
.ortzeile:has(input:checked) { background: var(--akzent-hell); font-weight: 600; }
.ortzeile:has(input:checked) .ortzeile-haken { visibility: visible; }
.ortzeile:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: -3px; }
.umkreis { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.umkreis-kopf { display: flex; justify-content: space-between; align-items: baseline; }
.umkreis-kopf label { font-family: var(--titel); font-weight: 700; font-size: 19px; }
.umkreis-kopf output { color: var(--akzent); font-weight: 600; }
.umkreis input[type=range] { width: 100%; accent-color: var(--akzent); min-height: 32px; }
.umkreis-hinweis { margin: 0; font-size: 14px; color: var(--text-leise); }

/* Knöpfe */
.knopf-haupt {
  display: flex; align-items: center; justify-content: center; height: 56px; border: none; border-radius: var(--radius);
  background: var(--akzent); color: var(--auf-akzent); font: inherit; font-weight: 600; cursor: pointer;
  padding: 0 20px; text-align: center;
}
.knopf-haupt:hover { color: var(--auf-akzent); background: var(--akzent-dunkel); }
.knopf-haupt:disabled, .knopf-zweit:disabled { opacity: .6; cursor: wait; }
.knopf-zweit {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border-radius: var(--radius); border: 1.5px solid var(--linie-stark); background: transparent;
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.knopf-zweit:hover { color: var(--text); border-color: var(--akzent); }

/* Details */
.details { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.detailzeile { display: flex; align-items: flex-start; gap: 10px; margin: 0; }
.detailzeile .symbol { color: var(--akzent); flex-shrink: 0; margin-top: 1px; }
.merkmal { justify-content: space-between; border-top: 1px solid var(--linie); padding-top: 10px; }
.merkmal-name { color: var(--text-leise); }
.beschreibung { margin: 0; }
.quelle { margin: 0; font-size: 13px; color: var(--text-leise); }
.quelle a { color: var(--text-leise); text-decoration: underline; }

/* Navigation unten */
.navigation {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 560px; margin: 0 auto; padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
  background: var(--flaeche); border-top: 1px solid var(--linie);
}
.navigation a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; color: var(--text-leise); font-size: 12px; font-weight: 500; }
.navigation a[aria-current=page] { color: var(--akzent); font-weight: 600; }

/* Hinweis im Demo-Modus */
body.demo::before {
  content: 'Demo-Modus · Beispieldaten'; display: block; text-align: center; font-size: 12px; font-weight: 600;
  padding: 6px; background: var(--warm-hell); color: var(--warm-text);
}

@media (min-width: 600px) {
  .navigation { border-left: 1px solid var(--linie); border-right: 1px solid var(--linie); border-radius: 16px 16px 0 0; }
}

/* ===================== Handwerker & Haus, Konten, Admin ===================== */

/* Einstieg auf der Startseite */
.einstieg { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--akzent-hell); border-radius: 20px; }
.einstieg h2 { font-size: 23px; line-height: 1.15; }
.einstieg p { margin: 0; color: var(--text); }
.einstieg-knoepfe { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 420px) { .einstieg-knoepfe { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }

.knopf-notfall {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 16px;
  border: none; border-radius: var(--radius); background: var(--rot); color: var(--auf-akzent);
  font: inherit; font-weight: 700; cursor: pointer; text-align: center;
}
.knopf-notfall:hover { color: var(--auf-akzent); filter: brightness(1.08); }
@media (prefers-color-scheme: light) { .knopf-notfall, .knopf-notfall:hover { color: #FFFFFF; } }
.knopf-gefahr { color: var(--rot); border-color: var(--rot); }
.knopf-gefahr:hover { color: var(--rot); border-color: var(--rot); background: var(--rot-hell); }
.knopf-klein { min-height: 44px; padding: 0 14px; font-size: 15px; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; }
.knopfreihe > * { flex: 1 1 auto; }
.link-knopf { background: none; border: none; padding: 10px 0; min-height: 44px; font: inherit; font-weight: 600; color: var(--akzent); cursor: pointer; text-align: left; }

/* Notfall-Seite */
.notruf { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 20px; background: var(--rot-hell); border: 2px solid var(--rot); }
.notruf h2 { color: var(--rot); }
.notruf ol, .notruf ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.notruf-nummer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 16px; border-radius: var(--radius); background: var(--flaeche); color: var(--text); font-weight: 600; }
.notruf-nummer strong { font-family: var(--titel); font-size: 26px; color: var(--rot); }
.notruf-nummer:hover { color: var(--text); outline: 2px solid var(--rot); }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: 16px; }
.formular-karte { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px; }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld > label, .feld > .feld-titel { font-weight: 600; }
.feld-hilfe { font-size: 14px; color: var(--text-leise); margin: 0; }
.feld input:not([type=checkbox]):not([type=radio]):not([type=range]), .feld select, .feld textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--linie-stark); border-radius: 12px;
  background: var(--flaeche); color: var(--text); font: inherit; font-size: 16px;
}
.feld textarea { min-height: 110px; resize: vertical; }
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: 3px solid var(--akzent-hell); border-color: var(--akzent); }
.feld [aria-invalid=true] { border-color: var(--rot) !important; }
.feld-fehler { color: var(--rot); font-size: 14px; font-weight: 600; margin: 0; }
.feld-fehler:empty { display: none; }
.felder-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 480px) { .felder-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .felder-plz { grid-template-columns: 110px minmax(0, 1fr); } }
.haken-zeile { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; cursor: pointer; }
.haken-zeile input { width: 24px; height: 24px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--akzent); }
.auswahl-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; border: none; padding: 0; margin: 0; }
.auswahl-gitter legend { font-weight: 600; margin-bottom: 8px; }
.auswahl-chip { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--linie-stark); border-radius: 12px; background: var(--flaeche); cursor: pointer; font-size: 15px; }
.auswahl-chip input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--akzent); margin: 0; }
.auswahl-chip:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); font-weight: 600; }
.auswahl-chip:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Meldungen */
.meldung { padding: 14px 16px; border-radius: var(--radius); background: var(--flaeche); border-left: 5px solid var(--akzent); margin: 0; }
.meldung-fehler { border-left-color: var(--rot); background: var(--rot-hell); color: var(--text); }
.meldung-warn { border-left-color: var(--warm-text); background: var(--warm-hell); }
.meldung:empty { display: none; }
.entwurf-hinweis { padding: 10px 14px; border-radius: 12px; background: var(--warm-hell); color: var(--warm-text); font-weight: 600; font-size: 14px; }

/* Listen mit Aktionen */
.zeilenliste { display: flex; flex-direction: column; }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 10px 16px; border-bottom: 1px solid var(--linie); color: var(--text); }
.zeile:last-child { border-bottom: none; }
a.zeile:hover { color: var(--text); background: var(--akzent-hell); }
.zeile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zeile-titel { font-weight: 600; overflow-wrap: anywhere; }
.zeile-unter { font-size: 14px; color: var(--text-leise); overflow-wrap: anywhere; }
.zeile .symbol { color: var(--text-leise); flex-shrink: 0; }

.pille { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--akzent-hell); color: var(--akzent-dunkel); white-space: nowrap; }
.pille-warn { background: var(--warm-hell); color: var(--warm-text); }
.pille-rot { background: var(--rot-hell); color: var(--rot); }
.pille-grau { background: var(--grund); color: var(--text-leise); border: 1px solid var(--linie); }
.pillen { display: flex; flex-wrap: wrap; gap: 6px; }

/* Fotos */
.foto-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.foto { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--linie); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto button { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border-radius: 12px; border: none; background: rgba(15, 23, 20, .72); color: #FFFFFF; font-size: 20px; cursor: pointer; }
.foto-hochladen { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 2px dashed var(--linie-stark); border-radius: 12px; color: var(--akzent); font-weight: 600; cursor: pointer; text-align: center; padding: 8px; font-size: 14px; }
.foto-hochladen:focus-within { outline: 3px solid var(--akzent); }
.foto-hochladen input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Kennzahlen und Tabellen (Admin) */
.kennzahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kennzahl { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--flaeche); border-radius: var(--radius); color: var(--text); }
a.kennzahl:hover { color: var(--text); outline: 1.5px solid var(--linie-stark); }
.kennzahl strong { font-family: var(--titel); font-size: 28px; line-height: 1.1; }
.kennzahl span { font-size: 14px; color: var(--text-leise); }
.kennzahl-achtung strong { color: var(--warm-text); }
.tabelle-huelle { overflow-x: auto; background: var(--flaeche); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th, .tabelle td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { color: var(--text-leise); font-weight: 600; white-space: nowrap; }
.tabelle tr:last-child td { border-bottom: none; }
.reiter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.reiter a { flex-shrink: 0; display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--flaeche); color: var(--text); font-weight: 600; font-size: 14px; }
.reiter a[aria-current=page] { background: var(--akzent); color: var(--auf-akzent); }
.filterzeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filterzeile .feld { flex: 1 1 160px; }

/* Verzeichnis */
.betrieb-karte { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.betrieb-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.betrieb-name { font-weight: 700; font-family: var(--titel); font-size: 18px; }
.betrieb-zeile { margin: 0; font-size: 14px; color: var(--text-leise); }

.fusszeile { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; font-size: 13px; padding-top: 8px; }
.fusszeile a { color: var(--text-leise); min-height: 44px; display: inline-flex; align-items: center; }
.rechtstext { display: flex; flex-direction: column; gap: 12px; }
.rechtstext h2 { font-size: 19px; margin-top: 8px; }
.rechtstext p, .rechtstext ul { margin: 0; }
.platzhalter { background: var(--warm-hell); color: var(--warm-text); padding: 0 4px; border-radius: 4px; font-weight: 600; }
button.zeile { width: 100%; background: none; border: none; border-bottom: 1px solid var(--linie); font: inherit; text-align: left; cursor: pointer; color: var(--text); padding: 10px 16px; }
button.zeile:hover { background: var(--akzent-hell); }
.betrieb-karte, .betrieb-karte:hover { color: var(--text); }
.betrieb-karte:hover { outline: 1.5px solid var(--linie-stark); }
code { overflow-wrap: anywhere; font-size: 13px; background: var(--grund); padding: 2px 6px; border-radius: 6px; }
