/* ==========================================================================
   Bega Valley Business Directory: design system
   Baseline: docs/reference/landing-mockup-v2.html (approved by the owner).
   Mobile first. Breakpoints: 40em (640px), 60em (960px).
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  /* Colour: gunmetal neutrals, brand teal as the single accent (light) */
  --bg: #F4F5F6;
  --surface: #FFFFFF;
  --surface-2: #ECEEF0;
  --ink: #16191C;
  --ink-2: #424950;
  --muted: #6B737B;
  --line: #DDE1E4;
  --brand: #1B2024;
  --on-brand: #FFFFFF;
  --accent: #17806D;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F0EC;
  --hero-1: #1A1F23;
  --hero-2: #2A3238;
  --map-land: #E8EBED;
  --map-sea: #D9E2E6;
  --shadow: 0 1px 2px rgba(22, 25, 28, .06), 0 4px 16px rgba(22, 25, 28, .06);

  /* Text roles. --muted and --accent fall just short of WCAG AA (4.5:1) as small
     text on --bg, so small text uses these slightly deeper values instead. */
  --text-muted: #5A626A;
  --link: #146E5E;

  /* Fixed brand surfaces (same in both themes) */
  --hero-text: #FFFFFF;
  --hero-muted: #B8C0C6;
  --hero-highlight: #7FD9C4;
  --hero-line: rgba(255, 255, 255, .18);
  --footer-text: #B8C0C6;
  --footer-muted: #8E979E;
  --focus: var(--accent);

  /* Type */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, sans-serif;
  --text-xs: .8125rem;   /* 13px meta, captions */
  --text-sm: .875rem;    /* 14px UI, nav, buttons */
  --text-md: 1rem;       /* 16px body */
  --text-lg: 1.125rem;   /* 18px lead */
  --text-h3: 1.25rem;    /* 20px card and panel titles */
  --text-h2: 1.5rem;     /* 24px section titles (26px from 40em) */
  --text-h1: 2rem;       /* 32px page titles (fluid up to 46px in the hero) */

  /* Space (4px base) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 4.5rem;
  --gutter: 1rem;

  /* Shape */
  --r-sm: 6px;   /* buttons, inputs, chips inside panels */
  --r: 8px;      /* cards, tiles */
  --r-lg: 10px;  /* large panels: feature, map, CTA */
  --header-h: 4rem;

  color-scheme: light;
}

/* Dark tokens. Keep in sync with the prefers-color-scheme block below. */
:root[data-theme="dark"] {
  --bg: #0F1215;
  --surface: #171B1F;
  --surface-2: #1E2328;
  --ink: #E8EBED;
  --ink-2: #B4BBC1;
  --muted: #8B939A;
  --line: #2A3036;
  --brand: #14181B;
  --on-brand: #FFFFFF;
  --accent: #3CC2A5;
  --accent-ink: #04201C;
  --accent-soft: #17302C;
  --hero-1: #12161A;
  --hero-2: #1F262C;
  --map-land: #1E2328;
  --map-sea: #14191D;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .3);
  --text-muted: #8B939A;
  --link: #3CC2A5;
  color-scheme: dark;
}

