/* station-values.css — Darstellung der Messwerte einer Wetterstation.
   Gehoert zu js/meteo-station-values.js. Wird auf der Wetter-Detailseite
   (Reiter „Station" + Tabelle der Nachbarstationen) und auf /wetterstationen/
   benutzt — deshalb Komponente statt Seiten-CSS.

   Bewusst andere Anmutung als die Prognose-Bloecke: Messwerte sind Fakten,
   keine Rechnung. Darum ruhiger, monospaced, ohne Farbverlaeufe. */

.msv { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Kopf: Temperatur, Feuchte-Paar, Windrose ---------- */
.msv-hero {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 20px 22px;
  background: var(--fc-glass, rgba(255, 255, 255, .07));
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
/* Linke Spalte: grosse Temperatur, darunter die Farbskala. */
.msv-hero-main { display: flex; flex-direction: column; gap: 0; min-width: 200px; }
.msv-hero-temp {
  font-family: var(--font-mono); font-size: 54px; line-height: 1;
  letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums;
}
/* Skala sitzt unter der Temperatur, auf deren Breite begrenzt (nicht ueber alles). */
.msv-hero-main .fc-airsc { margin-top: 14px; max-width: 240px; }
.msv-hero-side { display: flex; flex-direction: column; gap: 7px; min-width: 190px; }
.msv-hero-row {
  display: flex; justify-content: space-between; gap: 14px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
}
.msv-hero-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Wind im Kopf: Kompass + Richtung + Wind/Böen (alles, was frueher teils in den
   Kacheln stand). Rechts ausgerichtet neben Temperatur und Feuchte-Paar. */
.msv-hero-wind { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.msv-hero-windtxt { display: flex; flex-direction: column; gap: 1px; font-family: var(--font-mono); }
.msv-wind-card { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: .03em; white-space: nowrap; }
.msv-wind-deg { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.msv-wind-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.msv-wrow { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; }
.msv-wrow span { color: var(--muted); }
.msv-wrow b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Windkompass (Randpfeil nach innen, nach Beaufort gefaerbt) — groesser, es hat Platz. */
.msv-dial { width: 104px; height: 104px; flex: none; }
.msv-dial-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.msv-dial-tick { stroke: var(--muted); stroke-width: 1.5; opacity: .55; stroke-linecap: round; }
.msv-dial-n {
  fill: var(--muted); font-family: var(--font-mono); font-size: 9px;
  text-anchor: middle; letter-spacing: .08em;
}
.msv-dial-hub { fill: var(--text); opacity: .8; }

/* ---------- Kachelraster ---------- */
.msv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.msv-tile {
  background: var(--fc-glass-2, rgba(255, 255, 255, .05));
  padding: 13px 15px; display: flex; flex-direction: column; gap: 5px;
}
.msv-k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.msv-v {
  font-family: var(--font-mono); font-size: 17px; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
/* Einheiten NICHT versalisieren — aus µg/m³ wuerde MG/M³ (Mikro→griechisches My). */
.msv-s { font-size: 11px; color: var(--muted); opacity: .85; line-height: 1.35; }

/* ---------- Niederschlag: eigener Block unter dem Raster ---------- */
.msv-rain {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--fc-glass-2, rgba(255, 255, 255, .05));
}
.msv-rain-k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.msv-rain-v {
  font-family: var(--font-mono); font-size: 24px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.msv-rain-s { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.msv-rain.is-wet { border-color: rgba(104, 194, 227, .45); }
.msv-rain.is-wet .msv-rain-v { color: var(--brand-cyan); }

/* ---------- Fussnoten ---------- */
.msv-stamp {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .02em;
}
.msv-stamp.is-stale { color: var(--accent); }
/* Link zur eigenen Stationsseite (Verlauf/Windrose/Historie). */
.msv-pagelink { margin-top: 10px; }
.msv-pagelink a {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em;
  color: var(--accent); text-decoration: none; font-weight: 600;
}
.msv-pagelink a:hover { text-decoration: none; }
.msv-empty {
  padding: 16px 18px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--muted);
}
.msv-metar summary {
  cursor: pointer; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.msv-metar code {
  display: block; margin-top: 8px; padding: 11px 13px;
  background: rgba(0, 0, 0, .22); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  word-break: break-word; line-height: 1.6;
}

/* ---------- Kompaktform (aufgeklappte Tabellenzeile) ---------- */
.msv--compact { gap: 12px; }
.msv--compact .msv-hero { padding: 15px 16px; gap: 18px; }
.msv--compact .msv-hero-temp { font-size: 38px; }
.msv--compact .msv-dial { width: 58px; height: 58px; }
.msv--compact .msv-grid { grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); }
.msv--compact .msv-tile { padding: 10px 12px; }
.msv--compact .msv-v { font-size: 15px; }
.msv--compact .msv-rain { padding: 11px 14px; }
.msv--compact .msv-rain-v { font-size: 19px; }

@media (max-width: 560px) {
  .msv-hero { gap: 16px; padding: 16px; }
  .msv-hero-temp { font-size: 44px; }
  /* Wind volle Zeile, sonst wird der Text rechts abgeschnitten („from the …"). */
  .msv-hero-wind { margin-left: 0; flex: 1 1 100%; }
  .msv-wind-card { white-space: normal; }
  .msv-rain-s { margin-left: 0; width: 100%; }
}

/* ---------- Stationsliste (Detailseite + /wetterstationen/) ----------
   Rasterzeilen statt <table>: die Zeile ist ein Button, das aufgeklappte Panel
   sitzt als eigenes Element darunter — in einer echten Tabelle waere dafuer eine
   Zeile mit colspan noetig, die auf Mobil sofort bricht. */
.msv-tbl { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.msv-tbl-head, .msv-tbl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 88px 92px 72px 22px;
  align-items: center; gap: 10px; text-align: left;
}
.msv-tbl-head {
  padding: 9px 14px; background: rgba(255, 255, 255, .04);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line);
}
.msv-tbl-row {
  width: 100%; padding: 12px 14px; background: none; border: 0; cursor: pointer;
  color: var(--text); font: inherit; border-bottom: 1px solid var(--line);
  transition: background .15s ease;
}
.msv-tbl-row:last-of-type { border-bottom: 0; }
.msv-tbl-row:hover { background: rgba(255, 255, 255, .05); }
.msv-tbl-row.is-open { background: rgba(255, 255, 255, .07); }
.msv-tbl-name {
  font-size: 13.5px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.msv-tbl-src {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .07em;
  color: var(--accent); text-transform: uppercase;
}
.msv-tbl-km, .msv-tbl-alt {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.msv-tbl-caret { color: var(--muted); font-size: 11px; transition: transform .18s ease; }
.msv-tbl-row.is-open .msv-tbl-caret { transform: rotate(180deg); }
.msv-tbl-panel { padding: 14px; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .14); }
.msv-tbl-panel:last-child { border-bottom: 0; }

/* Mobil: Höhe fällt weg, sie ist die entbehrlichste der vier Spalten. */
@media (max-width: 600px) {
  .msv-tbl-head, .msv-tbl-row { grid-template-columns: minmax(0, 1fr) 66px 78px 18px; }
  .msv-tbl-head span:nth-child(4), .msv-tbl-alt { display: none; }
  .msv-tbl-row { padding: 11px 12px; }
}

/* Temperatur-Farbskala unter der grossen Zahl (von der Komponente selbst gebaut,
   wenn der Aufrufer keine eigene mitgibt). */
.msv-sc { margin-top: 14px; max-width: 240px; }
.msv-sc-bar { position: relative; height: 7px; border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.msv-sc-knob { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  transform: translate(-50%, -50%); background: #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .28), 0 0 6px 1px rgba(255, 255, 255, .5); }
.msv-sc-lbl { display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  font-variant-numeric: tabular-nums; }

/* In schmalen Spalten (z. B. der Zwei-Spalten-Bereich der Cam-Seite) hat der
   dreispaltige Kopf keinen Platz mehr — dann Windteil unter Temperatur/Werte.
   Container-Queries waeren hier das richtige Werkzeug; bis die Basis steht,
   loest es der Viewport-Breakpoint. */
@media (max-width: 1180px) {
  .msv-hero { flex-wrap: wrap; }
  .msv-hero-side { flex: 1 1 100%; }
}
