/* Brand palette pulled from the Horbury Weather logo:
   navy #0b2a5b, sky blue #1a73d0 → #0d47a1, sun yellow #fcc419 → #f59f00. */
:root {
  color-scheme: light;
  --navy: #0b2a5b;
  --blue: #1a73d0;
  --blue-deep: #0d47a1;
  --sun: #fcc419;
  --sun-deep: #f59f00;

  --page: #f2f6fb;
  --surface: #ffffff;
  --text: #0e2346;
  --text-2: #465877;
  --muted: #7a889f;
  --grid: #e3e9f2;
  --axis: #c3cedd;
  --ring: rgba(11, 42, 91, 0.08);
  --accent: #1a73d0;
  --accent-wash: #e7f0fc;
  --banner: #fff4d0;
  --banner-text: #5c4400;
  --series-blue: #1a73d0;
  --series-orange: #eb6834;
  --shadow: 0 1px 2px rgba(11, 42, 91, 0.06), 0 8px 24px -8px rgba(11, 42, 91, 0.12);
  --radius: 20px;
  --font-display: Montserrat, system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font-body);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --page: #06112a;
    --surface: #0d1c36;
    --text: #f1f5fc;
    --text-2: #b3c0d6;
    --muted: #7d8ba6;
    --grid: #1a2a48;
    --axis: #2a3c5e;
    --ring: rgba(160, 195, 255, 0.1);
    --accent: #4a9ef0;
    --accent-wash: #132a4f;
    --banner: #3a2f10;
    --banner-text: #f5dc9a;
    --series-blue: #3a8ee4;
    --series-orange: #e5692f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #06112a;
  --surface: #0d1c36;
  --text: #f1f5fc;
  --text-2: #b3c0d6;
  --muted: #7d8ba6;
  --grid: #1a2a48;
  --axis: #2a3c5e;
  --ring: rgba(160, 195, 255, 0.1);
  --accent: #4a9ef0;
  --accent-wash: #132a4f;
  --banner: #3a2f10;
  --banner-text: #f5dc9a;
  --series-blue: #3a8ee4;
  --series-orange: #e5692f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Sky background colours */
