/* meteo365 v4 — Wetterstationen (Übersicht + Detail)
   Design-Haltung: ruhig, editorial, daten-first. Monochrome Lagune-Neutrals,
   EINE warme Akzentfarbe (Sonne) sehr sparsam. Keine bunten Kacheln, keine
   Regenbogen-Charts. Haarlinien statt Farbflächen. Grosse, leichte Typo.
   Erbt Farben aus tokens.css (LIGHT :root + BLUE [data-theme="dark"]). */

.stations-page,
.station-detail {
  /* Page-lokale, aus den globalen Tokens abgeleitete Werte */
  --st-card:        var(--surface);
  --st-card-2:      var(--bg-elev);
  --st-ink:         var(--text);
  --st-muted:       var(--muted);
  --st-line:        var(--line);
  --st-accent:      var(--accent);           /* Sonne — nur Akzent, sparsam */
  --st-radius:      18px;
  --st-radius-sm:   12px;
  --st-gap:         clamp(14px, 2.4vw, 22px);
  --st-pad:         clamp(18px, 2.8vw, 30px);
}

/* ============================================================= *
 *  Gemeinsame Bausteine
 * ============================================================= */
.st-wrap { max-width: 1080px; margin-inline: auto; padding-inline: clamp(14px, 3vw, 22px); }

.st-eyebrow {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--st-muted); font-weight: 600; margin: 0 0 .5em;
}

.st-card {
  background: var(--st-card);
  border: 1px solid var(--st-line);
  border-radius: var(--st-radius);
  box-shadow: var(--shadow-soft);
}

.st-back {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: 13.5px; color: var(--st-muted); text-decoration: none;
  padding: 6px 0; margin: 4px 0 10px; transition: color var(--t) var(--ease);
}
.st-back:hover { color: var(--st-ink); }

/* Frische-Pille: neutraler Rahmen, farbiger Punkt ist der EINZIGE Farbträger */
.st-fresh {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: 12.5px; font-weight: 500; color: var(--st-muted);
  border: 1px solid var(--st-line); border-radius: var(--radius-pill);
  padding: 4px 11px 4px 9px; white-space: nowrap;
}
.st-fresh__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #38b26b; box-shadow: 0 0 0 3px rgba(56,178,107,.16);
  flex: 0 0 auto;
}
.st-fresh--stale .st-fresh__dot { background: var(--st-accent); box-shadow: 0 0 0 3px var(--accent-soft-bg); }
.st-fresh--old   .st-fresh__dot { background: var(--st-muted); box-shadow: none; }

/* ============================================================= *
 *  ÜBERSICHT  (/wetterstationen/)
 * ============================================================= */
.stations-page { padding-block: clamp(18px, 4vw, 40px) 64px; }

.stations-hero { margin-bottom: clamp(20px, 4vw, 36px); }
.stations-hero__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.6vw, 40px); font-weight: 600; line-height: 1.08;
  letter-spacing: -.01em; margin: .18em 0 .32em; color: var(--st-ink);
}
.stations-hero__lede {
  font-size: clamp(14.5px, 1.6vw, 16.5px); line-height: 1.6;
  color: var(--st-muted); max-width: 62ch; margin: 0;
}

.stations-region { margin-top: clamp(24px, 4vw, 40px); }
.stations-region__head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 12px; margin-bottom: 18px;
  border-bottom: 1px solid var(--st-line);
}
.stations-region__name {
  font-size: 16px; font-weight: 600; letter-spacing: -.005em; color: var(--st-ink); margin: 0;
}
.stations-region__count { font-size: 12.5px; color: var(--st-muted); font-variant-numeric: tabular-nums; }

.stations-grid {
  display: grid; gap: var(--st-gap);
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}

