/* Energiewende-Kosten — Stylesheet
   ============================================================================
   Leitidee: eine Kontoauszug-Ruhe. Das Thema ist ein amtliches Konto (das
   EEG-Konto des Bundeshaushalts); die Typografie zitiert das, ohne es zu
   behaupten — ein Serif-Kopf für Überschriften und die große Zahl, eine
   ruhige Systemschrift für Fließtext, tabellarische Ziffern überall, wo
   Beträge stehen. Unter jeder .hauptzahl liegt ein doppelter Strich wie die
   Summenzeile eines Kontoauszugs — das einzige wiederkehrende Signaturmotiv
   der Seite, sonst bleibt die Fläche ruhig.

   Bewusst KEIN Monospace-Ziffernblock für die große Zahl: ein tickender,
   monospaced Riesenbetrag ist die Ästhetik von Schuldenuhren und
   Aktivisten-Dashboards — genau der alarmierende Ton, den NEUTRALITY.md
   ausschließt. Die Zahl ist groß, weil sie der Inhalt ist, nicht weil sie
   dramatisiert.

   Hell (#fff) und Dunkel (#141618) sind als Seitenflächen bewusst exakt die
   Werte, gegen die die SVG-Diagrammfarben in site_charts.py geprüft sind
   (siehe dortiger Kommentar zu Slots 1/2/8) — eine andere Seitenfläche würde
   diese Kontrastprüfung stillschweigend entwerten. Innerhalb dieses Rahmens
   ist die Gestaltung eigenständig: kühles, gedecktes Blau als Akzent (nah an
   der "modelliert"-Chartfarbe, aber eigens auf Textkontrast ≥4.5:1 geprüft),
   keine warme Creme-Terracotta-Kombination, keine Vollflächen-Farbigkeit.
   ============================================================================ */

:root {
  color-scheme: light dark;

  --bg:           #ffffff;
  --flaeche:      #f5f7fa;   /* Kartenhintergrund */
  --text:         #14181f;
  --gedaempft:    #525a63;
  --linie:        #dde2e8;   /* zurückhaltende Trennlinien */
  --linie-stark:  #7c8896;   /* Summenstrich, Tabellenkopf-Linie */
  --akzent:       #1e5aa0;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --messung: 42rem; /* lesbare Zeilenlänge für Fließtext */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #141618;
    --flaeche:      #1c2024;
    --text:         #e8e8e8;
    --gedaempft:    #9aa5b1;
    --linie:        #2c3034;
    --linie-stark:  #5c6975;
    --akzent:       #6aa8e6;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 400 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}

/* Farbdisziplin fürs SVG: die Diagramme aus site_charts.py setzen ihre
   <text>-Elemente auf fill="currentColor" und tragen sonst keine eigene
   Textfarbe. Weil `color` vererbt, reicht die Deklaration hier auf body —
   jedes eingebettete Diagramm erbt automatisch dieselbe Textfarbe wie der
   Rest der Seite, in beiden Farbschemata. */

main, .kopf, .fuss {
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

main { padding-top: 2rem; padding-bottom: 4rem; }

/* --- Kopf ------------------------------------------------------------- */
.kopf {
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--linie);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}
.marke {
  font: 600 1.05rem/1 var(--serif);
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
}
.kopf nav { display: flex; gap: 1.25rem; font-size: .92rem; }
.kopf nav a {
  color: var(--gedaempft);
  text-decoration: none;
}
.kopf nav a:hover, .kopf nav a:focus-visible { color: var(--text); }

/* --- Grundtypografie ---------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: clamp(1.7rem, 4.4vw, 2.3rem); margin: 0 0 .9rem; }
h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); margin: 2.2rem 0 .7rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }

p { margin: 0 0 1rem; max-width: var(--messung); }
main > p:only-of-type { max-width: none; }

ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; max-width: var(--messung); }
li { margin: .25rem 0; }

a { color: var(--akzent); text-underline-offset: .15em; }
a:hover, a:focus-visible { text-decoration-thickness: 2px; }

strong { font-weight: 600; }

/* Anschriftenblock auf Impressum und Datenschutz. font-style: normal, weil
   <address> in allen Browsern kursiv voreingestellt ist — eine Anschrift ist
   kein Zitat. */
address {
  font-style: normal;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 4px;
  padding: .8rem 1rem;
  margin: 0 0 1rem;
  max-width: var(--messung);
}

code {
  font: .88em/1 var(--mono);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 4px;
  padding: .12em .35em;
}
pre {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: .88rem;
}
pre code { background: none; border: 0; padding: 0; }

blockquote {
  margin: 1rem 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--linie-stark);
  color: var(--gedaempft);
  max-width: var(--messung);
}