:root {
  --sky-cloud-alpha: 0.95;
  --sky-cloud-alpha-heavy: 0.9;
  --sky-rain: rgba(26, 115, 208, 0.45);
  --sky-wind: rgba(11, 42, 91, 0.16);
  --sky-star: #7d8fb8;
  --sky-mist: rgba(255, 255, 255, 0.75);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --sky-cloud-alpha: 0.2;
    --sky-cloud-alpha-heavy: 0.28;
    --sky-rain: rgba(140, 190, 250, 0.45);
    --sky-wind: rgba(190, 215, 250, 0.14);
    --sky-star: #ffffff;
    --sky-mist: rgba(200, 215, 235, 0.1);
  }
}
:root[data-theme='dark'] {
  --sky-cloud-alpha: 0.2;
  --sky-cloud-alpha-heavy: 0.28;
  --sky-rain: rgba(140, 190, 250, 0.45);
  --sky-wind: rgba(190, 215, 250, 0.14);
  --sky-star: #ffffff;
  --sky-mist: rgba(200, 215, 235, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin: 0;
}

h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.secondary { color: var(--text-2); }
.muted { color: var(--muted); }

.card {
  /* Frosted: the sky shows through softly behind the readings. */
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--ring), var(--shadow);
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-banner {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 0.875rem;
  background: var(--banner);
  color: var(--banner-text);
}

/* Sky background (see js/sky.js). Sits behind everything; cards are frosted
   so the weather shows through softly without hurting legibility. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.sky > * {
  position: absolute;
  inset: 0;
}
.sky-tint {
  background: linear-gradient(
    to bottom,
    var(--sky-tint, transparent) 0,
    color-mix(in srgb, var(--sky-tint, transparent) 70%, transparent) 50vh,
    color-mix(in srgb, var(--sky-tint, transparent) 35%, transparent) 100vh
  );
}
.sky-canvas {
  width: 100%;
  height: 100%;
}

/* Clouds: soft painted cumulus drifting with the wind. */
.cloud {
  position: absolute;
  left: 0;
  aspect-ratio: 520 / 220;
  background: center / 100% 100% no-repeat;
  opacity: calc(var(--depth, 1) * var(--sky-cloud-alpha));
  animation: drift linear infinite;
}
.sky-clouds.heavy .cloud {
  opacity: calc(var(--depth, 1) * var(--sky-cloud-alpha-heavy));
}
.sky-clouds.reverse .cloud {
  animation-name: drift-back;
}
@keyframes drift {
  from { transform: translateX(-420px); }
  to { transform: translateX(calc(100vw + 40px)); }
}
@keyframes drift-back {
  from { transform: translateX(calc(100vw + 40px)); }
  to { transform: translateX(-420px); }
}

.sky-mist {
  opacity: 0;
  transition: opacity 3s;
}
.sky.mist-on .sky-mist { opacity: 1; }
.sky-mist::before,
.sky-mist::after {
  content: '';
  position: absolute;
  left: -50%;
  width: 200%;
  height: 30vh;
  background: radial-gradient(ellipse at center, var(--sky-mist), transparent 70%);
  animation: mist 60s ease-in-out infinite alternate;
}
.sky-mist::before { top: 14vh; }
.sky-mist::after {
  top: 46vh;
  animation-duration: 85s;
  animation-direction: alternate-reverse;
}
@keyframes mist {
  from { transform: translateX(-12%); }
  to { transform: translateX(12%); }
}

/* No movement for people who've asked their device to reduce motion. */
.sky.still *,
.sky.still *::before,
.sky.still *::after {
  animation: none !important;
}
.sky.still .cloud {
  left: calc(var(--x) * 1%);
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 28px;
  padding-bottom: 22px;
}
/* Horbury Weather logo: icon + two-line wordmark, recreated from the logo art
   (public/img/horbury-weather-logo.webp) so it can go white in dark mode. */
.brand {
  --brand-navy: #0b2a5b;
  --brand-blue: #1a73d0;
  /* Icon on the left; wordmark with the byline tucked under it on the right. */
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: center;
  column-gap: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .brand {
    --brand-navy: #ffffff;
    --brand-blue: #5aa7f2;
  }
}
:root[data-theme='dark'] .brand {
  --brand-navy: #ffffff;
  --brand-blue: #5aa7f2;
}
.brand-icon {
  grid-row: 1 / 3;
  width: clamp(56px, 13vw, 76px);
  height: auto;
}
.byline {
  grid-column: 2;
  align-self: start;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--ring);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.2;
}
.brand-text {
  grid-column: 2;
  align-self: end;
  display: flex;
  flex-direction: column;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  line-height: 1;
  text-transform: uppercase;
}
.brand-name {
  font-weight: 800;
  color: var(--brand-navy);
}
.brand-sub {
  margin-top: 0.18em;
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: var(--brand-spacing, 1.25em);
  /* Letter-spacing also pads after the last letter; pull it back so the
     line ends flush with "HORBURY" above. */
  margin-right: calc(-1 * var(--brand-spacing, 1.25em));
  color: var(--brand-blue);
}
.updated { font-size: 0.875rem; }
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

main > section {
  scroll-margin-top: 16px;
  margin-bottom: 56px;
}

