/*
 * Gestaltung für alle Seiten der Wetterstation (Apple-orientiert, Hell/Dunkel).
 * Farbrollen nach der dataviz-Referenzpalette; Slot 1 (Blau) und Slot 2 (Orange) sind für
 * hell und dunkel mit validate_palette geprüft. Achsentext --text-axis erfüllt WCAG AA.
 */
/* ---------- Farbrollen (dataviz-Referenzpalette; Slot 1 hell/dunkel validiert) ---------- */
:root {
  color-scheme: light;
  --page:           #f0f0ed;
  --surface-1:      #fcfcfb;   /* Karten = Chart-Fläche */
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --text-axis:      #6b6a65;   /* 5,28:1 auf der Fläche (AA für 11px) */
  --grid:           #e1e0d9;
  --axis:           #c3c2b7;
  --series-1:       #2a78d6;
  --series-2:       #eb6834;   /* Slot 2; Paar 1/2 hell+dunkel validiert */
  --link:           #1c5cab;   /* Blau 550: 6,46:1 auf der Fläche */
  --border:         rgba(11, 11, 11, .10);
  --shadow:         0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .06);
  --header:         rgba(240, 240, 237, .72);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page:           #0d0d0d;
    --surface-1:      #1a1a19;
    --text-primary:   #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --text-axis:      #898781; /* 4,85:1 */
    --grid:           #2c2c2a;
    --axis:           #383835;
    --series-1:       #3987e5;
    --series-2:       #d95926;
    --link:           #6da7ec; /* Blau 300: 6,96:1 */
    --border:         rgba(255, 255, 255, .10);
    --shadow:         none;
    --header:         rgba(13, 13, 13, .72);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface-1: #1a1a19; --text-primary: #f0efec; --text-secondary: #c3c2b7;
  --text-muted: #898781; --text-axis: #898781; --grid: #2c2c2a; --axis: #383835; --series-1: #3987e5; --series-2: #d95926; --link: #6da7ec;
  --border: rgba(255, 255, 255, .10); --shadow: none; --header: rgba(13, 13, 13, .72);
}

