/* Projektseite komliv.de (#38). Farben nur aus der Farbtabelle in marke/README.md (tests/test_website.py prüft das),
   kantig mit höchstens 2 px Rundung, Schrift Barlow Semi Condensed vom eigenen Server. */

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("schriften/barlow-semi-condensed-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("schriften/barlow-semi-condensed-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("schriften/barlow-semi-condensed-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --grundflaeche: #163049;
  --grundflaeche-dunkel: #0d2033;
  --akzent: #d0452f;
  --zweitfarbe-schrift: #13734a;
  --hervorhebung: #e8b100;
  --gebaeude-hell: #a3bcd6;
  --weiss: #ffffff;
  --farbband: linear-gradient(90deg, #d0452f, #e8a900, #1a8f5c, #2b7cb5);
  --schrift: "Barlow Semi Condensed", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--weiss);
  color: var(--grundflaeche);
  font-family: var(--schrift);
  font-size: 1.125rem;
  line-height: 1.55;
}

img { max-width: 100%; height: auto; }

a { color: var(--grundflaeche); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--akzent); }

:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw + 0.5rem, 2.75rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.75rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 1.75rem 0 0.25rem; }

.rahmen { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

.sprung {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--weiss);
  color: var(--grundflaeche);
  z-index: 10;
}
.sprung:focus { top: 1rem; }

.farbband { height: 6px; background: var(--farbband); }

/* Kopf auf Grundfläche dunkel mit der hellen Kombination */
.kopf { background: var(--grundflaeche-dunkel); color: var(--weiss); }
.kopf-innen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.kopf-marke { display: block; line-height: 0; }
.kopf-marke img { width: 200px; height: auto; }
.kopf-slogan { margin: 0; font-weight: 500; color: var(--gebaeude-hell); }
.kopf :focus-visible { outline-color: var(--hervorhebung); }

.einleitung { font-size: 1.25rem; margin: 0; }

[hidden] { display: none !important; }


/* Textseite rechtliches */
.text { padding-top: 2.5rem; padding-bottom: 2rem; max-width: 50rem; }
.text ul { padding-left: 1.25rem; }
.klein { font-size: 0.95rem; }

/* Fußzeile */
.fuss { margin-top: 4rem; background: var(--grundflaeche-dunkel); color: var(--weiss); font-size: 1rem; }
.fuss-innen { padding-top: 1.5rem; padding-bottom: 2rem; }
.fuss a { color: var(--weiss); }
.fuss a:hover { color: var(--hervorhebung); }
.fuss :focus-visible { outline-color: var(--hervorhebung); }
.fuss-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-weight: 500; }
.fuss p { margin: 0.5rem 0 0; max-width: 50rem; }

/* Navigation im Kopf: bricht schmal um, damit nichts seitlich scrollt */
.kopf-navigation ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0 0 1rem; list-style: none; }
.kopf-navigation a { color: var(--weiss); font-weight: 500; }
.kopf-navigation a:hover { color: var(--hervorhebung); }

/* Abschnitte der Startseite */
/* Einheitlicher Rhythmus: 4rem zwischen Abschnitten. Text steht in einer mittigen Spalte, nur Funktionen nutzen die volle Breite */
.abschnitt { padding-top: 4rem; scroll-margin-top: 0.5rem; }
.abschnitt > .rahmen { max-width: 48rem; }
#funktionen > .rahmen { max-width: 72rem; }
.abschnitt h2 { margin-top: 0; }
.abschnitt > .rahmen > :last-child { margin-bottom: 0; }
.absatz { margin: 0 0 1rem; }
.abschnitt .knopf { margin-top: 0.5rem; }
/* 3 Schritte (#97): der Befehl steht auf eigener Zeile und bricht schmal um, damit nichts seitlich scrollt */
.schritte { margin: 0 0 1rem; padding-left: 1.5rem; }
.schritte li { margin-bottom: 0.75rem; }
.schritte code { display: block; margin-top: 0.25rem; padding: 0.5rem 0.75rem; border-left: 4px solid var(--gebaeude-hell);
  font-size: 0.95rem; overflow-wrap: anywhere; }
/* Rundgang (#98): je Szene Überschrift, animiertes WebP und darunter der Nutzen, klar als Beispiel gekennzeichnet */
.rundgang-szene { margin-top: 2rem; }
.rundgang-szene h3 { margin: 0 0 0.75rem; }
.rundgang-szene img { display: block; border: 1px solid var(--gebaeude-hell); }
.rundgang-szene p { margin: 0.75rem 0 0; }
.rundgang-szene .beispiel { padding-left: 1rem; border-left: 4px solid var(--gebaeude-hell); }
/* Funktionen (#96): schmal Text und Bild untereinander, breit links die Liste und rechts das Bild der gewählten
   Funktion. Gewählt ist ohne JavaScript die Überschrift im Anker (:target, sonst die erste), mit JavaScript aria-current. */
.funktionen article { margin-top: 2rem; }
.funktionen h3 { scroll-margin-top: 0.5rem; }
.funktionen h3 { margin: 0 0 0.25rem; }
.funktionen h3 a { text-decoration: none; }
.funktionen p { margin: 0; }
.funktionen img { display: block; margin-top: 1rem; border: 1px solid var(--gebaeude-hell); }

