/* Balkonwetter Dachau — globales Stylesheet
   Farbschema über CSS-Variablen, Hell/Dunkel per prefers-color-scheme (folgt Systemeinstellung) */

:root {
  --bg: #f6f9fb;
  --bg-elevated: #d9e0e6;
  --bar: #d9e0e6;
  --text: #1a242f;
  --muted: #4c5d6a;
  --accent: #1f6fb2;
  --accent-contrast: #ffffff;
  --line: #c3cdd5;
  --ok: #2f9e44;
  --warn: #e8a400;
  --crit: #d6433f;
  --graf-temp: #d6433f;
  --graf-taupunkt: #0072b2;
  --graf-feuchte: #2f9e44;
  --graf-druck: #a6529e;
  --graf-regen: #3fa7d6;
  --graf-wind: #e8a400;
  --graf-boe: #7a8a96;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e2a36;
    --bg-elevated: #24323f;
    --bar: #24323f;
    --text: #e8eef4;
    --muted: #9fb3c4;
    --accent: #5aa9e6;
    --accent-contrast: #0c161f;
    --line: #35475a;
    --ok: #4fce6e;
    --warn: #f2c14e;
    --crit: #ef6a63;
    --graf-temp: #ef6a63;
    --graf-taupunkt: #5aa9e6;
    --graf-feuchte: #4fce6e;
    --graf-druck: #cf8ac7;
    --graf-regen: #6bc0ea;
    --graf-wind: #f2c14e;
    --graf-boe: #9fb3c4;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

/* ---------- Kopfbereich / Navigation ---------- */

header.site-header {
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 24px;
}

.header-links {
  flex: 1 1 260px;
  min-width: 0;
}

.ueber-seite-kompakt {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 480px;
}

.ueber-seite-kompakt p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.ueber-seite-kompakt strong {
  color: var(--text);
}

.hobby-hinweis-zeile {
  margin: 2px 0 0 !important;
  font-weight: 600;
  color: var(--text) !important;
}

.site-titel {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.site-titel .name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-titel .ort {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Hamburger-Checkbox-Hack: kein JS nötig */
#nav-toggle { display: none; }

.nav-label {
  display: none;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text);
}

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 8px;
}

nav.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 6px;
  white-space: nowrap;
}

nav.site-nav a:hover {
  color: var(--text);
  background: rgba(127, 127, 127, 0.12);
}

nav.site-nav a[aria-current="page"] {
  color: var(--accent-contrast);
  background: var(--accent);
}

nav.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

@media (max-width: 700px) {
  .nav-label { display: inline-block; }

  nav.site-nav {
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.2s ease;
  }

  #nav-toggle:checked ~ nav.site-nav {
    max-height: 400px;
    margin-top: 8px;
  }

  nav.site-nav a { padding: 10px 12px; }
}

/* ---------- Inhalt ---------- */

main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 2000px;
  margin: 0;
  padding: 16px;
}

/* Jede Karte ist ein <details>, Inhalt standardmäßig offen (open-Attribut in HTML),
   damit auf Mobile wie Desktop ohne JavaScript alles sichtbar startet. */

