/* ==========================================================================
   Denbighshire Weather: site stylesheet
   Design tokens and shared components. Values follow the design reference
   (design-reference/Main.dc.html). Replaces Tailwind and css/main.css as
   each page is rebuilt.
   ========================================================================== */

/* Inter and Inter Tight, served from this site rather than Google Fonts so pages
   don't wait on another server. Latin-ext covers Welsh letters such as ŵ and ŷ. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/inter-latin.woff2?v=1") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../assets/fonts/inter-tight-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../assets/fonts/inter-tight-latin.woff2?v=1") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colour */
  --bg: #F6F7F5;            /* page background */
  --surface: #FFFFFF;       /* panels */
  --surface-subtle: #F6F8F9;
  --ink: #102A43;           /* headings, primary text */
  --ink-2: #334E68;         /* body text */
  --muted: #52606D;         /* secondary text, 4.5:1 or better on white */
  --muted-2: #5F6E7B;       /* chart labels, placeholders */
  --line: #E3E8EC;          /* panel borders */
  --line-soft: #EDF1F3;     /* dividers inside panels */
  --teal: #008F95;          /* charts, selected states, fills. NOT for small text */
  --teal-text: #00747A;     /* links and teal text. #008F95 fails contrast at 3.9:1 */
  --teal-text-hover: #005A5F;
  --teal-tint: #EAF5F5;     /* selected background */
  --teal-border: #9ED3D5;   /* selected border */
  --sun: #F4BE3A;           /* icon fill only */
  --sun-stroke: #E0A11B;    /* icon stroke only */
  --rain: #2A7FB0;          /* rain drops, tide line */
  --cloud-fill: #EEF2F5;
  --cloud-stroke: #6B7C8D;
  --warn-bg: #FFF7E1;
  --warn-border: #E5BE5C;
  --warn-badge: #F2C14E;
  --warn-ink: #3B2C00;
  --hero-overlay: rgba(9, 24, 38, 0.8);

  /* Control states (from the reference component styles) */
  --control-border: #D5DDE3;
  --control-bg: #F9FAFA;
  --hover: #F2F5F6;
  --hover-teal: #EEF6F6;
  --pressed: #EAF0F2;
  --nav-hover-line: #C9D6DE;
  --btn-hover-border: #9FB2BF;
  --decor: #A9B6C0;         /* decorative only: separators, dashed borders */
  --focus-ring: rgba(0, 143, 149, 0.2);
  --skeleton: #E7ECEF;
  --teal-wash: #F4F9F9;     /* current item in the mobile menu */

  /* Type */
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Tight", Inter, system-ui, sans-serif;

  /* Shape */
  --radius-panel: 16px;
  --radius-control: 12px;
  --radius-small: 10px;
  --shadow-panel: 0 1px 2px rgba(16, 42, 67, .04), 0 6px 20px rgba(16, 42, 67, .04);
  --shadow-pop: 0 14px 36px rgba(16, 42, 67, .14);

  /* Layout */
  --max-width: 1320px;
  --gutter: 32px;           /* 16px on mobile */
  --gap: 24px;              /* 16px on mobile */
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body > main { flex: 1 0 auto; }

a { color: var(--teal-text); }
a:hover { color: var(--teal-text-hover); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Visually hidden, still read by screen readers */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 60;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
}
.skip-link:focus { left: 16px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }

.site-nav {
  display: flex;
  gap: 4px;
  align-self: stretch;
}

.site-nav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--nav-hover-line); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--teal); font-weight: 600; }

.menu-btn { display: none; }

/* --------------------------------------------------------------------------
   Location search (combobox)
   -------------------------------------------------------------------------- */

.header-tools {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.search {
  position: relative;
  width: 340px;
  max-width: 100%;
}

.search input {
  width: 100%;
  height: 44px;
  margin: 0;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  padding: 0 14px 0 40px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--control-bg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--muted-2); opacity: 1; }
.search input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background: var(--surface);
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 13px;
  pointer-events: none;
  color: var(--muted);
}

.search-list {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 328px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
}
.search-list[hidden] { display: none; }

