/* Wetterkasten.
   Bewusst ohne feste Hintergrund- und Schriftfarben: alles leitet sich ueber
   currentColor und Transparenz vom Elternelement ab. Dadurch traegt der Kasten
   im hellen wie im dunklen Modus, ohne dunkelmodus.css anfassen zu muessen. */

.wtr-box {
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  background: color-mix(in srgb, currentColor 4%, transparent);
}

.wtr-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.wtr-titel {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.75;
}

.wtr-ortwahl {
  font-size: 16px; /* verhindert das Auto-Zoomen auf dem Handy */
  padding: 0.25rem 0.4rem;
  max-width: 60%;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: transparent;
  color: inherit;
}

/* Die aufgeklappte Liste zeichnet der Browser als eigenes Fenster. Sie erbt
   zwar die helle Schriftfarbe des Dunkelmodus, nicht aber den dunklen Grund -
   ohne eigene Farben steht Weiss auf Weiss. Deshalb hier feste Werte fuer
   alle drei Stufen des Umschalters. */
.wtr-ortwahl option {
  background: #ffffff;
  color: #16191d;
}

[data-thema="dunkel"] .wtr-ortwahl option {
  background: #232a33;
  color: #e6ecf2;
}

@media (prefers-color-scheme: dark) {
  html:not([data-thema="hell"]) .wtr-ortwahl option {
    background: #232a33;
    color: #e6ecf2;
  }
}

/* Hauptzeile: Zeichen, Temperatur, Wetterlage */
.wtr-zeile {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.wtr-zeichen { font-size: 1.9rem; line-height: 1; }

.wtr-grad {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.wtr-lage { opacity: 0.8; }

/* Windblock mit Nadel */
.wtr-wind {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

.wtr-nadel {
  flex: 0 0 auto;
  transition: transform 0.6s ease;
}

.wtr-windtext { line-height: 1.45; }
.wtr-windtext strong { font-variant-numeric: tabular-nums; }

.wtr-bft { opacity: 0.7; font-size: 0.88rem; }
.wtr-richtung { font-size: 0.92rem; }
.wtr-boe { font-size: 0.88rem; opacity: 0.8; }

.wtr-werte {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 0.7rem;
  font-size: 0.86rem;
  opacity: 0.8;
}

/* Amtliche Warnungen des DWD */
.wtr-warnungen { margin-bottom: 0.7rem; }

.wtr-warnung {
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  border-left: 4px solid currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.wtr-rang-2 { color: #a86a00; }
.wtr-rang-3 { color: #b3401a; }
.wtr-rang-4 { color: #9b1616; font-weight: 600; }

.wtr-fuss {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  opacity: 0.6;
}

.wtr-alt { opacity: 0.85; font-weight: 600; }

.wtr-laden, .wtr-stoerung { margin: 0; font-size: 0.9rem; opacity: 0.75; }

@media (max-width: 480px) {
  .wtr-grad { font-size: 1.7rem; }
  .wtr-ortwahl { max-width: 55%; }
  .wtr-werte { gap: 0.25rem 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wtr-nadel { transition: none; }
}
