:root {
  --ink: #241910;
  --bark: #3b2a1a;
  --moss: #234033;
  --moss-deep: #173028;
  --leaf: #3d6b4f;
  --honey: #a8622a;
  --cream: #f4efe6;
  --paper: #fbf8f3;
  --card: #fffdf9;
  --line: #e3d7c6;
  --muted: #5e5348;
  --focus: #8a3e12;
  --shadow: 0 12px 30px rgba(36, 25, 16, 0.08);
  --radius: 16px;
  --wrap: 1120px;
  --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--leaf); }
a:hover { color: var(--moss-deep); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 248, 243, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--bark);
  font-family: var(--serif);
  line-height: 1.05;
  margin-right: auto;
}
.brand strong { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.brand span { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--honey); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-weight: 700;
  cursor: pointer;
}
.primary-nav { display: none; width: 100%; }
.nav-toggle:checked ~ .primary-nav { display: block; }
.primary-nav ul { list-style: none; margin: 0 0 12px; padding: 0; }
.primary-nav a {
  display: block;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--bark);
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}
.primary-nav a[aria-current="page"] { color: var(--honey); }

.hero { position: relative; min-height: 420px; display: grid; place-items: center; color: #fff; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 48, 40, 0.25), rgba(23, 48, 40, 0.72)); }
.hero-card, .search-panel {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100% - 32px));
  background: rgba(255, 253, 249, 0.96);
  color: var(--ink);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.search-label, .hero-card label {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  margin-bottom: 10px;
}
.search-form .search-label {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--honey);
  margin: 0;
}
.search-form, .hero-card form { display: flex; flex-direction: column; gap: 10px; }
.search-form { margin: 4px 0 20px; }
.search-form input, .hero-card input[type="text"], .prose input, input.postcode {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  background: #fff;
}
button, input[type="submit"], .btn {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--honey);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
}
button:hover, input[type="submit"]:hover { background: #8d4e1c; }

.page { padding: 36px 0 64px; }
.prose h1, .page h1, h1.black {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--bark);
}
.prose p { font-size: 1.08rem; color: var(--muted); }
.prose a { font-weight: 650; }

.browse-grid, .index-grid, .card-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.browse-card, .index-card, .supplier-card, .result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.browse-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
}
.browse-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--moss);
  border-radius: 14px;
  padding: 8px;
}
.browse-card span { font-family: var(--serif); font-size: 1.25rem; color: var(--bark); }
.index-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  color: var(--moss);
}
.index-card:hover, .supplier-card:hover { border-color: #c9b89a; }
.letter-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.letter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--moss);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.letter-nav a[aria-current="page"] { background: var(--honey); }
.supplier-card, .result-card { padding: 18px 18px 16px; }
.supplier-card .title, .result-card .title { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 8px; }
.supplier-card .title a, .result-card .title a { color: var(--bark); text-decoration: none; }
.supplier-card .content, .result-card .content, .distance { color: var(--muted); }
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3e2c4;
  color: #6a3d12;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}
.company-layout, .search-layout { display: grid; gap: 22px; }
.search-layout #map { order: 2; height: 240px; }
.search-results { order: 1; }
.search-results h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 28px 0 0;
  color: var(--bark);
}
.detail-card, .map-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.map-card { display: flex; padding: 10px; }
.detail-line { margin: 0 0 10px; }
.detail-line label { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--honey); }
.visit {
  display: inline-flex;
  margin-top: 8px;
  text-decoration: none;
  background: var(--moss);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
}
.visit:hover { color: #fff; background: var(--moss-deep); }
#map, .no-map {
  min-height: 240px;
  height: 100%;
  width: 100%;
  border-radius: 14px;
  background: #e7efe8;
}
.no-map { display: grid; place-items: center; text-align: center; color: var(--muted); font-weight: 700; }
.content-ad { margin: 18px 0; }
.content-ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.form-failed {
  background: #f3e2c4;
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--bark);
}
.site-footer {
  background: var(--moss-deep);
  color: #f4efe6;
  padding: 28px 0;
}
.site-footer a { color: #f3e2c4; }
.site-footer p { margin: 6px 0; }

@media (min-width: 760px) {
  .nav-toggle-label { display: none; }
  .primary-nav { display: block; width: auto; }
  .primary-nav ul { display: flex; gap: 8px; margin: 0; }
  .primary-nav a { border: 0; border-radius: 999px; padding: 8px 14px; }
  .primary-nav a[aria-current="page"] { background: #f3e2c4; }
  .search-form, .hero-card form { flex-direction: row; align-items: center; }
  .search-form input, .hero-card input[type="text"] { flex: 1; }
  .browse-grid { grid-template-columns: 1fr 1fr; }
  .index-grid { grid-template-columns: repeat(4, 1fr); }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .company-layout { grid-template-columns: 1.15fr 0.85fr; align-items: stretch; }
  .search-layout #map { order: 0; height: 420px; }
  .search-results { order: 1; }
  .hero { min-height: 480px; }
}

@media (min-width: 1100px) {
  .card-grid.thirds { grid-template-columns: 1fr 1fr 1fr; }
}