.search-opt {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.search-opt:hover,
.search-opt:focus-visible { background: var(--hover-teal); }
.search-opt[aria-current="true"] { font-weight: 600; }
.search-opt small { color: var(--muted); font-size: 13px; font-weight: 400; }

.search-empty {
  padding: 14px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.search-empty b { display: block; color: var(--ink); margin-bottom: 2px; }

/* --------------------------------------------------------------------------
   Language toggle
   -------------------------------------------------------------------------- */

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
}

.lang-toggle button {
  min-width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-toggle button:hover { color: var(--ink); background: var(--hover); }
.lang-toggle button[aria-pressed="true"] { color: var(--ink); font-weight: 700; background: var(--pressed); }
.lang-toggle .sep { color: var(--decor); }

/* --------------------------------------------------------------------------
   Page heading (inner pages)
   -------------------------------------------------------------------------- */

.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 32px 0 20px;
}
.pagehead h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--ink);
}
.pagehead p { margin: 8px 0 0; font-size: 16px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 28px 0;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

.meta { font-size: 14px; color: var(--muted); }

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-text);
  text-decoration: none;
}
.panel-link:hover { color: var(--teal-text-hover); text-decoration: underline; }

/* --------------------------------------------------------------------------
   States: loading and unavailable
   -------------------------------------------------------------------------- */

/* Grey block in the shape of the content. Size it inline or with a modifier. */
.skeleton {
  display: inline-block;
  vertical-align: middle;
  background: var(--skeleton);
  border-radius: 8px;
  animation: dw-pulse 1.4s ease-in-out infinite;
}
.skeleton.on-dark { background: rgba(255, 255, 255, .24); }
.skeleton.block { display: block; }
.skeleton.round { border-radius: 50%; }

@keyframes dw-pulse { 50% { opacity: .45; } }

.unavailable {
  padding: 44px 28px 48px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.unavailable svg { display: block; margin: 0 auto; }
.unavailable b { display: block; margin: 10px 0 4px; font-size: 17px; color: var(--ink); }

.btn-secondary {
  margin-top: 16px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--nav-hover-line);
  border-radius: var(--radius-small);
  background: var(--surface);
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-secondary:hover { background: var(--hover); border-color: var(--btn-hover-border); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 28px;
  padding-top: 18px;
  padding-bottom: 22px;
}

.site-footer .footer-useful {
  justify-content: flex-start;
  gap: 4px 22px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.footer-useful-title { font-weight: 600; color: var(--ink); }

.footer-useful a,
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--ink-2);
  text-decoration: none;
}
.footer-useful a:hover,
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 0 22px; }

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}
.footer-meta .disclaimer { max-width: 60ch; margin-left: auto; font-size: 13px; }

/* ==========================================================================
   Homepage (index.html)
   ========================================================================== */

.wx-icon { display: block; flex: none; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  min-height: 368px;
  margin-top: var(--gap);
  border-radius: var(--radius-panel);
  overflow: hidden;
  color: #fff;
  /* Vale of Clwyd from the Clwydian Range; positioned to keep the sky and the valley */
  background: #24384A url("../assets/images/hero-vale-of-clwyd.jpg?v=1") center 18% / cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--hero-overlay) 0%, rgba(9, 24, 38, .58) 40%, rgba(9, 24, 38, .14) 76%, rgba(9, 24, 38, 0) 100%);
}

.hero-inner {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 44px 48px 40px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.025em;
}

.hero-loc {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 17px;
  color: #E4ECF2;
}

