/* Flugbuch – Bausteine (Bedienmuster v3, DESIGN.md). Marke Navy/Gold als Variablen auf :root und html.dark.
   Feste Farbwerte stehen nur in diesen beiden Blöcken; tests/test_regeln_vorab.py prüft das.
   Radius-Skala: Karten 12px, Bedienelemente 8px, Pillen 999px, kleine Marken 4px. Trefferflächen mindestens 44 px. */

@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap;
  src: url("../fonts/barlow-semi-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap;
  src: url("../fonts/barlow-semi-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap;
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); }

:root {
  --grund: #f6f4ee;
  --flaeche: #fffdf8;
  --text: #1b2233;
  --neben: #5d6475;
  --linie: #ddd8ca;
  --navy: #1f2f52;
  --navy-text: #ffffff;
  --gold: #b8892b;      /* Linien, Rahmen, Track – nie als Fließtext */
  --tipp: #7d5a12;      /* Gold als Text für Antippbares, 5,9 : 1 auf --flaeche */
  --gut: #1e7f4f;
  --warn: #8a5a00;
  --krit: #b3362f;
  --info: #2a5d9f;
  --banner-gruen: #1e7f4f;
  --banner-gelb: #8a5a00;
  --banner-rot: #a12d27;
  --banner-text: #ffffff;
  --test: #6b2fa0;      /* Testserver-Banner */
  color-scheme: light;
}
html.dark {
  --grund: #0f1420;
  --flaeche: #171e2e;
  --text: #e9ecf3;
  --neben: #a7afc0;
  --linie: #2f3a55;
  --navy: #2b3f6e;
  --navy-text: #ffffff;
  --gold: #d9b25a;
  --tipp: #e3bd67;
  --gut: #5fc793;
  --warn: #e3b548;
  --krit: #f28b83;
  --info: #86b6f2;
  --test: #b98be6;
  color-scheme: dark;
}

html { background: var(--grund); }
body { background: var(--grund); color: var(--text); font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1rem; line-height: 1.5; margin: 0; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: "Barlow Semi Condensed", "Source Sans 3", system-ui, sans-serif; font-weight: 700;
  line-height: 1.15; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
.zahl, .reihe .wert, time { font-variant-numeric: tabular-nums; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .9em; }
.neben { color: var(--neben); }
.klein { font-size: .84rem; }
.sprung { position: absolute; left: -999px; }
.sprung:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--flaeche); padding: .5rem 1rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Seitenrahmen */
.kopf { background: var(--navy); color: var(--navy-text); }
.kopf .innen { max-width: 64rem; margin: 0 auto; padding: 0 1rem; min-height: 3.25rem; display: flex;
  align-items: center; justify-content: space-between; gap: 1rem; }
.kopf .marke-name { font-family: "Barlow Semi Condensed", system-ui, sans-serif; font-weight: 700; font-size: 1.25rem;
  color: var(--navy-text); text-decoration: none; min-height: 2.75rem; display: inline-flex; align-items: center; }
.kopf nav { display: none; gap: .25rem; }
.kopf nav a { color: var(--navy-text); text-decoration: none; padding: 0 .75rem; min-height: 2.75rem;
  display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.kopf nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.seite { max-width: 64rem; margin: 0 auto; padding: 1rem 1rem 6.5rem; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem;
  margin: .5rem 0 1rem; }
.abschnitt { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.75rem 0 .5rem; }
.tabs-unten { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--flaeche);
  border-top: 1px solid var(--linie); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.tabs-unten a { flex: 1; min-height: 3.25rem; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .1rem; font-size: .75rem; color: var(--neben); text-decoration: none; }
.tabs-unten a[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 2px 0 var(--gold); }
.tabs-unten svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) {
  .kopf nav { display: flex; }
  .tabs-unten { display: none; }
  .seite { padding-bottom: 3rem; }
  h1 { font-size: 2.125rem; }
}
.streifen-test { background: var(--test); color: var(--banner-text); text-align: center; font-size: .84rem;
  padding: .25rem 1rem; }
html.dark .streifen-test { color: var(--grund); }

/* Bausteine */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 1rem; }
.karte.eng { padding: 0; overflow: hidden; }
.liste { list-style: none; margin: 0; padding: 0; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 12px; overflow: hidden; }
.liste > li + li { border-top: 1px solid var(--linie); }
.reihe { min-height: 3rem; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .1rem 1rem;
  padding: .5rem 1rem; color: var(--text); text-decoration: none; }
.reihe .titel { font-weight: 600; }
.reihe .unter { grid-column: 1; color: var(--neben); font-size: .84rem; }
.reihe .wert { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-family: "Barlow Semi Condensed",
  system-ui, sans-serif; font-weight: 600; font-size: 1.125rem; }
.reihe .wert small { display: block; font-family: "Source Sans 3", system-ui, sans-serif; font-weight: 400;
  font-size: .78rem; color: var(--neben); }
a.reihe .wert::after { content: " ›"; color: var(--tipp); }
a.reihe:hover { background: color-mix(in srgb, var(--gold) 8%, transparent); }
.reihe.zwischen { min-height: 2.25rem; background: color-mix(in srgb, var(--navy) 7%, transparent);
  font-size: .84rem; }
.reihe.zwischen .wert { font-size: .95rem; }
.reihe.buchseite { color: var(--tipp); font-family: "Barlow Semi Condensed", system-ui, sans-serif; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; font-size: .84rem; }