/* 60rem auch in funktionen.js */
@media (min-width: 60rem) {
  .funktionen { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 2rem; margin-top: 1.5rem; }
  .funktionen article { display: contents; }
  .funktionen h3, .funktionen p { grid-column: 1; padding-left: 1rem; border-left: 4px solid var(--gebaeude-hell); }
  .funktionen h3 { padding-top: 0.75rem; margin: 0; }
  .funktionen p { padding-bottom: 0.75rem; }
  /* 8 Funktionen mit je Überschrift und Text: Die Bilder liegen übereinander neben allen 16 Zeilen */
  .funktionen img { grid-column: 2; grid-row: 1 / span 16; align-self: start; position: sticky; top: 1rem; margin: 0; visibility: hidden; }

  .funktionen:not(.mit-wahl):not(:has(:target)) article:first-child :is(h3, p),
  .funktionen:not(.mit-wahl) article:has(h3:target) :is(h3, p),
  .funktionen.mit-wahl article:has(a[aria-current="true"]) :is(h3, p) { border-left-color: var(--akzent); }
  .funktionen:not(.mit-wahl):not(:has(:target)) article:first-child img,
  .funktionen:not(.mit-wahl) article:has(h3:target) img,
  .funktionen.mit-wahl article:has(a[aria-current="true"]) img { visibility: visible; }
}

/* Im Einsatz (Ticket 100): je Kommune ein Eintrag mit Fakten, später mit Zitat und 3 Bildern nach schriftlicher Zustimmung.
   Weitere Kommunen kommen als weiteres <li class="kommune"> dazu, Muster in tests/daten/einsatz-muster.html */
.kommunen { margin: 0; padding: 0; list-style: none; }
.kommune { margin-top: 1.5rem; padding-left: 1rem; border-left: 4px solid var(--grundflaeche); }
.kommune:first-child { margin-top: 0; }
.kommune h3 { margin: 0 0 0.25rem; }
.kommune-fakten { margin: 0; padding-left: 1.25rem; list-style: disc; }
.kommune-stimme { margin: 1rem 0 0; }
.kommune-zitat { margin: 0; padding-left: 1rem; border-left: 4px solid var(--akzent); font-size: 1.25rem; font-style: italic; }
.kommune-zitat p { margin: 0; }
.kommune-stimme figcaption { margin-top: 0.25rem; padding-left: 1.25rem; font-size: 1rem; }
.kommune-bilder { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; margin: 1rem 0 0;
  padding: 0; list-style: none; }
.kommune-bilder img { display: block; border: 1px solid var(--gebaeude-hell); }

/* Am Ende derselbe Hauptknopf wie oben auf der Wand, darunter der zweite Weg: Anruf oder Videocall (#96) */
#weiter .knopf { background: var(--akzent); font-size: 1.1875rem; font-weight: 700; padding: 0.6875rem 1.25rem; }
#weiter .knopf:hover { text-decoration: underline; }
.zweiter-weg { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0; padding: 0; list-style: none; font-weight: 500; }

.knopf {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border-radius: 2px;
  background: var(--grundflaeche);
  color: var(--weiss);
  font-weight: 500;
  text-decoration: none;
}
.knopf:hover { background: var(--grundflaeche-dunkel); color: var(--weiss); }

/* Datenfluss: Farben über Klassen, die Content-Security-Policy erlaubt keine style-Attribute */
.datenfluss { display: block; width: 100%; max-width: 34rem; height: auto; margin: 2rem auto 0; }
.kasten rect { fill: var(--weiss); stroke: var(--grundflaeche); stroke-width: 2; }
.kasten-marke { fill: var(--grundflaeche); }
.beschriftung { fill: var(--grundflaeche); font-size: 16px; }
.beschriftung .fett { font-weight: 700; }
.auf-dunkel { fill: var(--weiss); }
.linie path { fill: none; stroke: var(--grundflaeche); stroke-width: 2; }
.pfeil-spitze { fill: var(--grundflaeche); }
.linie-zurueck path { fill: none; stroke: var(--akzent); stroke-width: 2; stroke-dasharray: 6 5; }
.pfeil-spitze-zurueck { fill: var(--akzent); }
.beschriftung-zurueck { font-size: 14px; }

/* Timeline */
.timeline, .timeline-geplant { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.timeline li { padding: 0.35rem 0 0.35rem 1rem; border-left: 4px solid var(--grundflaeche); }
.timeline time { display: inline-block; min-width: 6rem; font-weight: 700; }
.timeline-geplant li { padding: 0.35rem 0 0.35rem 1rem; border-left: 4px dashed var(--gebaeude-hell); }

/* Darkmode (Schalter in hero.css): Grundfläche und Weiß tauschen ihre Rollen, Farben bleiben aus der Farbtabelle */
.abend-schalter:checked ~ main {
  --grundflaeche: #ffffff;
  --weiss: #0d2033;
  --grundflaeche-dunkel: #a3bcd6;
  --akzent: #e8b100;
  background: #0d2033;
  color: #ffffff;
}