.hero-now { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.hero-temp { display: flex; align-items: center; gap: 18px; }
.hero-temp .wx-icon { width: 96px; height: 96px; }

.hero-deg {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 600;
  line-height: .9;
  letter-spacing: -.04em;
}
.hero-desc { margin-top: 8px; font-size: 17px; font-weight: 600; }
.hero-feels { margin-top: 3px; font-size: 15px; color: #D5E0E8; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 18px 44px;
  margin: 0;
  padding-left: 36px;
  border-left: 1px solid rgba(255, 255, 255, .3);
}
/* The icon sits inside the <dt> so the list stays valid for screen readers */
.hero-stat { position: relative; padding-left: 30px; }
.hero-stat svg { position: absolute; left: 0; top: 2px; }
.hero-stat dt { font-size: 13px; color: #DDE6ED; }
.hero-stat dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }

.hero-credit {
  position: absolute;
  right: 16px;
  bottom: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  /* The photo is bright on the right, so the credit carries its own backing */
  background: rgba(9, 24, 38, .72);
  font-size: 12px;
  color: #fff;
}

.hero-more { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(9, 24, 38, .35);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.more-btn:hover { background: rgba(9, 24, 38, .6); }
.more-btn svg { transition: transform .15s; }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.more-btn:focus-visible { outline-color: #fff; }

.more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  justify-content: start;
  gap: 10px 40px;
  max-width: 100%;
  margin: 0;
  padding: 14px 20px;
  border-radius: var(--radius-control);
  background: rgba(9, 24, 38, .55);
}
.more-grid[hidden] { display: none; }
.more-grid dt { font-size: 13px; color: #DDE6ED; }
.more-grid dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; }
.more-grid .compare { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .2); }
.more-grid .compare dd { font-weight: 500; }
.more-grid .compare a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.more-grid .compare a:hover { text-decoration-thickness: 2px; }
.more-grid a { color: #9FDCDF; font-weight: 600; }

.hero .skeleton { background: rgba(255, 255, 255, .24); }
.hero :focus-visible { outline-color: #fff; }

/* --------------------------------------------------------------------------
   Hourly panel and radar preview
   -------------------------------------------------------------------------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
  align-items: start;
}

.hourly-scroll { position: relative; }
.hourly-scroller {
  overflow-x: auto;
  padding: 14px 28px 6px;
  scrollbar-width: thin;
}
.hourly-track { min-width: 640px; }

.hours,
.hours-skeleton {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.hours-skeleton > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 12px;
}

.hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.hour:hover { background: var(--surface-subtle); }
.hour[aria-pressed="true"] { background: var(--teal-tint); border-color: var(--teal-border); }
.hour-time { font-size: 14px; color: var(--muted); }
.hour[aria-pressed="true"] .hour-time { color: var(--ink); font-weight: 600; }
.hour .wx-icon { width: 40px; height: 40px; }
.hour-temp { font-size: 19px; font-weight: 600; }

.rain-chance { display: flex; align-items: center; gap: 3px; font-size: 13px; color: var(--muted); }

.chart { position: relative; height: 148px; margin-top: 8px; }
.chart-plot { position: absolute; left: 0; right: 0; top: 14px; bottom: 14px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-line { position: absolute; left: 0; right: 0; border-top: 1px solid #EEF2F4; }
.chart-line span {
  position: absolute;
  left: 0;
  top: -9px;
  padding-right: 6px;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-2);
  background: var(--surface);
}
.chart-sel { position: absolute; top: -10px; bottom: -10px; width: 0; border-left: 1px dashed #7FC2C5; }
.chart-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--surface);
  transition: all .15s;
}
.chart-dot.on {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-color: var(--surface);
  background: var(--teal);
  box-shadow: 0 0 0 2px var(--teal);
}

.hour-detail { margin: 0; padding: 4px 28px 22px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.hour-detail strong { color: var(--ink); }
.scroll-cue { display: none; }

/* Radar preview */
.radar-map {
  position: relative;
  margin: 14px 28px 0;
  aspect-ratio: 400 / 260;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: #E8EEE4;
}
.radar-map .leaflet-container { width: 100%; height: 100%; background: #E8EEE4; font: inherit; }
.radar-map .leaflet-control-attribution { font-size: 10px; }
/* Overlap base tiles by half a pixel to hide hairline seams between them.
   Leaflet blends tiles with plus-lighter, which turns any overlap into a
   bright line, so the base tiles are drawn normally instead. */
.radar-map .base-tiles img.leaflet-tile { width: 256.5px !important; height: 256.5px !important; mix-blend-mode: normal; }
.radar-map .leaflet-control-attribution a { color: var(--teal-text); }
.radar-time {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.radar-controls { display: flex; align-items: center; gap: 14px; padding: 14px 28px 4px; }
.play-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}
.play-btn:hover { background: #244A6B; }
.radar-range { flex: 1; min-width: 0; }
.radar-range input { width: 100%; height: 24px; margin: 0; accent-color: var(--teal); cursor: pointer; }
.radar-ticks { display: flex; justify-content: space-between; margin-top: 2px; font-size: 12px; color: var(--muted); }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 8px 28px 18px;
  font-size: 12px;
  color: var(--muted);
}
.legend-swatch { display: inline-block; width: 16px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }

/* --------------------------------------------------------------------------
   The week ahead
   -------------------------------------------------------------------------- */

.week { margin-top: var(--gap); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 12px 20px 20px; }

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.day + .day::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 20px;
  bottom: 20px;
  border-left: 1px solid var(--line-soft);
}
.day:hover { background: var(--surface-subtle); }
.day[aria-pressed="true"] { background: var(--teal-tint); border-color: var(--teal-border); }
.day[aria-pressed="true"]::before,
.day[aria-pressed="true"] + .day::before { display: none; }

.day-name { font-size: 15px; font-weight: 600; }
.day-name span { font-weight: 400; color: var(--muted); }
.day .wx-icon { width: 48px; height: 48px; }
.day-temps { font-size: 18px; font-weight: 600; }
.day-temps span { margin-left: 8px; font-weight: 500; color: var(--muted); }
.day-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.day-cond { font-size: 14px; text-align: center; color: var(--ink-2); }

.days-skeleton { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; padding: 20px 26px 24px; }
.days-skeleton > div { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* --------------------------------------------------------------------------
   Warning advisory
   -------------------------------------------------------------------------- */

.advisories:empty { display: none; }

.advisory {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: var(--gap);
  padding: 18px 20px 18px 22px;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-panel);
  background: var(--warn-bg);
}
.advisory > svg { flex: none; }

.advisory-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--warn-badge);
  color: var(--warn-ink);
  font-size: 13px;
  font-weight: 700;
}
/* Level is always named in the badge text; colour only reinforces it */
.advisory-badge.amber { background: #F0A43A; color: #3B2200; }
.advisory-badge.red { background: #B42318; color: #fff; }

.advisory h3 { margin: 8px 0 4px; font-size: 17px; font-weight: 700; color: var(--ink); }
.advisory p { margin: 0; max-width: 76ch; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.advisory .advisory-meta { margin-top: 6px; font-size: 13px; color: #5C5130; }
.advisory .advisory-meta a { color: #5C5130; font-weight: 600; }

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: #5C5130;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); }

/* --------------------------------------------------------------------------
   Info cards
   -------------------------------------------------------------------------- */

.info-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }

.info-card { padding: 20px 22px; }
.info-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}
.info-value { margin-top: 10px; font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); }
.info-value .sep { color: var(--muted); font-weight: 500; }
.info-card p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

.scale { display: flex; gap: 4px; margin-top: 12px; }
.scale i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.scale i.on { background: var(--teal); }

.text-btn {
  min-height: 44px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-text);
  cursor: pointer;
}
.text-btn:hover { color: var(--teal-text-hover); text-decoration: underline; }
.info-card .unavailable { padding: 16px 0 0; text-align: left; font-size: 14px; }
.info-card .unavailable b { margin: 0 0 2px; font-size: 15px; }
.info-card .btn-secondary { margin-top: 10px; }

/* --------------------------------------------------------------------------
   Air quality modal
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(16, 42, 67, .45);
  cursor: pointer;
}
.dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(16, 42, 67, .25);
  animation: dw-dialog-in .18s ease-out;
}
@keyframes dw-dialog-in { from { opacity: 0; transform: translateY(6px); } }

.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dialog-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); }
.dialog-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.dialog-head .icon-btn { color: var(--ink-2); }
.dialog-foot { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.pollutants { margin-top: 16px; }
.pollutant {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 112px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
}
.pollutant b { color: var(--ink); }
.pollutant small { display: block; font-size: 13px; color: var(--muted); }
.pollutant-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #4FB7A8 0%, #9CCB5C 30%, #E9C24A 55%, #E58A3A 78%, #C2412D 100%);
}
.pollutant-bar i {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}
.pollutant-label { text-align: right; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Homepage breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .hero::before { background: linear-gradient(90deg, var(--hero-overlay) 0%, rgba(9, 24, 38, .64) 50%, rgba(9, 24, 38, .48) 85%, rgba(9, 24, 38, .3) 100%); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .info-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 44px; }
}

@media (max-width: 760px) {
  .hero { min-height: 0; margin-top: 16px; background-image: url("../assets/images/hero-vale-of-clwyd-900.jpg?v=1"); }
  .hero::before { background: linear-gradient(180deg, rgba(9, 24, 38, .62) 0%, rgba(9, 24, 38, .84) 100%); }
  .hero-inner { gap: 18px; padding: 22px 20px; }
  .hero h1 { font-size: 30px; }
  .hero-loc { margin-top: 8px; font-size: 15px; }
  .hero-now { gap: 16px; }
  .hero-temp { gap: 12px; }
  .hero-deg { font-size: 68px; }
  .hero-temp .wx-icon { width: 64px; height: 64px; }
  .hero-desc { margin-top: 4px; font-size: 16px; }
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    width: 100%;
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .28);
  }
  .hero-stat dd { font-size: 16px; }
  .hero-credit { display: none; }
  .hero-more { gap: 10px; }
  .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; width: 100%; padding: 12px 14px; }

  .home-grid { margin-top: 16px; }
  .hourly-scroller { padding: 10px 18px 4px; }
  .hourly-scroll::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 44px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface));
    pointer-events: none;
  }
  .scroll-cue { display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 18px 0; font-size: 13px; color: var(--muted); }
  .hour-detail { padding: 6px 18px 18px; }
  .radar-map { margin: 12px 18px 0; }
  .radar-controls { padding: 12px 18px 4px; }
  .legend { padding: 8px 18px 16px; }

  .week { margin-top: 16px; }
  .days { grid-template-columns: minmax(0, 1fr); padding: 4px 8px 10px; }
  .day {
    display: grid;
    grid-template-columns: 64px 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 12px;
    min-height: 66px;
    padding: 10px;
    text-align: left;
  }
  .day + .day::before { left: 10px; right: 10px; top: -1px; bottom: auto; border-left: 0; border-top: 1px solid var(--line-soft); }
  .day .wx-icon { width: 38px; height: 38px; }
  .day-name { display: flex; flex-direction: column; line-height: 1.25; }
  .day-name span { font-size: 13px; }
  .day-mid { order: 3; align-items: flex-start; gap: 2px; }
  .day-cond { text-align: left; }
  .day-temps { order: 4; font-size: 17px; text-align: right; }
  .day-temps span { margin-left: 6px; }
  .days-skeleton { grid-template-columns: minmax(0, 1fr); padding: 12px 18px; }
  .days-skeleton > div { flex-direction: row; }

  .advisory { margin-top: 16px; padding: 16px; gap: 12px; }
  .advisory p { font-size: 14px; }
  .info-cards { gap: 12px; margin-top: 16px; }
  .info-card { padding: 16px; }
  .info-value { font-size: 20px; }

  .dialog { padding: 20px; }
  .pollutant { grid-template-columns: 64px minmax(0, 1fr); }
  .pollutant-label { grid-column: 1 / -1; margin-top: -6px; text-align: left; }
}

@media (max-width: 480px) {
  .info-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .dialog { animation: none; }
}

/* ==========================================================================
   10-day forecast (forecast.html)
   ========================================================================== */

.fc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.fc-head { padding: 20px 24px 4px; }
.fc-days { padding: 8px 12px 14px; }

.fc-row {
  position: relative;
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 96px 40px minmax(0, 1fr) 56px 88px 210px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.fc-row + .fc-row::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: -1px;
  border-top: 1px solid var(--line-soft);
}
.fc-row:hover { background: var(--surface-subtle); }
.fc-row[aria-pressed="true"] { background: var(--teal-tint); border-color: var(--teal-border); }
.fc-row[aria-pressed="true"]::before,
.fc-row[aria-pressed="true"] + .fc-row::before { display: none; }
.fc-row .wx-icon { width: 38px; height: 38px; }

.fc-day { display: flex; flex-direction: column; font-size: 15px; font-weight: 600; line-height: 1.25; }
.fc-day span { font-size: 13px; font-weight: 400; color: var(--muted); }
.fc-cond { font-size: 14px; color: var(--ink-2); }
.fc-wind { font-size: 13px; color: var(--muted); }

.fc-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px dashed var(--decor);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  vertical-align: 1px;
}

.fc-range { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; gap: 8px; font-size: 15px; }
.fc-range .lo { text-align: right; color: var(--muted); }
.fc-range .hi { font-weight: 600; }
.fc-track { position: relative; height: 6px; border-radius: 3px; background: #EEF2F4; }
.fc-track i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--teal); }
.fc-row.trend .fc-track i { background: repeating-linear-gradient(90deg, #7FC2C5 0 6px, transparent 6px 9px); }

.fc-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 6px;
  padding: 12px 12px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.fc-divider svg { flex: none; }

.fc-row-skeleton { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 12px; }

.fc-detail { padding: 0 24px 24px; }
.fc-summary { max-width: 60ch; margin: 8px 0 16px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.fc-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.fc-facts b { font-weight: 600; color: var(--ink); }

.fc-table-box { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-control); }
.fc-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 14px; }
.fc-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #FAFBFB;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
}
.fc-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink); }
.fc-table tr:last-child td { border-bottom: 0; }
.fc-table .num { font-weight: 600; }
.fc-weather { white-space: nowrap; }
.fc-weather .wx-icon { display: inline-block; width: 30px; height: 30px; margin-right: 8px; vertical-align: middle; }