/* Stations-Karte: ruhig, Haarlinie, sanfter Lift beim Hover */
.st-tile {
  position: relative; display: flex; flex-direction: column;
  min-height: 168px; padding: 18px 18px 16px;
  background: var(--st-card); border: 1px solid var(--st-line);
  border-radius: var(--st-radius); text-decoration: none; color: var(--st-ink);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  overflow: hidden;
}
.st-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--st-accent) 34%, var(--st-line));
}
.st-tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.st-tile__place { min-width: 0; }
.st-tile__name {
  font-size: 15px; font-weight: 600; line-height: 1.25; margin: 0;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.st-tile__meta { font-size: 11.5px; color: var(--st-muted); margin-top: 3px; }

.st-tile__temp {
  margin-top: auto; display: flex; align-items: flex-end; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.st-tile__temp-val {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(38px, 7vw, 46px); line-height: .95; letter-spacing: -.02em;
}
.st-tile__temp-unit { font-size: 15px; color: var(--st-muted); font-weight: 500; padding-bottom: 6px; }

.st-tile__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--st-line);
  font-size: 12px; color: var(--st-muted);
}
.st-tile__wind { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.st-tile__wind svg { width: 14px; height: 14px; opacity: .8; }
.st-tile__dot { width: 7px; height: 7px; border-radius: 50%; background: #38b26b; flex: 0 0 auto; }
.st-tile__dot--stale { background: var(--st-accent); }
.st-tile__dot--old   { background: var(--st-muted); }
.st-tile--own::after {  /* dezenter Eigen-Station-Marker: schmaler Akzentstrich links */
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
  border-radius: 3px; background: var(--st-accent); opacity: .0; transition: opacity var(--t) var(--ease);
}
.st-tile--own:hover::after { opacity: .55; }
.st-tile__loading { color: var(--st-muted); font-size: 13px; }

/* ============================================================= *
 *  DETAIL  (/wetterstationen/<slug>/)
 * ============================================================= */
.station-detail { padding-block: clamp(14px, 3vw, 28px) 64px; }

.station-hero { padding: clamp(20px, 3vw, 30px); }
.station-hero__row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.station-hero__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 36px); font-weight: 600; line-height: 1.08;
  letter-spacing: -.015em; margin: .1em 0 0; color: var(--st-ink);
}
.station-hero__sub { font-size: 13.5px; color: var(--st-muted); margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.station-hero__sub b { font-weight: 600; color: var(--st-ink); }

/* Primär-Ablesung: riesige, ruhige Temperatur (Textfarbe, NICHT eingefärbt) */
.station-primary {
  display: grid; grid-template-columns: 1fr auto; gap: clamp(18px, 3vw, 34px);
  align-items: center; margin-top: clamp(18px, 3vw, 26px);
  padding: clamp(20px, 3vw, 32px);
}
.station-now { display: flex; align-items: flex-start; gap: 14px; }
.station-now__val {
  font-family: var(--font-display); font-weight: 250;
  font-size: clamp(72px, 15vw, 120px); line-height: .86; letter-spacing: -.035em;
  color: var(--st-ink); font-variant-numeric: tabular-nums;
}
.station-now__unit { font-size: clamp(22px, 4vw, 30px); color: var(--st-muted); font-weight: 400; margin-top: .35em; }
.station-now__trend {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 13px; color: var(--st-muted); font-variant-numeric: tabular-nums;
}
.station-now__trend svg { width: 16px; height: 16px; }

/* Wind-Kompass: monochrom, dünner Ring, EIN Akzent-Zeiger */
.station-compass { width: clamp(150px, 30vw, 188px); aspect-ratio: 1; margin-inline: auto; }
.station-compass svg { width: 100%; height: 100%; display: block; }
.st-cmp-ring   { fill: none; stroke: var(--st-line); stroke-width: 1.5; }
.st-cmp-tick   { stroke: var(--st-muted); opacity: .5; }
.st-cmp-tick--card { stroke: var(--st-ink); opacity: .55; }
.st-cmp-card   { fill: var(--st-muted); font-size: 9px; font-weight: 600; letter-spacing: .04em; }
.st-cmp-needle { fill: var(--st-accent); }
.st-cmp-needle-tail { fill: var(--st-muted); opacity: .35; }
.st-cmp-val    { fill: var(--st-ink); font-family: var(--font-display); font-weight: 500; font-size: 19px; }
.st-cmp-unit   { fill: var(--st-muted); font-size: 9.5px; letter-spacing: .05em; }

/* Metrik-Raster: Haarlinien, keine Farbflächen */
.station-metrics {
  margin-top: var(--st-gap);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border: 1px solid var(--st-line); border-radius: var(--st-radius);
  overflow: hidden; background: var(--st-card);
}
.st-metric {
  padding: 16px 18px; border-right: 1px solid var(--st-line); border-bottom: 1px solid var(--st-line);
}
.st-metric__label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--st-muted); font-weight: 600; margin-bottom: 9px;
}
.st-metric__label svg { width: 14px; height: 14px; opacity: .7; }
.st-metric__val {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(22px, 3vw, 27px); letter-spacing: -.01em; color: var(--st-ink);
  font-variant-numeric: tabular-nums;
}
.st-metric__val small { font-size: 13px; color: var(--st-muted); font-weight: 500; margin-left: 3px; }