/* Now */
.now {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) 2fr;
  gap: 14px;
}
/* Hero: the logo's blue-cloud gradient, same in light and dark mode. */
.hero {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 22px 24px 20px;
  border-radius: var(--radius);
  color: #ffffff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(150deg, #2185e6 0%, #1463c4 38%, #0d47a1 70%, #0b2a5b 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.hero-live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sun);
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--sun);
  animation: live-pulse 2.4s ease-out infinite;
}
@keyframes live-pulse {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(3.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot::after { animation: none; }
}
/* Temperature and icon share a row, both sized to the card so they never collide. */
.hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 2px;
}
.hero-icon {
  flex: none;
  width: clamp(72px, 26cqi, 124px);
  margin-right: -6px;
  filter: drop-shadow(0 8px 16px rgba(4, 20, 50, 0.35));
}
.hero-icon svg {
  display: block;
  width: 100%;
  height: auto;
}
.hero-temp {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 20cqi, 5.75rem);
  white-space: nowrap;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.hero-temp .unit {
  margin-left: 6px;
  font-size: 0.36em;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: 1.2em;
  color: rgba(255, 255, 255, 0.7);
}
.hero-condition {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.hero-feels {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.75);
}
.hero-hilo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 18px;
}
.hilo-title {
  flex-basis: 100%;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.hilo-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}
.hilo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.hilo-pill b {
  font-weight: 600;
}
.hi-arrow { color: var(--sun); font-weight: 700; }
.lo-arrow { color: #9fd0ff; font-weight: 700; }
.hero .summary {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.92);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.tile {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tile .label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.tile-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile .value,
.record .value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.tile .detail,
.record .detail {
  font-size: 0.8125rem;
  color: var(--text-2);
}

.compass {
  width: 52px;
  height: 52px;
  flex: none;
}
.compass circle {
  fill: none;
  stroke: var(--grid);
  stroke-width: 2;
}
.compass text {
  font-size: 7px;
  font-weight: 700;
  fill: var(--muted);
}
.compass path {
  fill: var(--accent);
}

/* Sections */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 16px;
}
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head h2::before {
  content: '';
  width: 5px;
  height: 1.05em;
  border-radius: 3px;
  background: linear-gradient(var(--sun), var(--sun-deep));
}

.records {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}
.record {
  padding: 18px 20px;
}
.record + .record {
  box-shadow: -1px 0 0 var(--ring);
}

.charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.charts.two {
  grid-template-columns: 1fr 1fr;
}

.chart-card {
  margin: 0;
  padding: 16px 18px 12px;
  min-width: 0;
}
.chart-card figcaption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
}
.chart-card figcaption .muted {
  font-size: 0.8125rem;
}