.fc-trend-msg {
  padding: 20px;
  border: 1px dashed var(--nav-hover-line);
  border-radius: var(--radius-control);
  background: #FAFBFB;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ==========================================================================
   Outdoors (outdoors.html)
   ========================================================================== */

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}
.seg button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { background: var(--hover); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }

.acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }

.act { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 22px; }
.act-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.act h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.act h2 svg { flex: none; }
.act-where { margin-top: 2px; font-size: 13px; color: var(--muted); }
.act p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.act .unavailable { padding: 8px 0 0; text-align: left; font-size: 14px; }

/* The rating is always named in text, with an icon; colour only supports it */
.rate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.rate.good { background: #E1F3EC; color: #145C45; }
.rate.fair { background: #FFF1D2; color: #6B4A00; }
.rate.poor { background: #ECEFF3; color: #3E4C59; }

.act-facts { display: grid; margin: 0; }
.act-facts div,
.od-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
}
.act-facts dt,
.od-list dt { color: var(--muted); }
.act-facts dd,
.od-list dd { margin: 0; font-weight: 600; text-align: right; color: var(--ink); }

.od-duo {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
  align-items: start;
}
.od-head { padding: 20px 24px 4px; }
.od-body { padding: 8px 24px 24px; }

.od-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 18px; }
.od-stat { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius-control); }
.od-stat .k,
.od-stat .n { font-size: 13px; color: var(--muted); }
.od-stat .v { margin-top: 2px; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); }
.od-stat .n { margin-top: 2px; }