/* No JavaScript: follow the device setting. Keep in sync with :root[data-theme="dark"] above. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0F1215;
    --surface: #171B1F;
    --surface-2: #1E2328;
    --ink: #E8EBED;
    --ink-2: #B4BBC1;
    --muted: #8B939A;
    --line: #2A3036;
    --accent: #3CC2A5;
    --accent-ink: #04201C;
    --accent-soft: #17302C;
    --hero-1: #12161A;
    --hero-2: #1F262C;
    --map-land: #1E2328;
    --map-sea: #14191D;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px rgba(0, 0, 0, .3);
    --text-muted: #8B939A;
    --link: #3CC2A5;
    color-scheme: dark;
  }
}

@media (min-width: 40em) {
  :root { --gutter: 1.5rem; --text-h2: 1.625rem; --text-h1: 2.25rem; --header-h: 4.25rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s-4)); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }
main:focus { outline: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 var(--s-3);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: 700; }
h4 { font-size: var(--text-md); font-weight: 700; }

p { margin: 0 0 var(--s-4); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--link); }

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

.skip-link {
  position: absolute; left: var(--s-4); top: -10rem; z-index: 20;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: var(--s-3); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.icon { flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 2.75rem; padding: .625rem 1rem;
  font: 600 var(--text-sm)/1.2 var(--font-body);
  border: 1px solid transparent; border-radius: var(--r-sm);
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-inverse { background: transparent; color: var(--hero-text); border-color: var(--hero-line); }
.btn-inverse:hover { border-color: var(--hero-highlight); color: var(--hero-text); }
.btn-sm { min-height: 2.25rem; padding: .4375rem .75rem; font-size: var(--text-xs); }
.btn-lg { min-height: 3rem; padding: .875rem 1.375rem; font-size: var(--text-md); }

.icon-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: transparent; color: var(--ink); cursor: pointer; padding: 0;
}
.icon-btn:hover { border-color: var(--accent); }

/* Theme toggle: moon in light (go dark), sun in dark (go light). */
[data-theme-toggle] .icon-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .icon-sun { display: block; }
:root[data-theme="dark"] [data-theme-toggle] .icon-moon { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header-row {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s-4);
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: var(--s-3); min-width: 0; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 2.375rem; height: 2.375rem; border-radius: var(--r-sm); }
.brand-name { display: flex; flex-direction: column; min-width: 0; }
.brand-name b { font: 800 1.0625rem/1.1 var(--font-head); letter-spacing: -.01em; }
.brand-name small { font-size: .6875rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); line-height: 1.5; }

.header-tools { display: flex; gap: var(--s-2); margin-left: auto; }

.site-nav { width: 100%; order: 3; padding: var(--s-2) 0 var(--s-4); }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }

.nav-links { list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: var(--s-3) 0;
  font-weight: 500; font-size: var(--text-md); color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.nav-links a:hover { color: var(--link); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.nav-actions { display: grid; gap: var(--s-2); margin-top: var(--s-4); }

.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (min-width: 60em) {
  .site-header-row { flex-wrap: nowrap; }
  .header-tools { order: 2; margin-left: 0; }
  .header-tools .menu-toggle { display: none; }
  .site-nav, .js .site-nav {
    display: flex; align-items: center; gap: var(--s-6);
    width: auto; order: 1; margin-left: auto; padding: 0;
  }
  .nav-links { display: flex; gap: var(--s-6); }
  .nav-links a {
    padding: var(--s-2) 0; border: 0; font-size: var(--text-sm);
    box-shadow: inset 0 -2px 0 transparent;
  }
  .nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .nav-actions { display: flex; gap: var(--s-3); margin: 0; }
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, var(--hero-1), var(--hero-2));
  color: var(--hero-text);
  padding: var(--s-7) 0 var(--s-8);
  --focus: var(--hero-highlight);
}
.hero::after {
  content: ""; position: absolute; right: -6rem; top: -4rem;
  width: 26rem; height: 26rem;
  background: url("../icons/icon-512.png") center / contain no-repeat;
  opacity: .06; pointer-events: none;
}
.hero > .wrap { position: relative; z-index: 1; }
.hero-places { margin: 0 0 var(--s-3); font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; color: var(--hero-highlight); }
.hero-title {
  color: var(--hero-text);
  font-size: clamp(2rem, 1.35rem + 2.6vw, 2.875rem);
  line-height: 1.08; max-width: 45rem; margin: 0 0 var(--s-4);
}
.hero-lead { color: var(--hero-muted); font-size: var(--text-lg); max-width: 38rem; margin: 0 0 var(--s-6); }

@media (min-width: 60em) {
  .hero { padding: 4.75rem 0 5.25rem; }
}

/* Search form: stacked on mobile, one bar from 40em. */
.search {
  display: grid; gap: var(--s-2);
  max-width: 47.5rem; padding: var(--s-2);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r); box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
  --focus: var(--accent);
}
.search-field { display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-3); color: var(--text-muted); min-width: 0; }
.search-field + .search-field { border-top: 1px solid var(--line); }
.search-input, .search-select {
  flex: 1; min-width: 0; min-height: 3rem;
  border: 0; background: transparent; color: var(--ink);
  font: 400 var(--text-md)/1.4 var(--font-body);
}
.search-input::placeholder { color: var(--text-muted); opacity: 1; }
.search-input:focus-visible, .search-select:focus-visible { outline: none; }
/* The inputs drop their own outline; the whole field shows focus instead, at every width. */
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-sm); }
.search-select { cursor: pointer; appearance: none; background-image: none; }
/* The open list is drawn by the browser; without these it keeps a white background under the theme's text colour. */
.search-select option { background: var(--surface); color: var(--ink); }
.search-select option:checked { background: var(--accent-soft); color: var(--ink); }
.search .btn { min-height: 3rem; padding: 0 var(--s-5); font-size: var(--text-md); }