/* ---------- Grundlayout ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--text-primary);
  font: 17px/1.47 system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: -.01em;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--series-1); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-secondary); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--header);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 52px; }
.brand { font-weight: 600; font-size: 17px; color: var(--text-primary); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; font-size: 14px; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--text-secondary); white-space: nowrap; padding: 6px 0; }
@media (max-width: 720px) {
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
}
.nav a:hover { color: var(--text-primary); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 56px 0 40px; }
.hero .place { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.hero .sub { color: var(--text-secondary); font-size: 15px; margin: 2px 0 0; }
.hero .now { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 0; }
.hero .temp { font-size: clamp(72px, 18vw, 112px); font-weight: 200; line-height: 1; letter-spacing: -.04em; margin: 0; }
.hero .cond { display: inline-flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 500; margin-top: 10px; }
.hero .cond svg { width: 28px; height: 28px; }
.hero .range { color: var(--text-secondary); font-size: 17px; margin-top: 6px; }

/* ---------- Abschnitte & Karten ---------- */
section { margin: 0 0 48px; scroll-margin-top: 64px; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 14px; scroll-margin-top: 64px; }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 18px 20px;
}
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tile .label { font-size: 13px; color: var(--text-secondary); font-weight: 500; margin: 0; }
.tile .value { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 6px 0 2px; }
.tile .value small { font-size: 17px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
.tile .note { font-size: 14px; color: var(--text-secondary); margin: 0; }
.tile dl { margin: 10px 0 0; display: grid; grid-template-columns: auto auto; gap: 2px 12px; font-size: 14px; }
.tile dt { color: var(--text-secondary); }
.tile dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tile-wind { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
@media (min-width: 560px) { .tile-wind { grid-column: span 2; } }
.compass { width: 112px; height: 112px; }
.compass .ring { fill: none; stroke: var(--grid); stroke-width: 1; }
.compass .tick { stroke: var(--axis); stroke-width: 1; }
.compass .card-pt { fill: var(--text-axis); font-size: 11px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.compass .needle { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }

/* ---------- Diagramme ---------- */
.charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.chart-wide { grid-column: 1 / -1; }
.chart h3 { font-size: 17px; font-weight: 600; margin: 0; }
.chart .meta { font-size: 14px; color: var(--text-secondary); margin: 2px 0 12px; }
.viz-plot { position: relative; height: 200px; touch-action: pan-y; }
.viz-plot svg { display: block; width: 100%; height: 200px; overflow: visible; }
.viz-plot .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-secondary); font-size: 14px; }
.viz-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz-tick { fill: var(--text-axis); font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
.viz-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-dot { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.viz-end { fill: var(--text-primary); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.viz-cross { stroke: var(--text-muted); stroke-width: 1; shape-rendering: crispEdges; }
.viz-bar { fill: var(--series-1); }
.viz-bar.is-active { fill-opacity: .72; }
.viz-hit { fill: transparent; }
.viz-plot svg:focus { outline: none; }
.viz-plot svg:focus-visible { outline: 3px solid var(--series-1); outline-offset: 4px; border-radius: 6px; }
.viz-tip {
  position: absolute; top: 0; pointer-events: none; z-index: 2; min-width: 96px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12); padding: 6px 10px; font-size: 13px; line-height: 1.35;
}
.viz-tip[hidden] { display: none; }
.viz-tip .v { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip .k { display: inline-block; width: 12px; height: 2px; border-radius: 1px; background: var(--series-1); }
.viz-tip .t { color: var(--text-secondary); }
.chart details { margin-top: 10px; font-size: 14px; }
.chart summary { cursor: pointer; color: var(--link); width: max-content; }
.chart .more { display: inline-block; margin-top: 8px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--text-secondary); font-size: 13px; padding-bottom: 4px; }
th, td { text-align: left; padding: 4px 0; border-bottom: 1px solid var(--grid); font-weight: 400; }
th { color: var(--text-secondary); font-size: 13px; }
td:last-child, th:last-child { text-align: right; }

/* ---------- Texte & Fuß ---------- */
@media (max-width: 560px) {
  .hero { padding-top: 36px; }
  .card { border-radius: 16px; padding: 16px; }
  .topbar .wrap { gap: 16px; }
}
@media (forced-colors: active) {
  .viz-line { stroke: CanvasText; } .viz-bar, .viz-dot, .compass .needle { fill: CanvasText; }
}
  

/* ---------- Ergänzungen für alle Seiten ---------- */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--surface-1); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 16px; }
.nav a[aria-current="page"] { color: var(--text-primary); font-weight: 600; }
.crumbs { font-size: 13px; color: var(--text-secondary); margin: 16px 0 0; }
.crumbs a { color: var(--text-secondary); }
.hero .lead { max-width: 640px; margin: 14px auto 0; color: var(--text-secondary); font-size: 17px; }
.chart .chart-title { font-size: 17px; font-weight: 600; margin: 0; }
.legend { list-style: none; display: flex; gap: 16px; padding: 0; margin: -4px 0 10px; font-size: 13px; color: var(--text-secondary); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend .key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--series-1); }
.legend .key.s2 { background: var(--series-2); }
.viz-line.s2 { stroke: var(--series-2); }
.viz-dot.s2 { fill: var(--series-2); }
.viz-tip .row { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip .k.s2 { background: var(--series-2); }
.viz-tip .name { color: var(--text-secondary); font-weight: 400; font-size: 13px; }
.prose { max-width: 720px; }
.prose h3 { font-size: 17px; font-weight: 600; margin: 24px 0 4px; }
.prose p { margin: 0 0 12px; color: var(--text-secondary); }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 40px; font-size: 13px; color: var(--text-secondary); }
.site-footer p { margin: 0 0 6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
@media (forced-colors: active) { .viz-line.s2 { stroke: CanvasText; } }
.hero .temp-sm { font-size: clamp(56px, 14vw, 96px); }
.hero .temp-sm small { font-size: .36em; font-weight: 400; letter-spacing: 0; margin-left: .15em; color: var(--text-secondary); }
.chart { margin: 0; }