/* Charts */
.chart {
  width: 100%;
  min-height: 60px;
}
.plot {
  position: relative;
}
.plot svg {
  display: block;
  overflow: visible;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  margin: -4px 0 8px;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--text-2);
}
.legend li,
.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.key {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick {
  font-size: 11px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart .tick.strong { fill: var(--text-2); font-weight: 600; }
.chart .value {
  font-size: 12px;
  font-weight: 600;
  fill: var(--text);
}
.chart .value.muted { fill: var(--text-2); font-weight: 500; }
.chart .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .area { opacity: 0.1; }
.chart .dot {
  stroke: var(--surface);
  stroke-width: 2;
  pointer-events: none;
}
.chart .crosshair {
  stroke: var(--axis);
  stroke-width: 1;
  pointer-events: none;
}
.chart-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
}
.chart-tip {
  position: absolute;
  z-index: 2;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring), 0 6px 20px rgba(0, 0, 0, 0.12);
  font-size: 0.8125rem;
  pointer-events: none;
}
.tip-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.tip-row b {
  margin-left: auto;
  padding-left: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Tables */
.data-table {
  margin-top: 12px;
  font-size: 0.875rem;
}
.data-table summary {
  cursor: pointer;
  color: var(--text-2);
  padding: 4px 0;
}
.table-scroll {
  overflow-x: auto;
  margin-top: 8px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 6px 12px;
  text-align: right;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}
th:first-child { text-align: left; }
thead th { color: var(--text-2); font-weight: 600; }

/* Reports */
.reports {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.report {
  padding: 20px 22px;
}
.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.report h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}
.report-head .muted {
  font-size: 0.8125rem;
}
.report > p {
  max-width: 68ch;
}
.report > p + p {
  margin-top: 0.75em;
}
.copy-btn {
  flex: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: var(--accent);
  background: var(--accent-wash);
  transition: background 0.15s, color 0.15s;
}
.copy-btn:hover {
  color: #ffffff;
  background: var(--accent);
}
.copy-btn:focus-visible {
  outline: 2px solid var(--series-blue);
  outline-offset: 2px;
}

/* Map */
.map-card {
  overflow: hidden;
}
.map-toolbar {
  display: flex;
  gap: 4px;
  padding: 10px;
  box-shadow: 0 1px 0 var(--ring);
}
.map-toolbar button {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
  background: transparent;
}
.map-toolbar button:hover {
  background: var(--page);
}
.map-toolbar button[aria-pressed='true'] {
  color: #ffffff;
  background: var(--accent);
}
.map-toolbar button:focus-visible {
  outline: 2px solid var(--series-blue);
  outline-offset: 2px;
}
.map {
  height: 440px;
  background: var(--page);
  z-index: 0;
}
.map.leaflet-container {
  font-family: inherit;
  background: var(--page);
}
/* OpenStreetMap only has light tiles, so dim them in dark mode. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.85) saturate(0.6);
  }
}
:root[data-theme='dark'] .map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.85) saturate(0.6);
}
.map .pin {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 0 0 1px var(--ring), 0 2px 6px rgba(0, 0, 0, 0.25);
}
.map .pin.home {
  background: var(--series-blue);
  color: #fff;
  font-size: 13px;
  padding: 4px 10px;
}
.map .pin .arrow {
  display: inline-block;
  font-size: 11px;
}
.map .leaflet-popup-content-wrapper,
.map .leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--ring), 0 6px 20px rgba(0, 0, 0, 0.2);
}
.map .leaflet-popup-content {
  margin: 12px 14px;
  min-width: 190px;
}
.map .leaflet-container a.leaflet-popup-close-button,
.map a.leaflet-popup-close-button {
  color: var(--muted);
}
.map .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--muted);
}
.map .leaflet-control-attribution a {
  color: var(--text-2);
}
.map .leaflet-bar a {
  background: var(--surface);
  color: var(--text);
  border-color: var(--grid);
}
.pop p {
  margin: 0;
}
.pop-title {
  font-weight: 650;
  font-size: 0.9375rem;
}
.pop-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--series-blue);
  color: #fff;
  vertical-align: 1px;
}
.pop-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px !important;
}
.pop-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  padding: 2px 0;
}
.pop-row span {
  color: var(--text-2);
}
.pop-row + .pop-sub {
  margin: 6px 0 0 !important;
}

.map-toolbar {
  flex-wrap: wrap;
}
.map-toolbar .radar-btn {
  margin-left: auto;
}
.map-toolbar .radar-btn::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
  background: currentColor;
  opacity: 0.5;
}
.map-toolbar .radar-btn[aria-pressed='true']::before {
  background: var(--sun);
  opacity: 1;
}
.radar-label {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(6, 17, 42, 0.8);
  pointer-events: none;
}

/* Small map tile at the top; opens the pop-up map */
.tile-list {
  display: contents;
}
.map-tile {
  position: relative;
  display: block;
  min-height: 132px;
  padding: 0;
  overflow: hidden;
}
.map.map-mini {
  position: absolute;
  inset: 0;
  height: auto;
  pointer-events: none;
}
.map-mini .pin.home {
  font-size: 12px;
  padding: 3px 8px;
}
.map-mini .pin-dot {
  display: block;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--series-orange);
  box-shadow: 0 0 0 2px var(--surface);
}
.map-mini .leaflet-control-attribution {
  font-size: 9px;
}
.map-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface) 92%, transparent) 0,
    color-mix(in srgb, var(--surface) 55%, transparent) 38%,
    transparent 60%
  );
}
.map-open-label {
  display: flex;
  flex-direction: column;
}
.map-open-cta {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring), 0 2px 6px rgba(0, 0, 0, 0.15);
}
.map-open:hover .map-open-cta {
  background: var(--accent-wash);
}
.map-open:focus-visible {
  outline: 2px solid var(--series-blue);
  outline-offset: -2px;
}
.map-open-cta svg,
.dialog-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pop-up map */
.map-dialog {
  width: min(1100px, 100vw - 32px);
  height: min(820px, 100dvh - 32px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
}
.map-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
body:has(.map-dialog[open]) {
  overflow: hidden;
}
.map-dialog-box {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.map-dialog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 10px 10px 18px;
  box-shadow: 0 1px 0 var(--ring);
}
.map-dialog-head h2 {
  margin-right: auto;
  font-size: 1.0625rem;
  font-weight: 650;
}
.map-dialog .map-toolbar {
  padding: 0;
  box-shadow: none;
}
.dialog-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  background: var(--page);
  box-shadow: 0 0 0 1px var(--ring);
}
.dialog-close svg {
  width: 18px;
  height: 18px;
}
.dialog-close:hover {
  background: var(--accent-wash);
}
.dialog-close:focus-visible {
  outline: 2px solid var(--series-blue);
  outline-offset: 2px;
}
.map.map-full {
  flex: 1;
  height: auto;
  min-height: 0;
}