@media (min-width: 40em) {
  .search { display: flex; padding: .375rem; }
  .search-field { flex: 1; }
  .search-field + .search-field { flex: .55; border-top: 0; border-left: 1px solid var(--line); }
  .search-field:focus-within .icon { color: var(--accent); }
}

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); font-size: var(--text-xs); color: var(--hero-muted); }
.chips ul { display: contents; list-style: none; }
.chip {
  display: inline-block; padding: .3125rem .75rem;
  border: 1px solid var(--hero-line); border-radius: 999px; color: var(--hero-text);
}
.chip:hover { border-color: var(--hero-highlight); color: var(--hero-text); }

/* ---------- Page head (inner pages) ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--s-5) 0 var(--s-6); }
.page-head-row { display: flex; align-items: flex-start; gap: var(--s-4); }
.page-head-mark {
  display: grid; place-items: center; flex: none;
  width: 3rem; height: 3rem; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent);
}
.page-head h1 { margin: 0 0 var(--s-2); }
.page-lead { color: var(--ink-2); font-size: var(--text-lg); max-width: 40rem; margin: 0; }
.page-head .breadcrumbs { margin-bottom: var(--s-4); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: var(--text-xs); color: var(--text-muted); }
.breadcrumbs li { display: flex; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs li + li::before { content: "/"; margin: 0 var(--s-2); color: var(--line); }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs a:hover { color: var(--link); }
.breadcrumbs [aria-current="page"] { color: var(--text-muted); }

/* ---------- Sections ---------- */
.section { padding: var(--s-7) 0 0; }
.section:last-child { padding-bottom: var(--s-8); }
@media (min-width: 40em) { .section { padding-top: var(--s-8); } }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s-2) var(--s-5); margin-bottom: var(--s-5); }
.section-head h2 { margin: 0; }
.section-head p { margin: var(--s-1) 0 0; color: var(--text-muted); }
.section-link { font-size: var(--text-sm); font-weight: 600; color: var(--link); }
.section-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-3); list-style: none; margin: 0; padding: 0; }
@media (min-width: 40em) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 60em) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.cat {
  display: flex; align-items: center; gap: var(--s-4); height: 100%;
  padding: 1.125rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, transform .15s;
}
.cat:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.cat-mark {
  display: grid; place-items: center; flex: none;
  width: 2.5rem; height: 2.5rem; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent);
}
.cat-text { min-width: 0; }
.cat-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cat-desc { display: block; font-size: var(--text-xs); color: var(--text-muted); overflow-wrap: anywhere; }

/* ---------- Featured business ---------- */
.feature {
  display: grid; grid-template-columns: 1fr;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}
@media (min-width: 60em) { .feature { grid-template-columns: 1.1fr 1fr; } }

/* The "slice of the business's own brand". The home page links the featured business's
   /<slug>/theme.css, which sets --bv-* on :root; the fallbacks are the Bold template defaults. */