hr { border: none; border-top: 1px solid var(--linie); margin: 2rem 0; }

/* --- Die Hauptzahl -------------------------------------------------------
   Signaturmotiv der Seite: der doppelte Strich darunter zitiert die
   Summenzeile eines Kontoauszugs. Serif statt Monospace, damit die Zahl wie
   eine redaktionelle Feststellung wirkt und nicht wie eine tickende Uhr. */
.hauptzahl {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.015em;
  font-variant-numeric: tabular-nums lining-nums;
  margin: .2rem 0 1rem;
  padding-bottom: .35em;
  border-bottom: 4px double var(--linie-stark);
  display: inline-block;
}
.hauptzahl .einheit {
  font-family: var(--sans);
  font-size: .36em;
  font-weight: 400;
  color: var(--gedaempft);
  letter-spacing: 0;
}

/* --- Karten / Abschnitte -------------------------------------------------- */
.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 8px;
  padding: 1.4rem 1.4rem 1.5rem;
  margin: 1.5rem 0;
}
.karte > *:last-child { margin-bottom: 0; }

section { margin: 1.75rem 0; }

/* Zwei-Töpfe-Blöcke: STEUERZAHLER und STROMKUNDE bekommen bewusst
   dieselbe Umrandung — Neutralitätsregel 2 verbietet jede optische
   Rangfolge zwischen den beiden Kassen. */
.topf {
  border-left: 3px solid var(--akzent);
  padding: .1rem 0 .1rem 1.1rem;
  margin: 1.1rem 0;
}
.topf h3 { margin-top: 0; }

/* Sachliche Randbemerkung (Vorläufigkeits-Hinweis, Methodenhinweise) —
   zurückgenommen statt alarmierend: kein Rot, kein Gelb, kein Icon. */
.warnung {
  color: var(--gedaempft);
  font-size: .92rem;
  border-left: 2px solid var(--linie-stark);
  padding-left: .9rem;
  margin: 1rem 0;
  max-width: var(--messung);
}
.warnung:last-child { margin-bottom: 0; }

/* --- Diagramme -------------------------------------------------------- */
svg { max-width: 100%; }

/* --- Tabellen ------------------------------------------------------------ */
.tabelle-scroll { overflow-x: auto; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: .93rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: .5rem .7rem .5rem 0;
  border-bottom: 1px solid var(--linie);
  white-space: nowrap;
}
th {
  font-weight: 600;
  color: var(--gedaempft);
  border-bottom: 1px solid var(--linie-stark);
}

/* --- Fuß ------------------------------------------------------------------ */
.fuss {
  border-top: 1px solid var(--linie);
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  margin-top: 2.5rem;
  color: var(--gedaempft);
  font-size: .88rem;
}
.fuss p { margin: 0 0 .5rem; max-width: none; }
.fuss a { color: inherit; }
.stand { font-variant-numeric: tabular-nums; }

/* --- Zugänglichkeit -------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* --- Schmale Displays: Priorität liegt auf dem Telefon, nicht dem Desktop -- */
@media (max-width: 30rem) {
  body { font-size: 16px; }
  .karte { padding: 1.1rem 1rem 1.2rem; margin: 1.1rem -0.1rem; }
  th, td { padding-right: .5rem; }
}
