/* killi-software.de — gemeinsames Stylesheet aller Seiten.

   Vorher trug jede Seite ihr eigenes <style>-Duplikat; eine Farbänderung musste
   an fünf Stellen nachgezogen werden. Jetzt gibt es genau diese Datei.

   ACHTUNG Cache: firebase.json liefert *.css mit max-age=31536000 aus (ein Jahr).
   Deshalb hängt in jeder Seite ein ?v=N an der Einbindung — bei einer Änderung
   an dieser Datei die Nummer in ALLEN Seiten gemeinsam hochzählen, sonst sehen
   wiederkehrende Besucher das alte Design.

   Farben stammen aus der App (assets/style.css): Himmelblau, Dunkelblau, Gold. */

:root {
  /* --marke ist der Markenton der App (assets/style.css: --himmel #1479d1) und
     bleibt für Flächen und Akzente. Für TEXT und Knopfbeschriftung ist er zu
     hell: gemessen 4,48:1 gegen Weiß, WCAG AA verlangt 4,5:1. Deshalb gibt es
     --marke-text – derselbe Farbton, eine Spur dunkler, gemessen 5,37:1. */
  --marke: #1479d1;
  --marke-text: #106cbe;
  --marke-tief: #0f5ea6;
  --knopf-schrift: #ffffff;
  --tinte: #123054;
  --gold: #d99b00;

  --grund: #f2f5fa;
  --flaeche: #ffffff;
  --flaeche-2: #eef4fb;
  --rand: rgba(18, 48, 84, .12);
  --text: #17233a;
  --text-leise: #55688a;

  --radius: 16px;
  --radius-klein: 10px;
  --schatten: 0 1px 2px rgba(18, 48, 84, .06), 0 8px 24px -12px rgba(18, 48, 84, .18);
  --spalte: 44rem;          /* Lesebreite für Fließtext */
  --seite: 68rem;           /* Außenbreite für Kopf, Fuß, Raster */
}

@media (prefers-color-scheme: dark) {
  :root {
    --marke: #58a8ee;
    --marke-text: #7ebdf3;   /* dunkler Grund → hier muss der Ton HELLER werden */
    --marke-tief: #8cc4f5;
    /* Der Knopf ist dann eine HELLE Fläche: weiße Schrift darauf käme auf 2,0:1.
       Deshalb im Dunkelmodus dunkle Schrift auf hellem Knopf. */
    --knopf-schrift: #0b1424;
    --tinte: #dbe8f7;
    --gold: #f5b915;

    --grund: #0b1424;
    --flaeche: #121f33;
    --flaeche-2: #17273f;
    --rand: rgba(255, 255, 255, .10);
    --text: #e6edf7;
    --text-leise: #9db0cb;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--grund);
  /* zarter Farbverlauf oben, damit die Seite nicht flach wirkt */
  background-image: radial-gradient(1200px 400px at 50% -220px, rgba(20, 121, 209, .16), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Grundelemente ---------- */

h1, h2, h3 { color: var(--tinte); line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); margin: 0 0 .35em; }
h2 { font-size: 1.3rem; margin: 2.2em 0 .5em; }
h3 { font-size: 1.05rem; margin: 0 0 .25em; }

p, li { margin: 0 0 .9em; }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: .45em; }

a { color: var(--marke-text); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--marke-tief); }

:focus-visible {
  outline: 2px solid var(--marke);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
  background: var(--flaeche-2);
  padding: .1em .35em;
  border-radius: 5px;
}

hr { border: 0; border-top: 1px solid var(--rand); margin: 2.5rem 0; }

/* ---------- Kopfzeile ---------- */

.springen {
  position: absolute; left: -9999px;
  background: var(--flaeche); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-klein);
}
.springen:focus { left: 12px; top: 12px; z-index: 100; }

.kopf {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--grund) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rand);
}
.kopf-innen {
  max-width: var(--seite); margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}