.knopf { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0 1.1rem; border: 1px solid var(--navy); border-radius: 8px; background: var(--navy);
  color: var(--navy-text); font: inherit; font-weight: 600; cursor: pointer; }
.knopf-zweit { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0 1.1rem; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.knopf:disabled, .knopf-zweit:disabled { opacity: .55; cursor: not-allowed; }
.knopf.breit, .knopf-zweit.breit { width: 100%; }
.link { color: var(--tipp); text-decoration: underline; text-underline-offset: 2px; background: none; border: 0;
  padding: 0; font: inherit; cursor: pointer; }
summary.link, button.link, .reihe, .stand-knopf { min-height: 2.75rem; }
button.link, summary.link { display: inline-flex; align-items: center; }
.segment { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden;
  background: var(--flaeche); }
.segment a { min-height: 2.75rem; display: inline-flex; align-items: center; padding: 0 .9rem; color: var(--text);
  text-decoration: none; }
.segment button { min-height: 2.75rem; display: inline-flex; align-items: center; padding: 0 .9rem; color: var(--text);
  background: none; border: 0; font: inherit; cursor: pointer; }
.segment [aria-current="true"], .segment [aria-pressed="true"] { background: var(--navy); color: var(--navy-text); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: 2.75rem; display: inline-flex; align-items: center; padding: 0 .9rem; border: 1px solid var(--linie);
  border-radius: 999px; background: var(--flaeche); color: var(--text); text-decoration: none; }
.chip[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: var(--navy-text); }
.feld { min-height: 2.75rem; width: 100%; padding: .5rem .75rem; border: 1px solid var(--linie); border-radius: 8px;
  background: var(--flaeche); color: var(--text); font: inherit; }
label.feldname { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
.blaettern { min-height: 2.75rem; display: inline-flex; align-items: center; gap: .25rem; padding: 0 .5rem;
  color: var(--tipp); text-decoration: none; }
.abk { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
summary:not(.link):not([class*="knopf"]) { min-height: 2.75rem; display: flex; align-items: center; cursor: pointer;
  font-weight: 600; }

/* Status: immer Marke + Wort, nie Farbe allein */
.status { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.marke { width: .6rem; height: .6rem; border-radius: 999px; background: var(--neben); flex: none; }
.marke.gut { background: var(--gut); }
.marke.warn { background: var(--warn); border-radius: 4px; }
.marke.krit { background: var(--krit); border-radius: 4px; transform: rotate(45deg); }
.marke.info { background: var(--info); }
.streifen { border-left: 3px solid var(--gold); background: var(--flaeche); border-radius: 4px; padding: .6rem .9rem;
  margin: .5rem 0; }
.streifen.fehler { border-left-color: var(--krit); }
.streifen.erfolg { border-left-color: var(--gut); }

/* Heute-Banner: die einzige vollfarbige Fläche */
.banner { border-radius: 12px; padding: 1rem 1.1rem; color: var(--banner-text); background: var(--navy); }
.banner.gruen { background: var(--banner-gruen); }
.banner.gelb { background: var(--banner-gelb); }
.banner.rot { background: var(--banner-rot); }
.banner .oben { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.banner .satz { font-family: "Barlow Semi Condensed", system-ui, sans-serif; font-weight: 700; font-size: 1.6rem;
  line-height: 1.15; margin: .15rem 0; }

/* Fortschritt eines Kriteriums */
.balken { height: .4rem; border-radius: 999px; background: var(--linie); overflow: hidden; margin-top: .35rem;
  grid-column: 1 / -1; }
.balken i { display: block; height: 100%; background: var(--krit); }

/* Karte und Höhenprofil */
.kartenrahmen { border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
#map { height: 20rem; --track: var(--gold); --start: var(--gut); --ziel: var(--krit); --rand: var(--flaeche); }
html.dark #map .leaflet-tile-pane { filter: brightness(.72); }
.profil { display: grid; grid-template-columns: auto 1fr; gap: .25rem .5rem; }
.profil .y { display: flex; flex-direction: column; justify-content: space-between; text-align: right;
  font-size: .72rem; color: var(--neben); }
.profil svg { width: 100%; height: 11rem; display: block; }
.profil .raster line { stroke: var(--linie); stroke-width: 1; vector-effect: non-scaling-stroke; }
.profil .flaeche { fill: color-mix(in srgb, var(--gold) 22%, transparent); }
.profil .linie { fill: none; stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }

.werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: .75rem 0; }
.werte div { font-family: "Barlow Semi Condensed", system-ui, sans-serif; font-weight: 700; font-size: 1.6rem; }
.werte small { display: block; font-family: "Source Sans 3", system-ui, sans-serif; font-weight: 400; font-size: .78rem;
  color: var(--neben); }
dl.paare { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .35rem 1rem; margin: 0; }
dl.paare dt { color: var(--neben); }
dl.paare dd { margin: 0; }
.anmeldung { max-width: 26rem; margin: 2.5rem auto; }
.anmeldung.breit { max-width: 34rem; }
.qr svg { max-width: 14rem; height: auto; background: var(--banner-text); padding: .5rem; border-radius: 8px; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem 1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace; }
.fuss { max-width: 64rem; margin: 0 auto; padding: 0 1rem 6rem; color: var(--neben); font-size: .78rem; }

/* HTMX: Ladehinweis (statt des eingefügten Stils, den die CSP sperrt) */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; transition: opacity .2s ease-in; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .kopf, .tabs-unten, .knopf, .knopf-zweit, .chips, .streifen-test { display: none !important; }
  body, html { background: none; }
}