.feature-brand {
  display: flex; flex-direction: column; justify-content: center; gap: var(--s-3);
  min-height: 13rem; padding: var(--s-6);
  background: var(--bv-hero, #0f1b2e); color: var(--bv-page, #f5f0e2);
  border-top: 4px solid var(--bv-accent, #3a8f66);
}
/* The accent itself can fall short of AA as small text on the hero, so the kicker mixes it towards the page colour. */
.feature-logo { width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover; }
.feature-kicker {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .08em; margin: 0; overflow-wrap: anywhere;
  color: color-mix(in srgb, var(--bv-accent, #3a8f66) 55%, var(--bv-page, #f5f0e2));
}
.feature-kicker::before {
  content: ""; display: block; width: 2rem; height: 3px; margin-bottom: var(--s-3);
  background: var(--bv-accent, #3a8f66); border-radius: 2px;
}
.feature-headline { font: 800 clamp(1.375rem, 1.1rem + 1vw, 1.625rem)/1.15 var(--font-head); color: var(--bv-page, #f5f0e2); margin: 0; overflow-wrap: anywhere; }
@media (min-width: 60em) {
  .feature-brand { border-top: 0; border-left: 4px solid var(--bv-accent, #3a8f66); padding: var(--s-7) var(--s-6); }
}

.feature-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); padding: var(--s-6); min-width: 0; }
.feature-body h3 { margin: var(--s-1) 0 0; font-size: 1.375rem; }
.feature-body h3 a:hover { color: var(--link); }
.feature-summary { color: var(--ink-2); margin: 0; }
.feature-body .actions { margin-top: var(--s-2); }

.badge {
  display: inline-block; padding: .25rem .5625rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  color: var(--link); background: var(--accent-soft); border-radius: 4px;
}
.meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.meta > * { display: inline-flex; align-items: center; gap: var(--s-1); }
.tags { display: flex; flex-wrap: wrap; gap: .375rem; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: .75rem; padding: .1875rem .5625rem; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-2); }

/* ---------- Towns ---------- */
.towns { display: grid; grid-template-columns: 1fr; gap: var(--s-5); align-items: stretch; }
@media (min-width: 60em) { .towns { grid-template-columns: 1.2fr 1fr; gap: var(--s-6); } }

.map { background: var(--map-sea); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.map svg { width: 100%; height: 100%; min-height: 15rem; }
.map-land { fill: var(--map-land); }
.map-coast { fill: none; stroke: var(--line); stroke-width: 2; }
.map-pin { fill: var(--accent); }
.map-pin-muted { fill: var(--muted); opacity: .45; }
.map-label { fill: var(--ink); font: 600 12px var(--font-body); }
.map-label-muted { fill: var(--text-muted); font-weight: 500; }
.map-sea-label { fill: var(--text-muted); font: 500 11px var(--font-body); letter-spacing: .2em; }
.map a:hover .map-pin, .map a:focus-visible .map-pin { fill: var(--ink); }
.map a:hover .map-label { text-decoration: underline; }

.town-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); align-content: start; list-style: none; margin: 0; padding: 0; }
.town {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--s-2);
  padding: .875rem 1rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
}
.town:hover { border-color: var(--accent); color: var(--ink); }
.town-name { font-weight: 600; min-width: 0; overflow-wrap: break-word; }
.town-count { font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------- Business cards ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); list-style: none; margin: 0; padding: 0; }
@media (min-width: 40em) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 60em) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 75em) { .card-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  position: relative; display: flex; flex-direction: column; gap: var(--s-3);
  height: 100%; padding: var(--s-4) 1.125rem 1.125rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; gap: var(--s-3); min-width: 0; }
.card-mark {
  display: grid; place-items: center; flex: none;
  width: 2.5rem; height: 2.5rem; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent);
}
.card-logo { border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.card-heading { min-width: 0; }
.card-title { margin: 0; font-size: var(--text-md); font-weight: 700; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
/* The title link covers the whole card; the call button sits above it. */
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.card-title a:focus-visible { outline: none; }
.card-title a:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.card:hover .card-title a { color: var(--link); }
.card-meta { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); margin: .125rem 0 0; font-size: var(--text-xs); color: var(--text-muted); overflow-wrap: anywhere; }
.card-meta > span + span::before { content: ""; display: inline-block; width: 1px; height: .75em; margin-right: var(--s-2); background: var(--line); vertical-align: -.05em; }
.card-text { margin: 0; font-size: var(--text-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.card-actions { position: relative; z-index: 1; margin-top: auto; padding-top: var(--s-1); }

/* ---------- Call to action band ---------- */
.cta {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-5);
  margin-top: var(--s-8); padding: var(--s-6) var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.cta h2 { margin: 0 0 var(--s-1); font-size: 1.5rem; }
.cta p { margin: 0; color: var(--text-muted); }
@media (min-width: 40em) {
  .cta { flex-direction: row; justify-content: space-between; align-items: center; padding: 2.25rem 2.5rem; }
}

/* ---------- Text pages, empty states, notices ---------- */
.prose { max-width: 42rem; padding: var(--s-6) 0 var(--s-8); color: var(--ink-2); }
.prose h2 { font-size: 1.375rem; margin-top: var(--s-6); }
.prose h3 { font-size: var(--text-lg); margin-top: var(--s-5); }
.prose h2, .prose h3 { color: var(--ink); }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--s-4); }
.prose li { margin-bottom: var(--s-1); }

.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-6) var(--s-5);
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-lg);
}
.empty h2 { margin: 0; font-size: 1.25rem; }
.empty p { margin: 0; color: var(--text-muted); max-width: 36rem; }