/* Met Office warnings banner */
.warnings {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.warning {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  color: #0b2a5b;
  background: #fcc419;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.warning-amber { background: #f59f00; }
.warning-red { background: #e03131; color: #ffffff; }
.warning-icon {
  flex: none;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.warning strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
}
.warning-text {
  display: block;
  font-size: 0.875rem;
  opacity: 0.85;
}
.warning-more {
  flex: none;
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Forecast: hourly strip + 7-day list */
.hourly {
  padding: 6px 0;
  margin-bottom: 14px;
}
.hourly-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding: 8px 10px;
}
.hourly-strip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius);
}
.hour {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 64px;
  padding: 6px 0;
  scroll-snap-align: start;
  border-radius: 12px;
}
.hour:first-child {
  background: var(--accent-wash);
}
.hour-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.hour:first-child .hour-time {
  color: var(--text);
}
.hour-icon {
  width: 40px;
}
.hour-icon svg,
.day-icon svg,
.town-icon svg {
  display: block;
  width: 100%;
  height: auto;
}
.hour-temp {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}
.hour-rain {
  min-height: 1.1em;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #9fd0ff;
}

.daily {
  padding: 6px 20px;
}
.day-row {
  display: grid;
  grid-template-columns: 5.5rem 40px minmax(0, 1fr) 4.5rem 2.25rem minmax(60px, 34%) 2.25rem;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.day-row + .day-row {
  border-top: 1px solid var(--grid);
}
.day-name {
  font-weight: 600;
}
.day-cond {
  font-size: 0.875rem;
  color: var(--text-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.day-rain {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #9fd0ff;
}
.drop {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.day-lo,
.day-hi {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}
.day-lo {
  color: var(--muted);
}
.day-hi {
  text-align: left;
}
.day-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--grid);
}
.day-bar > span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #4a9ef0, #fcc419);
}

/* Around West Yorkshire */
.towns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.town {
  padding: 16px 18px;
}
.town-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}
.town h3 {
  font-size: 1rem;
  font-weight: 700;
}
.town-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.town-badge.warm { color: #0b2a5b; background: var(--sun); }
.town-badge.cool { color: #ffffff; background: var(--accent); }
.town-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 2px;
}
.town-temp {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.town-icon {
  width: 56px;
}
.town-cond {
  font-weight: 600;
}
.town-wind {
  font-size: 0.8125rem;
  color: var(--text-2);
}
.more-links {
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--muted);
}
.more-links a,
.site-footer a {
  color: inherit;
  text-underline-offset: 2px;
}
.more-links a:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .day-row {
    grid-template-columns: 4.6rem 32px auto 2rem minmax(36px, 1fr) 2rem;
    gap: 8px;
  }
  .day-rain {
    font-size: 0.75rem;
    min-width: 2.75rem;
  }
  .towns {
    gap: 10px;
  }
  .town {
    padding: 14px;
  }
  .town-temp {
    font-size: 1.875rem;
  }
  .town-icon {
    width: 44px;
  }
  .town-wind {
    font-size: 0.75rem;
  }
  .day-cond {
    display: none;
  }
  .warning-more {
    display: none;
  }
}

/* Notes */
.notes {
  display: grid;
  gap: 12px;
}
.note {
  padding: 20px 22px;
  max-width: 72ch;
}
.note time {
  font-size: 0.8125rem;
  color: var(--muted);
}
.note h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2px 0 8px;
}
.note p + p {
  margin-top: 0.75em;
}

