/* The /weather page. Colours come from the site tokens (site.css) so light and dark follow the visitor's setting. */
.wx {
  --wx-card: color-mix(in srgb, var(--ink) 6%, var(--surface));
  --wx-orange: #d9731a;
  --wx-blue: #3b82c4;
  --wx-caution: #c47d12;
  --wx-severe: #c0392b;
  --wx-night: color-mix(in srgb, #4b4ea8 14%, transparent);
}

@media (prefers-color-scheme: dark) {
  .wx { --wx-orange: #f0924a; --wx-blue: #6aa8e0; --wx-caution: #e0a23a; --wx-severe: #ef6b5b; }
}

.wx h1 { margin-bottom: .3rem; }
.wx-lead { margin: 0 0 1rem; color: var(--muted); }

.wx-toolbar { position: relative; display: flex; gap: 8px; align-items: stretch; margin-bottom: 14px; }
.wx-search { flex: 1 1 auto; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; }
.wx-button, .wx-refresh { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.wx-button:hover, .wx-refresh:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.wx-refresh:disabled { opacity: .45; cursor: default; }

.wx-results { position: absolute; z-index: 10; top: 100%; left: 0; right: 0; margin: 6px 0 0; padding: 6px; max-height: 340px; overflow: auto; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.wx-result { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
button.wx-result:hover, button.wx-result:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wx-empty { color: var(--muted); }

.wx-status { padding: 36px 16px; text-align: center; }
.wx-status h2 { margin-top: 0; }
.wx-loading { color: var(--muted); }

.wx-forecast { display: grid; gap: 14px; }
.wx-header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.wx-title { margin: 0; font-size: 1.5rem; }
.wx-header .wx-note { flex-basis: 100%; margin: 0; }
.wx-spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: wx-spin .8s linear infinite; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wx-spinner { animation: none; } }

.wx-note, .wx-caption p, .wx-source p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.wx-sub { margin: 0; color: var(--muted); }
.wx-orange { color: var(--wx-caution) !important; }

.wx-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); }
.wx-day { display: grid; justify-items: center; gap: 4px; padding: 6px 0; border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.wx-day-name { color: var(--muted); font-size: .72rem; }
.wx-day-num { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 650; font-variant-numeric: tabular-nums; }
.wx-day.wx-selected .wx-day-num { background: var(--accent); color: var(--accent-ink); }

.wx-alerts { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--wx-caution) 14%, transparent); }
.wx-alert summary { cursor: pointer; }
.wx-alert-text { margin: 6px 0 0; font-size: .88rem; white-space: pre-wrap; }
.wx-hints { display: grid; gap: 6px; }
.wx-hint { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: .92rem; background: color-mix(in srgb, var(--wx-caution) 14%, transparent); }
.wx-hint-2 { background: color-mix(in srgb, var(--wx-severe) 16%, transparent); }

.wx-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 4px 0; }
.wx-temp { font-size: 3.4rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wx-temp-row { display: flex; align-items: baseline; gap: 10px; }
.wx-badge { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-size: .78rem; font-weight: 650; }
.wx-cond { font-size: 1rem; }
.wx-icon { display: inline-block; font-style: normal; line-height: 1; }
.wx-icon-xl { font-size: 3rem; }

.wx-hourly { display: grid; grid-template-columns: repeat(8, 1fr); }
.wx-hour { display: grid; justify-items: center; gap: 6px; padding: 6px 0; border: 1.5px solid transparent; border-radius: 10px; }
.wx-hour-label { color: var(--muted); font-size: .72rem; }
.wx-hour .wx-icon { font-size: 1.3rem; }
.wx-hour-temp { font-size: .86rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.wx-hour.wx-current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wx-hour.wx-past { opacity: .4; }

.wx-segment { display: inline-flex; justify-self: start; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.wx-segment button { padding: 5px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.wx-segment button.wx-selected { background: var(--accent); color: var(--accent-ink); }

.wx-card { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--wx-card); }
.wx-card h3 { margin: 0; font-size: 1.05rem; }
.wx-card p { margin: 0; }

.wc-chart { display: block; width: 100%; height: auto; }
.wc-text { fill: var(--muted); font-size: 14px; }
.wc-note { fill: var(--ink); font-size: 14px; font-weight: 600; }
.wc-grid { stroke: var(--line); stroke-width: 1; }
.wc-night { fill: var(--wx-night); }
.wc-area { fill: color-mix(in srgb, var(--wx-orange) 16%, transparent); }
.wc-line { fill: none; stroke: var(--wx-orange); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.wc-line.wc-past { stroke-opacity: .6; stroke-dasharray: 5 3; }
.wc-line.wc-teal { stroke: #2a9d8f; }
.wc-line.wc-blue { stroke: var(--wx-blue); }
.wc-line.wc-indigo { stroke: #6366f1; stroke-dasharray: 5 3; }
.wc-line.wc-purple { stroke: #9b59b6; }
.wc-range { fill: color-mix(in srgb, var(--wx-orange) 22%, transparent); }
.wc-now { stroke: var(--muted); stroke-width: 1; }
.wc-dot { fill: var(--ink); }
.wc-bar { fill: var(--wx-blue); fill-opacity: .75; }

.wx-details { display: grid; gap: 8px; }
.wx-caption { display: grid; gap: 3px; }
.wx-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wx-tile { position: relative; display: grid; align-content: start; gap: 4px; min-height: 74px; padding: 12px; border: 1px solid transparent; border-radius: var(--radius); background: var(--wx-card); }
.wx-tile.wx-caution { border-color: color-mix(in srgb, var(--wx-caution) 40%, transparent); background: color-mix(in srgb, var(--wx-caution) 13%, var(--wx-card)); }
.wx-tile.wx-severe { border-color: color-mix(in srgb, var(--wx-severe) 70%, transparent); background: color-mix(in srgb, var(--wx-severe) 20%, var(--wx-card)); }
.wx-tile-head { display: flex; justify-content: space-between; gap: 4px; color: var(--muted); font-size: .8rem; }
.wx-tile-value { font-size: 1.1rem; font-weight: 650; }
.wx-tile-note { color: var(--muted); font-size: .76rem; line-height: 1.4; }

.wx-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wx-option select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.wx-source { display: grid; gap: 4px; }

.wx-toolbar { flex-wrap: wrap; }
.wx-search { flex-basis: 220px; }
.wx-tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.wx-tab { padding: 8px 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.wx-tab.wx-selected { color: var(--accent); border-bottom-color: var(--accent); }
.wx-small { font-size: .85rem; }
.wx-dim { color: var(--muted); }
.wx-link { justify-self: start; padding: 4px 0; border: 0; background: transparent; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.wx-link:hover { text-decoration: underline; }

.wx-rows { display: grid; }
.wx-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.wx-row:first-child { border-top: 0; }
.wx-row-value { display: inline-flex; align-items: center; gap: 6px; text-align: right; font-variant-numeric: tabular-nums; }
.wx-obs-head { display: flex; align-items: center; gap: 10px; }
.wx-obs-temp { font-size: 1.7rem; font-weight: 650; }
.wx-level { font-size: .95rem; }

.wx-stations { display: grid; gap: 12px; }
.wx-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.wx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wx-chip { padding: 5px 12px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.wx-chip.wx-selected { background: var(--accent); color: var(--accent-ink); }
.wx-sort { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.wx-station-list { display: grid; }
.wx-station { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.wx-station:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.wx-station-main { display: grid; gap: 1px; min-width: 0; }
.wx-station-name { font-weight: 650; }
.wx-station-side { display: grid; justify-items: end; gap: 1px; flex: 0 0 auto; }
.wx-station-temp { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }


.wx-tabs { overflow-x: auto; scrollbar-width: none; }
.wx-tab { flex: 0 0 auto; white-space: nowrap; }
.wx-maptools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--wx-card); }
.wx-maptools .wx-note { flex-basis: 100%; }
.wx-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.wx-stage { display: flex; flex-direction: column; }
.wx-stage.wx-map-first .wx-map-panel { order: -1; margin: 0 0 14px; }
.wx-map-panel { margin-top: 14px; }
.wx-map { width: 100%; height: min(70vh, 640px); min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--water); }
.wx-popup { display: grid; gap: 2px; min-width: 120px; color: #1d211c; }
.wx-subtitle { margin: 6px 0 0; font-size: .95rem; }
.wx-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.wx-table th, .wx-table td { padding: 5px 6px; border-top: 1px solid var(--line); text-align: left; }
.wx-table th { color: var(--muted); font-weight: 600; border-top: 0; }
.wx-radar { position: relative; line-height: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.wx-radar-img { display: block; width: 100%; height: auto; }
.wx-radar-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wx-radar-dot { fill: #e11d48; stroke: #ffffff; stroke-width: 2; }
.wx-radar-ring { fill: none; stroke: #e11d48; stroke-width: 2; }

@media (max-width: 600px) {
  .wx-temp { font-size: 2.8rem; }
  .wx-icon-xl { font-size: 2.4rem; }
  .wx-tiles { gap: 8px; }
}