/* Gesamtlayout: feste linke Spalte mit aktuellen Werten, rechts der Rest im Grid */
.layout-haupt {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spalte-aktuell {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Höhe wird per JS (layout-hoehe.js) auf die Almanach-Kartenhöhe gesetzt;
   die Vorhersage-Karte (2. Karte) wächst mit, die Aktuell-Karte bleibt kompakt */
.spalte-aktuell > .card:last-child {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.spalte-aktuell > .card:last-child > .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Erste Reihe: 3 gleich breite Spalten, auf Mobile gestapelt */
.erste-reihe {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spalte-drittel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Karten in diesen Spalten nehmen die volle verfügbare Höhe ihrer Spalte ein */
.karte-volle-hoehe,
.karte-halbe-hoehe {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.karte-volle-hoehe > .card-body,
.karte-halbe-hoehe > .card-body {
  flex: 1 1 auto;
}

.karte-volle-hoehe > .card-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.karte-volle-hoehe .blitzkarte-link {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 0;
  overflow: hidden;
}

/* Das Blitzkarten-Bild hat ein festes Seitenverhaeltnis (externe Live-Grafik) und
   wuerde bei width:100% je nach Spaltenbreite hoeher werden als die fest vorgegebene
   Kartenhoehe erlaubt - Flex-Kinder haben standardmaessig min-height:auto und wuerden
   die ganze Karte dadurch aufblaehen. object-fit haelt das Bild innerhalb der Flaeche. */
.karte-volle-hoehe .blitzkarte-bild {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.zweite-reihe {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
}

.card > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card > summary::-webkit-details-marker { display: none; }

.card > summary::before {
  content: "▸";
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 0.8em;
}

.card[open] > summary::before {
  transform: rotate(90deg);
}

.card > summary:hover { background: rgba(127, 127, 127, 0.08); }

.card > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.card .card-body {
  padding: 0 16px 16px;
}

/* Besonders wichtige Karte (aktuelle Werte): kein Aufklapp-Dreieck, immer prominent */
.card.card-primary > summary {
  cursor: default;
}

.card.card-primary > summary::before { content: ""; }

.platzhalter {
  color: var(--muted);
  font-style: italic;
}

/* Ab ca. Tablet-Breite: linke Spalte mit aktuellen Werten fest, rechts Mehrspalten-Grid,
   alle Karten gleichzeitig sichtbar (Aufklapp-Dreiecke werden rein kosmetisch, Inhalt bleibt
   wegen open-Attribut sichtbar) */
@media (min-width: 900px) {
  /* App-Shell: Kopf-/Fußbereich und linke Spalte bleiben fix, nur der rechte
     Kartenbereich scrollt für sich (wie bei einem Dashboard, nicht wie eine normale
     Webseite, bei der alles gemeinsam hoch-/runterscrollt) */
  html, body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .layout-haupt {
    flex-direction: row;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
  }

  .spalte-aktuell {
    flex: 0 0 360px;
    overflow-y: auto;
  }

  .card-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    min-width: 0;
  }

  /* Erste Reihe: 3 gleich breite Spalten nebeneinander, jeweils über die volle
     verfügbare Höhe (min-height: 100% der scrollenden Spalte = Höhe wie linke
     Spalte beim ersten Anblick ohne Scrollen). Regenradar+Warnungen teilen sich
     ihre Spalte hälftig. */
  .erste-reihe {
    flex-direction: row;
    align-items: stretch;
    min-height: 100%;
  }

  .spalte-drittel {
    flex: 1 1 0;
    min-width: 0;
  }

  .zweite-reihe {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
  }

  .zweite-reihe > .card {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .zweite-reihe > .card > .card-body {
    flex: 1 1 auto;
  }
}

/* ---------- Aktuelle Messwerte & Windrose ---------- */

.aktuell-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.graphik-reihe {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.aktuell-haupt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.aktuell-temp {
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1;
  transition: color 0.3s ease;
}

.aktuell-gefuehlt {
  color: var(--muted);
  font-size: 0.85rem;
}

.wertegitter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 10px;
  margin: 0 0 6px;
}

.wertegitter > div {
  display: flex;
  flex-direction: column;
}

.wertegitter dt {
  font-size: 0.75rem;
  color: var(--muted);
}

.wertegitter dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

.aktuell-temp.wert-steigt,
.wertegitter dd.wert-steigt {
  color: var(--ok);
  transition: none;
}

.aktuell-temp.wert-faellt,
.wertegitter dd.wert-faellt {
  color: var(--crit);
  transition: none;
}

.hinweis {
  color: var(--warn);
  font-size: 0.85rem;
}

.windrose-wrap,
.mond-wrap {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.windrose,
.al-mond-bild {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  height: auto;
}

.windrose-richtung,
.al-mond-phase-kurz {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.windrose-kreis {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
}

.windrose-kreis-innen {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  opacity: 0.5;
}

.windrose-label {
  font-size: 10px;
  fill: var(--muted);
  text-anchor: middle;
}

.windrose-nadel-spitze {
  fill: var(--accent);
}

.windrose-nadel-schaft {
  fill: var(--accent);
  opacity: 0.55;
}

.karte-ueber p {
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.karte-ueber p:last-child {
  margin-bottom: 0;
}

/* ---------- Vorhersage ---------- */

/* Feste, kompakte Maße statt vw-Skalierung: die Karte sitzt in der schmalen
   linken Spalte (360px), nicht über die volle Browserbreite — vw-Einheiten
   hätten hier (zu Recht) zu einem Überlauf geführt. */

.vorhersage-viertel-reihe {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
}

.vorhersage-viertel {
  padding: 10px 4px;
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.06);
}

.vorhersage-viertel-jetzt {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid var(--accent);
}

.vv-name {
  font-size: 0.68rem;
  color: var(--muted);
}

.vv-symbol {
  font-size: 1.3rem;
  margin: 2px 0;
}

.vv-temp {
  font-size: 0.85rem;
  font-weight: 600;
}

.vv-wind,
.vtk-wind {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.2;
}

.vorhersage-windpfeil {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.vorhersage-windpfeil-spitze {
  fill: var(--muted);
}

.vorhersage-windpfeil-schaft {
  fill: var(--muted);
  opacity: 0.55;
}

.vorhersage-naechste-tage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
}

.vorhersage-tag-kompakt {
  padding: 8px 4px;
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.06);
}

.vtk-name {
  font-size: 0.68rem;
  color: var(--muted);
}

.vtk-symbol {
  font-size: 1.1rem;
  margin: 1px 0;
}

.vtk-temp {
  font-size: 0.74rem;
}

.vorhersage-max {
  font-weight: 600;
}

.vorhersage-min {
  color: var(--muted);
  margin-left: 3px;
}

.vorhersage-quelle {
  margin-top: auto;
  margin-bottom: 0;
  font-size: 0.75rem;
}

/* ---------- Almanach & Mond ---------- */

.ereignisse-liste {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

.ereignisse-liste li {
  margin-bottom: 4px;
}

.almanach-ueberschrift {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--accent);
}

.almanach-ueberschrift:not(:first-child) {
  margin-top: 16px;
}

.almanach-liste {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-size: 0.85rem;
}

.almanach-liste > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}

.almanach-liste dt {
  color: var(--muted);
}

.almanach-liste dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* ---------- Blitzkarte ---------- */

.blitzkarte-link {
  display: block;
  text-align: center;
}

.blitzkarte-bild {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.blitzkarte-quelle {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.hobby-hinweis {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.1);
  border: 1px solid var(--line);
}

/* ---------- Fußbereich ---------- */

footer.site-footer {
  background: var(--bar);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 6px 16px;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 16px;
}

footer.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

footer.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

footer.site-footer .trenner {
  margin: 0 6px;
  opacity: 0.5;
}

/* ---------- Regenradar & Warnungen (Mini-Karten) ---------- */

.karte-karten-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.karte-halbe-hoehe > .karte-karten-body {
  flex: 1 1 0;
}

.karte-hauptzeile {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.karte-mini-ausloeser {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 90px;
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.karte-seitenspalte {
  flex: 0 0 auto;
  width: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 6px;
}

.karte-info-link {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.78rem;
  padding: 6px 10px;
  cursor: pointer;
  text-align: center;
}

.karte-schritt-liste {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.karte-schritt-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  opacity: 0.45;
}

.karte-schritt-zeit {
  flex: 1 1 auto;
  text-align: left;
}

.karte-schritt-temp {
  flex: 0 0 auto;
  font-weight: 700;
}

.karte-schritt-niederschlag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
}

.karte-schritt-btn:hover {
  background: rgba(127, 127, 127, 0.1);
}

.karte-schritt-btn.ist-aktiv {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

.karte-info-link:hover {
  background: rgba(127, 127, 127, 0.1);
  border-color: var(--accent);
}

.karte-mini-ausloeser:hover {
  border-color: var(--accent);
}

.karte-mini-ausloeser:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.karte-mini {
  position: absolute;
  inset: 0;
  background: var(--bar);
}

.wolken-marker,
.temp-marker {
  background: none;
  border: none;
}

.temp-marker-inhalt {
  display: inline-block;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 0 2px #000;
  transform: translate(-50%, -50%);
}

.wolken-marker-inhalt {
  display: inline-block;
  white-space: nowrap;
  background: rgba(20, 26, 32, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  transform: translate(-50%, -50%);
}

.karte-mini-hinweis {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 500;
  background: rgba(20, 26, 32, 0.72);
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
}

.karten-quelle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.warnungen-status {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.warn-eintrag {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.warn-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex: 0 0 auto;
}

.warn-headline {
  margin: 0;
  font-weight: 600;
  color: var(--warn);
  font-size: 0.85rem;
}

.warn-gueltig {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------- Karten-Großansicht (Lightbox) ---------- */

.karten-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.karten-overlay[hidden] {
  display: none;
}

body.karten-overlay-offen {
  overflow: hidden;
}

.karten-overlay-box {
  background: var(--bg-elevated);
  border-radius: 12px;
  width: min(1100px, 100%);
  height: min(820px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.karten-overlay-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.karten-overlay-titel {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.karten-overlay-schliessen {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}

.karten-overlay-schliessen:hover {
  background: rgba(127, 127, 127, 0.12);
}

.karten-overlay-karte {
  flex: 1 1 auto;
  min-height: 0;
}

.wetterradar-karte-flaeche {
  position: relative;
}

.wetterradar-leaflet-wrap,
.wetterradar-windy-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.radar-layer-umschalter {
  display: flex;
  gap: 8px;
}

.radar-layer-btn {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  opacity: 0.55;
}

.radar-layer-btn:hover {
  background: rgba(127, 127, 127, 0.1);
}

.radar-layer-btn.ist-aktiv {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

.radar-regen-steuerung {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-regen-steuerung[hidden],
.radar-wolken-steuerung[hidden] {
  display: none;
}

.karten-overlay-footer {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 700px) {
  .karten-overlay-box {
    height: 92vh;
  }
}

/* ---------- Regenradar-Zeitleiste (in der Großansicht) ---------- */

.radar-zeitleiste {
  display: flex;
  align-items: center;
  gap: 10px;
}

.radar-play {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  font-size: 0.9rem;
}

.radar-schieber {
  flex: 1 1 auto;
}

.radar-zeit-label {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 90px;
  text-align: right;
}

.karten-quelle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.radar-legende {
  height: 90px;
  width: auto;
  border-radius: 4px;
}

/* ---------- Warnungen-Legende (in der Großansicht) ---------- */

.warn-legende {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.warn-legende-titel {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.warn-legende-eintrag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.warn-legende-eintrag i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.warn-arten-liste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  max-height: 96px;
  overflow-y: auto;
}

.warn-art-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warn);
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  opacity: 0.45;
}

.warn-art-toggle.ist-aktiv {
  opacity: 1;
  border-color: var(--warn);
}

.warn-art-toggle:hover {
  background: rgba(127, 127, 127, 0.18);
}

.warn-art-gueltig {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.72rem;
}

/* ---------- Tagesgraphen ---------- */

.graf-karten-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.graf-flaeche {
  flex: 1 1 auto;
  min-height: 180px;
  min-width: 0;
}

.graf-flaeche .u-legend {
  font-size: 0.72rem;
  color: var(--muted);
}

.graf-flaeche .u-label {
  color: var(--text);
}

/* Unterseiten, die noch nicht neu gebaut sind: alte weewx-Reports per iframe eingebunden */
.alte-seite-hinweis {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}
.alte-seite-iframe {
  width: 100%;
  min-height: 600px;
  border: 0;
  display: block;
}

/* "Time"-Zeile (x-Serie) in der uPlot-Legende ist redundant zur Zeitachse - ausblenden.
   Y-Achsen-Beschriftung (°C/hPa/%/m/s) bleibt unberührt, die steht an der Achse, nicht
   in der Legende. */
.graf-flaeche .u-legend tr:first-child {
  display: none;
}

/* Besondere Ereignisse: zwei Zeilen pro Eintrag (Sichtbarkeitsfenster + Text) */
.ereignisse-liste li {
  margin-bottom: 6px;
  line-height: 1.3;
}
.ereignis-zeitfenster {
  font-weight: 600;
  color: var(--text);
}
.ereignis-text {
  color: var(--muted);
}

/* Hinweis-Pfeil: zeigt an, dass im Kartenbereich (rechts) noch mehr Inhalt unten folgt.
   Nur auf Desktop relevant, da dort nur .card-grid für sich scrollt (siehe
   layout-hoehe.js für die Sichtbarkeits-Logik). */
@media (min-width: 900px) {
  .layout-haupt {
    position: relative;
  }

  .scroll-hinweis {
    position: absolute;
    right: 24px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    animation: scroll-hinweis-wippen 1.6s ease-in-out infinite;
    z-index: 5;
  }

  .scroll-hinweis[hidden] {
    display: none;
  }
}

@keyframes scroll-hinweis-wippen {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