/* 6-Stunden-Verlauf: EIN Strich, dezente Fläche, ein Akzent-Punkt „jetzt" */
.station-chart { margin-top: var(--st-gap); padding: clamp(18px, 2.6vw, 26px); }
.station-chart__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px;
}
.station-chart__title { font-size: 14px; font-weight: 600; color: var(--st-ink); margin: 0; }
.station-chart__switch { display: inline-flex; gap: 2px; border: 1px solid var(--st-line); border-radius: var(--radius-pill); padding: 2px; }
.st-chip {
  border: 0; background: transparent; color: var(--st-muted); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: var(--radius-pill);
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.st-chip.is-active { background: var(--st-ink); color: var(--st-card); }
.station-chart__svg { width: 100%; height: 168px; display: block; overflow: visible; }
.st-ch-area   { fill: url(#stChGrad); }
.st-ch-line   { fill: none; stroke: var(--brand-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .st-ch-line { stroke: var(--brand-cyan); }
.st-ch-grid   { stroke: var(--st-line); stroke-width: 1; }
.st-ch-lbl    { fill: var(--st-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.st-ch-now    { fill: var(--st-accent); stroke: var(--st-card); stroke-width: 2; }
.st-ch-val    { fill: var(--st-ink); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Standort / Meta / Nachbarn */
.station-foot {
  margin-top: var(--st-gap); display: grid; gap: var(--st-gap);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.station-info { padding: clamp(18px, 2.4vw, 24px); }
.station-info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; }
.station-info dt { font-size: 12.5px; color: var(--st-muted); }
.station-info dd { margin: 0; font-size: 13.5px; color: var(--st-ink); font-variant-numeric: tabular-nums; text-align: right; }
.station-info__link {
  display: inline-flex; align-items: center; gap: .4em; margin-top: 16px;
  font-size: 13px; font-weight: 600; color: var(--st-accent); text-decoration: none;
}
.station-info__link:hover { text-decoration: none; }

.station-nearby { padding: clamp(18px, 2.4vw, 24px); }
.station-nearby__list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.st-near {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 6px; text-decoration: none; color: var(--st-ink);
  border-bottom: 1px solid var(--st-line); transition: padding var(--t) var(--ease);
}
.st-near:last-child { border-bottom: 0; }
.st-near:hover { padding-inline: 12px 0; }
.st-near__name { font-size: 13.5px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-near__meta { font-size: 12px; color: var(--st-muted); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.st-near__km { opacity: .7; }
.st-near__temp { color: var(--st-ink); font-weight: 600; min-width: 26px; text-align: right; }

/* ============================================================= *
 *  Erweiterungen: Chart-Varianten, Tendenz, Heute, Streifen,
 *  Windrose, Rekorde (History-API Server 43)
 * ============================================================= */

/* Variablen-Chip-Reihe unter den Zeitraum-Chips */
.station-chart__vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }

/* Chart-Zusätze */
.st-ch-band { fill: var(--brand-deep); opacity: .08; }
[data-theme="dark"] .st-ch-band { fill: var(--brand-cyan); opacity: .10; }
.st-ch-sec  { fill: none; stroke: var(--st-muted); stroke-width: 1.3; stroke-dasharray: 3 3; opacity: .6; }
.st-ch-bar  { fill: var(--brand-deep); opacity: .82; }
[data-theme="dark"] .st-ch-bar { fill: var(--brand-cyan); }

/* Drucktendenz (inline im Metrik-Wert) */
.st-tend { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--st-muted); margin-left: 8px; }
.st-tend svg { width: 13px; height: 13px; }
.st-tend--rising  { color: #d1663a; }
.st-tend--falling { color: #2f86b3; }
[data-theme="dark"] .st-tend--rising  { color: #f0a06a; }
[data-theme="dark"] .st-tend--falling { color: var(--brand-cyan); }

/* Heute-Kennzahlen */
.station-today { padding: clamp(16px, 2.2vw, 22px); }
.station-today__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 6px; }
.st-today { display: flex; flex-direction: column; gap: 4px; }
.st-today__lbl { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--st-muted); font-weight: 600; }
.st-today__val { font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 3vw, 25px); color: var(--st-ink); font-variant-numeric: tabular-nums; }
.st-today__val small { font-size: 12px; color: var(--st-muted); font-weight: 500; }

/* 7-Tage-Streifen */
.station-strip { padding: clamp(16px, 2.2vw, 22px); }
.station-strip__row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 10px; }
.st-day { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.st-day__hi, .st-day__lo { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.st-day__hi { color: var(--st-ink); font-weight: 600; }
.st-day__lo { color: var(--st-muted); }
.st-day__track { position: relative; width: 6px; height: 96px; background: var(--st-line); border-radius: 3px; overflow: hidden; }
.st-day__bar { position: absolute; left: 0; right: 0; border-radius: 3px;
  background: linear-gradient(180deg, var(--st-accent), color-mix(in srgb, var(--brand-deep) 70%, var(--st-accent))); }
[data-theme="dark"] .st-day__bar { background: linear-gradient(180deg, var(--st-accent), var(--brand-cyan)); }
.st-day__rain { font-size: 11px; color: var(--st-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.st-day__rain.is-wet { color: var(--brand-deep); font-weight: 600; }
[data-theme="dark"] .st-day__rain.is-wet { color: var(--brand-cyan); }
.st-day__name { font-size: 11.5px; color: var(--st-muted); text-transform: capitalize; }

/* Windrose */
.station-rose { padding: clamp(18px, 2.4vw, 24px); }
.station-rose__svg { width: clamp(170px, 46vw, 220px); aspect-ratio: 1; margin: 6px auto 0; }
.station-rose__svg svg { width: 100%; height: 100%; display: block; }
.st-rose-petal { fill: var(--brand-deep); }
[data-theme="dark"] .st-rose-petal { fill: var(--brand-cyan); }
.st-rose-mid { fill: none; stroke: var(--st-line); stroke-width: 1; stroke-dasharray: 2 3; }

/* Rekorde */
.station-records { padding: clamp(18px, 2.4vw, 24px); }
.station-records__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 6px; }
.st-rec { display: flex; flex-direction: column; gap: 3px; }
.st-rec__lbl { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--st-muted); font-weight: 600; }
.st-rec__val { font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 2.6vw, 24px); color: var(--st-ink); font-variant-numeric: tabular-nums; }
.st-rec__meta { font-size: 11.5px; color: var(--st-muted); }

/* SEO-Textblock */
.station-seo { margin-top: clamp(28px, 5vw, 48px); max-width: 70ch; }
.station-seo h2 { font-size: 17px; font-weight: 600; color: var(--st-ink); margin: 0 0 .6em; }
.station-seo p { font-size: 14.5px; line-height: 1.72; color: var(--st-muted); margin: 0 0 1em; }

/* Ladezustand / Fehler */
.station-loading, .station-error {
  padding: 48px 20px; text-align: center; color: var(--st-muted); font-size: 14.5px;
}
.station-skeleton { animation: stPulse 1.4s var(--ease) infinite; }
@keyframes stPulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

@media (max-width: 640px) {
  .station-primary { grid-template-columns: 1fr; text-align: center; }
  .station-now { justify-content: center; }
  .station-compass { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-tile, .st-near, .st-chip, .st-back, .st-tile--own::after { transition: none; }
  .station-skeleton { animation: none; }
}

/* ---------- Stationssuche im Umkreis (js/stations-finder.js) ----------
   Die Stations-API kennt keinen Listen-Endpunkt, nur Umkreissuche — die Seite
   ist deshalb bewusst als Suche gebaut und nicht als Verzeichnis. */
.stf-block { margin: 46px 0 12px; }
.stf-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.stf-inputwrap { position: relative; flex: 1 1 280px; min-width: 0; }
.stf-input {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
  color: var(--text); font: inherit; font-size: 15px;
}
.stf-input::placeholder { color: var(--muted); }
.stf-input:focus { outline: none; border-color: var(--brand-cyan); }
.stf-btn {
  padding: 13px 20px; border-radius: var(--radius-sm); border: 1px solid var(--brand-cyan);
  background: var(--brand-cyan); color: #06232f; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.stf-btn--ghost { background: none; color: var(--text); border-color: var(--line); font-weight: 500; }
.stf-btn--ghost:hover { border-color: var(--brand-cyan); }

/* Vorschlagsliste */
.stf-sugg {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 40;
  background: #0b2b3d; border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.stf-sugg-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  padding: 10px 14px; background: none; border: 0; cursor: pointer; color: var(--text); font: inherit;
  border-bottom: 1px solid var(--line);
}
.stf-sugg-item:last-child { border-bottom: 0; }
.stf-sugg-item:hover { background: rgba(255, 255, 255, .07); }
.stf-sugg-n { font-size: 14px; font-weight: 600; }
.stf-sugg-c { font-size: 11.5px; color: var(--muted); }

/* Ergebnis */
.stf-out { margin-top: 20px; }
.stf-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stf-h { font-size: 19px; margin: 0; }
.stf-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.stf-note {
  padding: 15px 17px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px;
}