.od-tide { position: relative; height: 150px; }
.od-tide svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.od-now-line { position: absolute; top: 0; bottom: 22px; border-left: 1px dashed #7FC2C5; }
.od-now-tag {
  position: absolute;
  top: -2px;
  transform: translateX(-50%);
  padding: 0 4px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-text);
}
.od-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--muted-2); }

.od-tides { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.od-tides div { padding: 10px 12px; border-radius: var(--radius-small); background: var(--surface-subtle); font-size: 13px; color: var(--muted); }
.od-tides b { display: block; margin-top: 2px; font-size: 16px; color: var(--ink); }
.od-small { font-size: 12px; }
.od-note { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

.od-moon-row { display: flex; align-items: center; gap: 18px; margin: 8px 0 16px; }
.od-moon { flex: none; }
.od-moon-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink); }
.od-list { display: grid; margin: 0; }
.od-list div { padding: 10px 0; }

.od-aurora {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.od-aurora svg { flex: none; margin-top: 1px; }
.od-aurora b { color: var(--ink); }

.od-light { margin-top: var(--gap); }
.od-bar { display: flex; height: 22px; margin: 12px 0 6px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.od-bar span { display: block; height: 100%; }
.od-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.od-legend > div { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); }
.od-legend b { display: block; font-size: 15px; color: var(--ink); }
.od-swatch { flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Forecast and Outdoors breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .fc-layout { grid-template-columns: minmax(0, 1fr); }
  .acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-duo { grid-template-columns: minmax(0, 1fr); }
  .od-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .fc-head,
  .od-head { padding: 16px 16px 4px; }
  .fc-days { padding: 4px 6px 10px; }
  .fc-row { grid-template-columns: 62px 34px minmax(0, 1fr) 92px; gap: 4px 10px; padding: 8px; }
  .fc-row .fc-wind { display: none; }
  .fc-row .fc-day { grid-column: 1; grid-row: 1 / 3; }
  .fc-row .wx-icon { grid-column: 2; grid-row: 1 / 3; width: 32px; height: 32px; }
  .fc-row .fc-cond { grid-column: 3; grid-row: 1; }
  .fc-row .rain-chance { grid-column: 3; grid-row: 2; }
  .fc-row .fc-range { grid-column: 4; grid-row: 1 / 3; grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 4px; font-size: 14px; }
  .fc-detail { padding: 0 16px 16px; }

  .acts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .od-duo,
  .od-light { margin-top: 16px; gap: 16px; }
  .od-body { padding: 8px 16px 16px; }
  .od-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .od-tides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-legend { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Rain radar (radar.html)
   ========================================================================== */

.radar-page { padding-top: 6px; }
/* A height range rather than a ratio: max-height with aspect-ratio would also narrow the map */
.radar-map.radar-map-large { aspect-ratio: auto; height: clamp(360px, 68vh, 720px); margin-top: 22px; }
.radar-note { margin: 0; padding: 0 28px 22px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* Leaflet's zoom buttons, enlarged to 44px targets */
.radar-map .leaflet-control-zoom { border: 1px solid var(--control-border); border-radius: var(--radius-small); box-shadow: var(--shadow-panel); }
.radar-map .leaflet-control-zoom a {
  width: 44px;
  height: 44px;
  line-height: 44px;
  font-size: 22px;
  color: var(--ink);
}
.radar-map .leaflet-control-zoom a:hover { background: var(--hover); }
.radar-map .leaflet-control-zoom a:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.radar-map .leaflet-container:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }

/* ==========================================================================
   History (history.html)
   ========================================================================== */

.hist-date { margin: -6px 0 20px; font-size: 15px; color: var(--ink-2); }
.hist-date #almanac-date { font-weight: 600; color: var(--ink); }

.hist-unavailable { margin-bottom: var(--gap); }

.hist-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.hist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }

.hist-card { padding: 20px 28px 22px; }
.hist-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.hist-highlight { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink); }

.hist-table-box { overflow-x: auto; }
.hist-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.hist-table th,
.hist-table td { padding: 11px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.hist-table th:first-child { padding-left: 0; }
.hist-table th:last-child,
.hist-table td:last-child { padding-right: 0; }
.hist-table thead th { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom-color: var(--line); }
.hist-table tbody th { font-weight: 500; color: var(--ink-2); }
.hist-table td { color: var(--ink); white-space: nowrap; }
.hist-table td.num { font-weight: 600; }
.hist-table tbody tr:last-child > * { border-bottom: 0; }

.hist-note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.hist-note:empty { display: none; }
.hist-footnote { margin: 20px 0 0; font-size: 13px; color: var(--muted); }

/* ==========================================================================
   About, Privacy and Contact (about.html, privacy.html, feedback.html)
   ========================================================================== */

.info-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
.info-stack { display: grid; gap: var(--gap); }
.info-narrow { max-width: 780px; }

.info-card { padding: 24px 28px 26px; }
.info-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.info-card p,
.info-card li { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.info-card p { margin: 0 0 12px; max-width: 72ch; }
.info-card > :last-child { margin-bottom: 0; }
.info-card ul { margin: 0 0 12px; padding-left: 22px; }
.info-card li + li { margin-top: 6px; }

/* Privacy policy: one panel, sections divided by rules */
.policy section + section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.policy h2 { font-size: 20px; }

.info-note { font-size: 14px; color: var(--muted); }
.info-card p.info-note { font-size: 14px; color: var(--muted); }

/* Towns covered, grouped by area (filled by main.js) */
.town-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.town-group {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
}
.town-group h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.info-card .town-group ul { margin: 0; padding: 0; list-style: none; }
.info-card .town-group li { font-size: 15px; line-height: 1.5; }
.info-card .town-group li + li { margin-top: 2px; }
.town-group small { color: var(--muted); font-size: 14px; }

/* Data sources */
.source-group {
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-card h2 + .source-group { margin-top: 4px; }
.info-card ul.source-list { margin: 0; padding: 0; list-style: none; }
.info-card .source-list li { font-size: 15px; line-height: 1.5; }
.info-card .source-list li + li { margin-top: 4px; }

/* Stacked links with full-size targets */
.info-card ul.link-list { margin: 0; padding: 0; list-style: none; }
.info-card .link-list li + li { margin-top: 0; }
.link-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}
.link-list a:hover { text-decoration: underline; }

/* Contact form */
.form-card { max-width: 640px; }
.field + .field { margin-top: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.field-optional { font-weight: 400; color: var(--muted); }
.info-card p.field-hint { margin: -2px 0 6px; font-size: 14px; color: var(--muted); }
.info-card p.field-error { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: #B42318; }

.input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--control-bg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--muted-2); opacity: 1; }
.input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background: var(--surface);
}
.input[aria-invalid="true"] { border-color: #B42318; }
textarea.input { min-height: 140px; resize: vertical; }
select.input { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2352606D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

.btn-primary {
  min-height: 44px;
  margin-top: 22px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--ink);
  font: inherit;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: #244A6B; }
.btn-primary:disabled { cursor: default; background: var(--muted); }

.form-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #F1B5AE;
  border-radius: var(--radius-small);
  background: #FDF1F0;
  font-size: 15px;
  color: #8A1C12;
}
.form-done h2 { margin-top: 0; }

/* --------------------------------------------------------------------------
   About this page: a short description at the foot of each weather page,
   so search engines and readers without JavaScript know what it covers
   -------------------------------------------------------------------------- */

.page-about {
  max-width: 80ch;
  margin: calc(var(--gap) + 8px) 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Town pages (/weather/{town}) and links to them
   -------------------------------------------------------------------------- */

.town-panel { margin-top: var(--gap); }
.town-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 14px 28px 22px;
  list-style: none;
}
.town-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.town-chips a:hover { border-color: var(--teal-border); background: var(--teal-tint); }
.info-card .town-chips { padding: 6px 0 0; }
/* The pills sit in a row, so they skip the spacing between stacked list items */
.info-card .town-chips li + li { margin-top: 0; }

.footer-towns { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; }
.footer-towns a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--ink-2);
  text-decoration: none;
}
.footer-towns a:hover { color: var(--ink); text-decoration: underline; }

.town-summary {
  max-width: 80ch;
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
}
.town-summary .meta { white-space: nowrap; }

.town-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); margin-top: var(--gap); }
.town-climate .hist-table td,
.town-climate .hist-table tbody th { white-space: nowrap; }

