/* ═══════════════════════════════════════════════════════════════════════════
   Waldfilm Karte – CI (Farben, Schrift) und Klima-Thema
   Lädt nach style.css und überschreibt dort nur die Grundfarben.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #121212;
  --bg-2: #181818;
  --panel: #1f1f1f;
  --panel-2: #282828;
  --line: #343434;
  --text: #f2f2f2;
  --muted: #a7a7a7;
  --accent: #43a83e;
  --accent-2: #5cc457;
  --trocken: #c2410c;
  --nass: #3b82f6;
}

body { font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); }

/* ── Kopfzeile ──────────────────────────────────────────────────────────── */
.brand-logo-link { display: flex; align-items: center; flex: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.tab.is-active { color: #fff; }

.themen {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line); flex: none;
}
.thema {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700;
  font-size: .86rem; padding: .38rem .9rem; border-radius: 999px; cursor: pointer;
}
.thema:hover { color: var(--text); }
.thema.is-active { background: var(--text); color: #121212; }

/* Reiter und Werkzeuge des jeweils anderen Themas ausblenden */
body[data-thema="klima"] .tab[data-thema="energie"],
body[data-thema="energie"] .tab[data-thema="klima"],
body:not([data-thema]) .tab[data-thema="klima"],
body[data-thema="klima"] .nur-energie { display: none !important; }

/* ── Klima-Karte ────────────────────────────────────────────────────────── */
#kmap { position: absolute; inset: 0; background: #0d0d0d; }
.kebenen { display: flex; flex-direction: column; gap: 4px; margin-bottom: .8rem; }
.kebene {
  text-align: left; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: .88rem; padding: .45rem .65rem; border-radius: 9px; cursor: pointer;
}
.kebene small { display: block; color: var(--muted); font-size: .76rem; }
.kebene.is-active { border-color: var(--accent); background: rgba(67, 168, 62, .14); }
.klegende { display: grid; grid-template-columns: 18px 1fr; gap: 3px 8px; font-size: .8rem; align-items: center; margin-bottom: .5rem; }
.klegende i { width: 18px; height: 12px; border-radius: 3px; display: block; }

.kbl { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; }
.kbl button {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  border: 0; background: transparent; color: var(--text); font: inherit; padding: .28rem .2rem;
  border-radius: 6px; cursor: pointer; text-align: left;
}
.kbl button:hover { background: var(--panel-2); }
.kbl .wert { font-variant-numeric: tabular-nums; color: var(--muted); }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

.kort-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.kort-kopf h2 { margin: 0; }
.kort-zu { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.kwerte { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: .7rem 0; }
.kwert { background: var(--bg-2); border-radius: 9px; padding: .45rem .6rem; }
.kwert b { display: block; font-size: 1.15rem; }
.kwert span { font-size: .74rem; color: var(--muted); }
.kstufe { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #121212; }

.leaflet-tooltip.ktip {
  background: #1f1f1f; color: #f2f2f2; border: 1px solid #3a3a3a; border-radius: 8px;
  font-family: 'Manrope', sans-serif; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.leaflet-tooltip.ktip::before { display: none; }

/* ── Diagramme ──────────────────────────────────────────────────────────── */
.kchart { width: 100%; height: auto; display: block; overflow: visible; }
.kchart text { fill: var(--muted); font-size: 11px; font-family: 'Manrope', sans-serif; }
.kchart .achse { stroke: var(--line); }
.kchart .norm { stroke: var(--text); stroke-width: 1.6; fill: none; stroke-dasharray: 4 3; }
.kchart .linie { stroke: var(--accent); stroke-width: 2; fill: none; }
.kchart .hl { fill: var(--text); font-weight: 700; }
.kchart rect:hover, .kchart circle:hover { opacity: .75; }
.kchart-legende { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
.kchart-legende i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.kchart-legende i.strich { height: 0; border-top: 2px dashed var(--text); border-radius: 0; }

.kgross { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: .2rem 0 .3rem; }
.hero.trocken { border-left: 4px solid var(--trocken); }
.hero.warm { border-left: 4px solid #dc2626; }
.hero.gruen { border-left: 4px solid var(--accent); }

.ktab { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.ktab th, .ktab td { padding: .42rem .5rem; border-bottom: 1px solid var(--line); text-align: right; }
.ktab th:first-child, .ktab td:first-child { text-align: left; }
.ktab th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.ktab-wrap { overflow-x: auto; }

.e-schalter { display: flex; flex-wrap: wrap; gap: 6px; margin: .3rem 0 .8rem; }
.e-schalter button {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit;
  font-size: .84rem; padding: .3rem .75rem; border-radius: 999px; cursor: pointer;
}
.e-schalter button.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.deflist dl { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: .7rem 1.2rem; margin: 0; }
.deflist dt { font-weight: 700; }
.deflist dd { margin: 0; color: var(--muted); }
.deflist a { color: var(--accent-2); }
@media (max-width: 640px) {
  .deflist dl { grid-template-columns: 1fr; gap: .2rem; }
  .deflist dd { margin-bottom: .7rem; }
  .brand-logo { height: 26px; }
}

/* ── Vorher-Nachher-Schieber ────────────────────────────────────────────── */
.leaflet-vergleich-pane canvas { pointer-events: none !important; }
.kswipe {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; z-index: 650;
  background: transparent; -webkit-appearance: none; appearance: none; pointer-events: none; outline: none;
}
.kswipe::-webkit-slider-runnable-track { background: transparent; height: 100%; }
.kswipe::-moz-range-track { background: transparent; height: 100%; }
.kswipe::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 40px; height: 40px; border-radius: 50%; margin-top: 0;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6' fill='none' stroke='%23121212' stroke-width='2.2'/%3E%3C/svg%3E") center/22px no-repeat;
  box-shadow: 0 2px 10px rgba(0,0,0,.5); cursor: ew-resize; pointer-events: auto;
}
.kswipe::-moz-range-thumb {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.5);
  cursor: ew-resize; pointer-events: auto;
}
.kswipe-linie { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; z-index: 640; pointer-events: none; box-shadow: 0 0 6px rgba(0,0,0,.6); }
.kswipe-label {
  position: absolute; top: 12px; z-index: 640; pointer-events: none; background: rgba(18,18,18,.85); color: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: .25rem .8rem; font-weight: 800; font-size: 1rem;
}
.kswipe-label.links { left: 56px; }
.kswipe-label.rechts { right: 12px; }
.kswipe[hidden], .kswipe-linie[hidden], .kswipe-label[hidden] { display: none; }

.kcheck { display: flex; gap: .5rem; align-items: center; font-weight: 700; font-size: .9rem; cursor: pointer; }
.leaflet-tooltip.kstation {
  background: transparent; border: 0; box-shadow: none; color: #fff; font-weight: 800; font-size: 12px; padding: 0;
  font-family: 'Manrope', sans-serif;
}
.leaflet-tooltip.kstation::before { display: none; }

/* ── Ursachen & Folgen ──────────────────────────────────────────────────── */
.f-abschnitt { font-size: 1.45rem; margin: 2.2rem 0 .9rem; scroll-margin-top: 1rem; }
.f-karte, .f-folge { position: relative; scroll-margin-top: 1rem; }
.f-karte { padding-left: 4.2rem; }
.f-nr {
  position: absolute; left: 1.2rem; top: 1.25rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center;
}
.f-zahlen { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 1rem 0; }
.f-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.f-raster .card { margin: 0; }
.f-folge h3 { margin: 0 0 .5rem; font-size: 1.08rem; }
.f-folge .kwerte { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.f-folge p { font-size: .9rem; }
#f-wasserkraft { grid-column: 1 / -1; }

.f-kette { display: flex; align-items: stretch; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; }
.f-stufe { display: flex; flex-direction: column; gap: .5rem; min-width: 150px; flex: 1; }
.f-stufe-titel { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.f-pfeil { display: grid; place-items: center; color: var(--muted); font-size: 1.4rem; flex: none; }
.f-glied {
  display: block; text-decoration: none; color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-left: 4px solid var(--line); border-radius: 10px; padding: .55rem .7rem; transition: background .15s;
}
.f-glied:hover { background: var(--panel-2); }
.f-glied b { display: block; font-size: .92rem; }
.f-glied span { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.f-glied.ursache { border-left-color: #dc2626; }
.f-glied.verstaerker { border-left-color: #f97316; }
.f-glied.folge { border-left-color: #4b8de8; }
@media (max-width: 760px) {
  .f-kette { flex-direction: column; }
  .f-pfeil { transform: rotate(90deg); }
  .f-karte { padding-left: 1.2rem; padding-top: 3.6rem; }
  .f-raster { grid-template-columns: 1fr; }
}