/* Stakka credit — logo colours match stakka.uk's Logo component. */
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8125rem;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.powered-by:hover {
  opacity: 1;
}
.powered-by:focus-visible {
  outline: 2px solid var(--series-blue);
  outline-offset: 4px;
  border-radius: 4px;
}
.stakka-icon {
  width: 24px;
  height: 24px;
}
.stakka-wordmark {
  height: 26px;
  width: auto;
}
.stk-mid-a { stop-color: #333a4a; }
.stk-mid-b { stop-color: #141821; }
.stk-bot-a { stop-color: #1c212c; }
.stk-bot-b { stop-color: #0b0d12; }
.wm-white { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .stk-mid-a { stop-color: #ebedf0; }
  :root:not([data-theme='light']) .stk-mid-b { stop-color: #d6dae0; }
  :root:not([data-theme='light']) .stk-bot-a { stop-color: #c8cdd4; }
  :root:not([data-theme='light']) .stk-bot-b { stop-color: #aab0ba; }
  :root:not([data-theme='light']) .wm-ink { display: none; }
  :root:not([data-theme='light']) .wm-white { display: inline; }
}
:root[data-theme='dark'] .stk-mid-a { stop-color: #ebedf0; }
:root[data-theme='dark'] .stk-mid-b { stop-color: #d6dae0; }
:root[data-theme='dark'] .stk-bot-a { stop-color: #c8cdd4; }
:root[data-theme='dark'] .stk-bot-b { stop-color: #aab0ba; }
:root[data-theme='dark'] .wm-ink { display: none; }
:root[data-theme='dark'] .wm-white { display: inline; }
/* Navy footer band in the logo colour, in both modes. */
.site-footer {
  margin-top: 24px;
  padding: 32px 0 40px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  background: #0b2a5b;
}
:root[data-theme='dark'] .site-footer {
  background: #030b1d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .site-footer {
    background: #030b1d;
  }
}
.site-footer .wrap {
  display: grid;
  gap: 4px;
}
.site-footer .secondary,
.site-footer .muted {
  color: rgba(255, 255, 255, 0.72);
}
.site-footer .powered-by {
  color: rgba(255, 255, 255, 0.7);
}
/* The footer is always dark, so always use the light Stakka logo. */
.site-footer .wm-ink { display: none !important; }
.site-footer .wm-white { display: inline !important; }
.site-footer .stk-mid-a { stop-color: #ebedf0 !important; }
.site-footer .stk-mid-b { stop-color: #d6dae0 !important; }
.site-footer .stk-bot-a { stop-color: #c8cdd4 !important; }
.site-footer .stk-bot-b { stop-color: #aab0ba !important; }

@media (max-width: 760px) {
  .now,
  .reports,
  .charts.two {
    grid-template-columns: 1fr;
  }
  .records {
    grid-template-columns: 1fr 1fr;
  }
  .map {
    height: 360px;
  }
  .map-tile {
    min-height: 170px;
  }
  /* The pop-up map goes full screen on phones. */
  .map-dialog {
    width: 100vw;
    height: 100dvh;
    margin: 0;
  }
  .map-dialog-box {
    border-radius: 0;
  }
  .map-dialog .map-toolbar {
    order: 3;
    width: 100%;
  }
  .record:nth-child(3) {
    box-shadow: 0 -1px 0 var(--ring);
  }
  .record:nth-child(4) {
    box-shadow: -1px 0 0 var(--ring), 0 -1px 0 var(--ring);
  }
}