.notice {
  padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-5);
  font-size: var(--text-sm); color: var(--ink-2);
  background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: var(--r-sm);
}

.results-count { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--text-sm); color: var(--text-muted); margin: 0 0 var(--s-4); }

/* ---------- Directory pages ---------- */
.listing { padding-top: var(--s-6); }

.cat-count { display: block; margin-top: var(--s-1); font-size: var(--text-xs); font-weight: 600; color: var(--link); }

.card-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

/* Related pages with counts: towns within a category, categories within a town. */
.filter-links { margin: 0 0 var(--s-5); }
.filter-links-title { margin: 0 0 var(--s-2); font: 600 var(--text-xs)/1.4 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.filter-links ul { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.filter-link {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 2.25rem;
  padding: .375rem .5rem .375rem .875rem; font-size: var(--text-sm); font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.filter-link:hover { border-color: var(--accent); color: var(--ink); }
.filter-link span {
  min-width: 1.5rem; padding: 0 .4375rem; border-radius: 999px; text-align: center;
  font-size: .75rem; font-weight: 600; line-height: 1.5rem; font-variant-numeric: tabular-nums;
  background: var(--accent-soft); color: var(--link);
}

.results-links { display: inline-flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.results-count a { color: var(--link); font-weight: 600; }
.results-count a:hover { text-decoration: underline; text-underline-offset: 3px; }

.towns-empty { align-self: center; margin: 0; color: var(--text-muted); }
.towns-empty a { color: var(--link); font-weight: 600; }

/* Search page: the bar sits on the page rather than the dark hero. */
.search-page-form { margin-bottom: var(--s-5); }
.search-page-form .search { max-width: none; border: 1px solid var(--line); box-shadow: var(--shadow); }
.search-results { min-height: 6rem; }

/* 404 and 410 */
.error-page { max-width: 40rem; padding: var(--s-8) 0 var(--s-7); }
.error-page h1 { margin-bottom: var(--s-3); }
.error-page .page-lead { margin-bottom: var(--s-5); }
.error-code { margin: 0 0 var(--s-2); font: 800 var(--text-sm)/1 var(--font-head); letter-spacing: .14em; color: var(--link); }

/* Contact page */
.contact-card {
  display: flex; align-items: flex-start; gap: var(--s-4);
  margin: 0 0 var(--s-6); padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.contact-card h2 { margin: 0 0 var(--s-1); font-size: var(--text-h3); }
.contact-card p { margin: 0 0 var(--s-2); }
.contact-card p:last-child { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.contact-card a { font-size: var(--text-lg); font-weight: 600; text-decoration: none; }
.contact-card-mark {
  display: grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent);
}
.page-updated { margin-top: var(--s-6); font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--s-9); padding: var(--s-7) 0 var(--s-5);
  background: var(--brand); color: var(--footer-text); font-size: var(--text-sm);
  --focus: var(--hero-highlight);
}
.footer-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); }
.footer-about { grid-column: 1 / -1; }
.footer-about p { margin: var(--s-3) 0 0; max-width: 19rem; }
@media (min-width: 60em) {
  .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-about { grid-column: auto; }
}
.brand-inverse, .brand-inverse:hover { color: var(--on-brand); }
.brand-inverse .brand-name small { color: var(--footer-muted); }
.footer-col h2 { margin: 0 0 var(--s-3); font-size: var(--text-sm); font-weight: 700; color: var(--on-brand); letter-spacing: 0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: inline-block; padding: .25rem 0; }
.footer-col a:hover { color: var(--on-brand); }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5);
  margin-top: var(--s-6); padding-top: 1.125rem;
  border-top: 1px solid rgba(255, 255, 255, .1); font-size: var(--text-xs);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .cat:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .search, .chips { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { background: none; color: #000; padding: 0; }
  .hero-title { color: #000; }
}