.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinte); font-weight: 700; }
.marke:hover { color: var(--tinte); }
.marke-zeichen {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(145deg, #1479d1, #0f3f77);
  color: #fff; font-size: .95rem; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px -2px rgba(20, 121, 209, .7);
}
.marke-text { letter-spacing: -.02em; }
.marke-text span { color: var(--text-leise); font-weight: 500; }

.navi { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.navi a {
  text-decoration: none; color: var(--text-leise); font-size: .95rem; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
}
.navi a:hover { color: var(--tinte); background: var(--flaeche-2); }
.navi a[aria-current="page"] { color: var(--tinte); background: var(--flaeche-2); font-weight: 600; }

/* Schmale Geräte: Marke und Navigation passen nicht nebeneinander, die Leiste
   bricht dann auf zwei Zeilen um (gemessen: 110 px hoch). Als klebende Leiste
   nimmt das zu viel vom Bildschirm weg – deshalb hier kompakter und mitrollend. */
@media (max-width: 640px) {
  .kopf { position: static; }
  .kopf-innen { padding: 10px 16px; gap: 8px 12px; }
  .navi { gap: 2px; }
  .navi a { padding: 5px 10px; font-size: .9rem; }
  .inhalt { padding: 24px 16px 56px; }
  .karte { padding: 22px 18px; }
  .aufmacher { padding: 24px 18px; }
}

/* ---------- Aufbau ---------- */

.inhalt { max-width: var(--seite); margin: 0 auto; padding: 40px 20px 72px; }
.schmal { max-width: var(--spalte); }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 28px 26px;
}
.karte + .karte { margin-top: 18px; }

.aufmacher { padding: 32px 26px; }
.aufmacher .lead { font-size: 1.12rem; color: var(--text-leise); max-width: 42rem; margin-bottom: 0; }

.hinweis {
  background: var(--flaeche-2);
  border: 1px solid var(--rand);
  border-left: 3px solid var(--marke);
  border-radius: var(--radius-klein);
  padding: 14px 18px;
  margin: 18px 0;
}
.hinweis :last-child { margin-bottom: 0; }

.etikett {
  display: inline-block;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-leise);
  margin-bottom: .5em;
}

.chip {
  display: inline-block;
  font-size: .82rem; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
  background: var(--flaeche-2); color: var(--text-leise);
  border: 1px solid var(--rand);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.chips li { margin: 0; }

/* ---------- Projektkarte auf der Startseite ---------- */

.projekt { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.projekt img { width: 88px; height: 88px; border-radius: 20px; box-shadow: var(--schatten); }
.projekt-text { flex: 1 1 20rem; }
.projekt-text h3 { font-size: 1.35rem; }
.projekt-text .kurz { color: var(--text-leise); margin-bottom: .7em; }

.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.knopf {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 10px 18px; border-radius: 999px;
  background: var(--marke-text); color: var(--knopf-schrift);
  border: 1px solid transparent;
  transition: transform .12s ease, filter .12s ease;
}
.knopf:hover { color: var(--knopf-schrift); filter: brightness(1.06); transform: translateY(-1px); }
.knopf.leise { background: var(--flaeche-2); color: var(--tinte); border-color: var(--rand); }
.knopf.leise:hover { color: var(--tinte); }

@media (prefers-reduced-motion: reduce) {
  .knopf, .knopf:hover { transition: none; transform: none; }
}

/* ---------- Bildergalerie ---------- */

.galerie {
  display: grid; gap: 16px; margin: 22px 0 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.galerie li { margin: 0; }
.galerie img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; border: 1px solid var(--rand);
  box-shadow: var(--schatten);
}
.galerie figcaption, .galerie .bildtext {
  font-size: .85rem; color: var(--text-leise); margin-top: 8px; text-align: center;
}

/* ---------- Fragen / Aufklappliste ---------- */

.fragen { margin-top: 8px; }
.frage {
  border-top: 1px solid var(--rand);
  padding: 16px 0;
}
.frage:first-of-type { border-top: 0; }
.frage h3 { margin-bottom: .3em; }
.frage p:last-child { margin-bottom: 0; }

/* ---------- Tabellen ---------- */

table { border-collapse: collapse; width: 100%; margin: 12px 0 18px; font-size: .96rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rand); }
th { color: var(--tinte); font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Inhaltsverzeichnis der Rechtstexte ---------- */

.verzeichnis { columns: 2; column-gap: 28px; font-size: .95rem; padding-left: 1.1em; }
.verzeichnis li { break-inside: avoid; }
@media (max-width: 640px) { .verzeichnis { columns: 1; } }

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

.fuss {
  border-top: 1px solid var(--rand);
  background: var(--flaeche);
}
.fuss-innen {
  max-width: var(--seite); margin: 0 auto; padding: 32px 20px 40px;
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  font-size: .93rem;
}
.fuss h4 { margin: 0 0 .6em; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-leise); }
.fuss ul { list-style: none; padding: 0; margin: 0; }
.fuss li { margin-bottom: .4em; }
.fuss a { text-decoration: none; }
.fuss a:hover { text-decoration: underline; }
.fuss .firma { color: var(--text-leise); }

/* ---------- Druck (Rechtstexte werden ausgedruckt) ---------- */

@media print {
  .kopf, .navi, .fuss, .knopfreihe, .galerie { display: none; }
  body { background: #fff; font-size: 11pt; }
  .karte { border: 0; box-shadow: none; padding: 0; }
  .inhalt { padding: 0; max-width: none; }
  a { color: #000; text-decoration: underline; }
}