.faq h3 { margin: 18px 0 4px; font-size: 16px; font-weight: 700; color: var(--ink); }
.faq h3:first-child { margin-top: 4px; }
.faq p { margin: 0; }
.faq a { font-weight: 600; }

/* --------------------------------------------------------------------------
   Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .info-layout { grid-template-columns: minmax(0, 1fr); }
  .hist-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-header .wrap { column-gap: 20px; }
  .site-nav a { padding: 0 10px; }
  /* Search and language move together: the search narrows first, then the
     pair drops to a second row, right aligned, when the nav needs the room */
  .header-tools { flex: 1 1 300px; max-width: 436px; gap: 16px; }
  .search { flex: 1 1 auto; width: auto; min-width: 0; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --gap: 16px; }
  .hist-top,
  .hist-grid { grid-template-columns: minmax(0, 1fr); }
  .hist-card { padding: 18px 18px 20px; }
  .hist-table { font-size: 14px; }
  .hist-table th,
  .hist-table td { padding: 10px 5px; }
  .radar-map.radar-map-large { height: clamp(320px, 62vh, 560px); }
  .radar-note { padding: 0 18px 18px; }

  .site-header .wrap {
    gap: 10px;
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 12px;
  }
  /* On narrow phones the wordmark wraps to two lines so the language
     toggle and menu button keep their 44px targets on the same row */
  .brand { font-size: 17px; line-height: 1.1; order: 0; flex: 1 1 0; min-width: 0; }
  .lang-toggle { order: 1; margin-left: auto; flex: none; }

  .menu-btn {
    display: grid;
    place-items: center;
    order: 2;
    flex: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }

  .header-tools { display: contents; }
  .search { order: 3; flex-basis: 100%; width: 100%; }

  .site-nav {
    display: none;
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    align-self: auto;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    min-height: 48px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line-soft);
    border-left: 3px solid transparent;
  }
  .site-nav a:hover { border-bottom-color: var(--line-soft); }
  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--line-soft);
    border-left-color: var(--teal);
    background: var(--teal-wash);
  }

  .pagehead { margin: 20px 0 14px; }
  .pagehead h1 { font-size: 28px; }

  .info-card { padding: 18px 18px 20px; }
  .info-card h2 { font-size: 19px; }
  .town-groups { grid-template-columns: minmax(0, 1fr); }

  .panel-head { padding: 16px 18px 0; }
  .panel-head h2 { font-size: 19px; }
  .unavailable { padding: 32px 18px 36px; }

  .site-footer { margin-top: 28px; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
  .site-footer .footer-useful { gap: 0; }
  /* Stacked, so short names like Rhyl line up with the rest rather than centring in their tap target */
  .footer-towns a { justify-content: flex-start; }
  .footer-meta { text-align: left; }
  .footer-meta .disclaimer { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
