/* DS3 Community Hub: design system
   Typefaces: Atkinson Hyperlegible (Braille Institute, SIL OFL) for body text,
   Source Serif 4 (Adobe, SIL OFL) for headings. Both self-hosted, no third-party requests. */

@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/fonts/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url('/fonts/source-serif-4-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url('/fonts/source-serif-4-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* Palette drawn from the border landscape: hedgerow, lough water, stone walls, heather, gorse. */
  --ink: #1c2420;
  --ink-soft: #4a554f;
  --paper: #faf8f3;
  --surface: #ffffff;
  --stone: #f0ece3;
  --stone-dark: #e2dccf;
  --line: #d4cdbf;
  --line-strong: #8f887a;
  --green-900: #12352a;
  --green-700: #1d5a40;
  --green-600: #24704f;
  --green-100: #e2efe6;
  --lough-700: #2a4a64;
  --lough-100: #e1eaf2;
  --heather-700: #6b3c5d;
  --heather-100: #f3e8f0;
  --gorse: #f2c14a;
  --gorse-100: #fdf3d6;
  --red-700: #a12a1e;
  --red-100: #fbe8e5;

  --font-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-head: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --radius: 10px;
  --radius-sm: 6px;
  --gap: 1.5rem;
  --measure: 68ch;
  --container: 74rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; color: var(--green-900); text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.95rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.125rem; font-family: var(--font-body); }
p, ul, ol, dl { margin: 0 0 1em; }
p, li { max-width: var(--measure); }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.35em; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
small, .small { font-size: 1rem; }

a { color: var(--green-700); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--green-900); text-decoration-thickness: 2px; }
/* Visited links keep their component colour (never inherit, which can produce dark-on-dark text) */
.nav a:visited { color: #fff; }
.btn:visited { color: #fff; }
.btn-secondary:visited { color: var(--green-900); }
.btn-quiet:visited { color: var(--green-700); }
.footer a:visited { color: #fff; }
.site-title:visited { color: var(--green-900); }
.icon-link:visited, .tile:visited { color: var(--ink); }
.tabs a:visited { color: var(--ink-soft); }
.tabs a[aria-current="page"]:visited { color: var(--green-900); }
.card h3 a:visited { color: var(--green-900); }
a.badge:visited { color: var(--ink); }
a.badge-green:visited { color: var(--green-900); }

/* Focus: a two-tone ring that stays visible on light and dark backgrounds. */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--gorse);
  border-radius: 2px;
}
a:focus-visible { background: var(--gorse); color: var(--ink); text-decoration: none; box-shadow: 0 -2px var(--gorse), 0 4px var(--ink); outline: none; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; padding: 0 !important; margin: -1px !important; border: 0 !important; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--gorse); color: var(--ink); padding: 0.75rem 1rem; font-weight: 700; }
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 48rem) { .container { padding: 0 2rem; } }
.narrow { max-width: 46rem; }
.stack > * + * { margin-top: var(--gap); }
.muted { color: var(--ink-soft); }
.lead { font-size: 1.3rem; line-height: 1.5; color: var(--ink); max-width: 40ch; }

/* ---------- Prototype banner ---------- */
.proto-banner { background: var(--gorse-100); border-bottom: 2px solid var(--gorse); font-size: 1rem; }
.proto-banner .container { display: flex; gap: 0.75rem; align-items: baseline; padding-top: 0.6rem; padding-bottom: 0.6rem; flex-wrap: wrap; }
.tag-proto { display: inline-block; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1rem 0.5rem; border-radius: 3px; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.9rem; padding-bottom: 0.9rem; flex-wrap: wrap; }
.site-title { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--green-900); }
.site-title:hover { color: var(--green-900); }
.site-title .mark { width: 44px; height: 44px; flex: none; }
.site-title .name { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; line-height: 1.1; display: block; }
.site-title .sub { display: block; font-size: 0.95rem; color: var(--ink-soft); }
.header-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.header-tools a { font-size: 1rem; }
.icon-link { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); color: var(--ink); min-height: 44px; }
.icon-link:hover { background: var(--stone); color: var(--ink); }
.icon-link svg { width: 20px; height: 20px; }
.count { display: inline-block; min-width: 1.5em; padding: 0 0.4em; border-radius: 999px; background: var(--green-700); color: #fff; font-size: 0.85rem; text-align: center; font-weight: 700; line-height: 1.5; }
.menu-toggle { display: none; }
.js .menu-toggle { display: inline-flex; }
@media (min-width: 60rem) { .js .menu-toggle { display: none; } }

.nav { background: var(--green-900); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav li { margin: 0; }
.nav a { display: block; color: #fff; text-decoration: none; padding: 0.85rem 1rem; font-weight: 700; border-bottom: 4px solid transparent; min-height: 48px; }
.nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav a[aria-current="page"] { border-bottom-color: var(--gorse); }
.nav a:focus-visible { background: var(--gorse); color: var(--ink); box-shadow: none; }
@media (max-width: 59.99rem) {
  .js .nav[data-open="false"] { display: none; }
  .nav ul { flex-direction: column; padding: 0.25rem 0; }
  .nav a { border-bottom: 0; border-left: 4px solid transparent; }
  .nav a[aria-current="page"] { border-left-color: var(--gorse); }
}

/* ---------- Buttons and forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  background: var(--green-700); color: #fff; border: 2px solid var(--green-700);
  box-shadow: 0 2px 0 var(--green-900);
}
.btn:hover { background: var(--green-900); border-color: var(--green-900); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-secondary { background: var(--surface); color: var(--green-900); border-color: var(--green-700); box-shadow: none; }
.btn-secondary:hover { background: var(--green-100); color: var(--green-900); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--green-700); box-shadow: none; text-decoration: underline; padding-left: 0.5rem; padding-right: 0.5rem; }
.btn-quiet:hover { background: var(--stone); color: var(--green-900); border-color: transparent; }
.btn-danger { background: var(--red-700); border-color: var(--red-700); box-shadow: 0 2px 0 #6e1a12; }
.btn-danger:hover { background: #7f1f15; border-color: #7f1f15; }
.btn-small { min-height: 40px; padding: 0.35rem 0.8rem; font-size: 1rem; }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
button[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.field { margin-bottom: 1.5rem; max-width: 40rem; }
.field label, .field legend, .label { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.hint { display: block; color: var(--ink-soft); font-size: 1rem; margin-bottom: 0.4rem; }
.optional { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=month], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; min-height: 48px;
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
.input-narrow { max-width: 14rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.checks { display: grid; gap: 0.5rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { width: 24px; height: 24px; margin: 0.15rem 0 0; flex: none; accent-color: var(--green-700); }
.check label { font-weight: 400; margin: 0; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--red-700); border-width: 3px; }
.field-error { border-left: 4px solid var(--red-700); padding-left: 1rem; }
.error-text { display: block; color: var(--red-700); font-weight: 700; margin-bottom: 0.35rem; }
.error-summary { border: 4px solid var(--red-700); padding: 1rem 1.25rem; margin-bottom: 2rem; background: var(--surface); border-radius: var(--radius-sm); }
.error-summary h2 { color: var(--red-700); font-size: 1.3rem; }
.error-summary ul { margin: 0; }
.error-summary a { color: var(--red-700); font-weight: 700; }

/* ---------- Notices ---------- */
.notice { border-left: 6px solid var(--lough-700); background: var(--lough-100); padding: 1rem 1.25rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 1.5rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-success { border-color: var(--green-700); background: var(--green-100); }
.notice-error { border-color: var(--red-700); background: var(--red-100); }
.notice-warning { border-color: #a07000; background: var(--gorse-100); }
.callout { border-left: 6px solid var(--heather-700); background: var(--heather-100); padding: 1rem 1.25rem; margin: 1.5rem 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.callout p:last-child { margin: 0; }
.sample-flag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; font-weight: 700; color: #6b4a00; background: var(--gorse-100); border: 1px solid #d9a92c; border-radius: 999px; padding: 0.05rem 0.6rem; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 0.9rem; font-weight: 700; padding: 0.1rem 0.55rem; border-radius: 4px; background: var(--stone); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; max-width: 100%; }
.card .badge { white-space: normal; }
.badge-green { background: var(--green-100); border-color: #b6d4c0; color: var(--green-900); }
.badge-blue { background: var(--lough-100); border-color: #b9cada; color: var(--lough-700); }
.badge-heather { background: var(--heather-100); border-color: #dcc4d5; color: var(--heather-700); }
.badge-red { background: var(--red-100); border-color: #e9b8b1; color: var(--red-700); }
.badge-amber { background: var(--gorse-100); border-color: #e6c46a; color: #5e4100; }
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }

/* ---------- Page sections ---------- */
main { display: block; }
.page { padding-top: 2.5rem; padding-bottom: 4rem; }
.page-head { padding: 2.5rem 0 1.5rem; background: var(--stone); border-bottom: 1px solid var(--line); }
.page-head p { margin-bottom: 0; }
.breadcrumbs { font-size: 1rem; margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: '›'; margin: 0 0.4rem 0 0.15rem; color: var(--ink-soft); }
.section { padding: 3rem 0; }
.section-stone { background: var(--stone); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; }

/* Hero */
.hero { background: var(--stone); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-grid { display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 3rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1.15fr 0.85fr; padding-top: 4rem; padding-bottom: 4rem; } }
.hero h1 { margin-bottom: 0.4em; }
.hero-art { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #dfe8e1; }
.finder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-top: 1.75rem; box-shadow: 0 1px 0 var(--line); }
.finder-grid { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .finder-grid { grid-template-columns: 1fr 1fr auto; align-items: end; } }
.finder .field { margin: 0; }

/* Entry tiles */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); border-top: 6px solid var(--green-700); }
.tile:nth-child(2) { border-top-color: var(--lough-700); }
.tile:nth-child(3) { border-top-color: var(--heather-700); }
.tile:hover { border-color: var(--line-strong); color: var(--ink); }
.tile:hover h3 { text-decoration: underline; }
.tile h3 { margin: 0; color: var(--green-900); }
.tile p { margin: 0; color: var(--ink-soft); }
.tile svg { width: 40px; height: 40px; color: var(--green-700); }

/* Cards and lists */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; display: flex; flex-direction: column; gap: 0.35rem; }
.card h3 { font-size: 1.25rem; margin: 0 0 0.15rem; }
.card h3 a { text-decoration: none; color: var(--green-900); }
.card h3 a:hover { text-decoration: underline; }
.card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); } /* whole card clickable */
.card h3 a:focus-visible { background: none; box-shadow: none; text-decoration: underline; }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--gorse); }
.card p { margin: 0; color: var(--ink-soft); }
.card .meta { font-size: 1rem; color: var(--ink-soft); }
.card-foot { margin-top: auto; padding-top: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; position: relative; z-index: 1; }
.card .save-form, .card .card-foot a, .card .card-foot button { position: relative; z-index: 2; }

.date-block { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4rem; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); background: var(--lough-100); color: var(--lough-700); font-weight: 700; line-height: 1.1; border: 1px solid #b9cada; }
.date-block .d { font-family: var(--font-head); font-size: 1.6rem; }
.date-block .m { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.event-card { flex-direction: row; gap: 1rem; align-items: flex-start; }
.event-card .body { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 0; }

.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.result-list > li { margin: 0; max-width: none; }

/* Layout with sidebar filters */
.with-sidebar { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .with-sidebar { grid-template-columns: 17rem 1fr; align-items: start; } }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.filters h2 { font-size: 1.3rem; }
.filters .field { margin-bottom: 1.1rem; }
.filters fieldset { margin-bottom: 1.1rem; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.results-bar p { margin: 0; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--line); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a { padding: 0.6rem 1rem; text-decoration: none; font-weight: 700; color: var(--ink-soft); border-bottom: 4px solid transparent; margin-bottom: -2px; }
.tabs a[aria-current="page"] { color: var(--green-900); border-bottom-color: var(--green-700); }
.tabs a:hover { color: var(--green-900); }

.pagination { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 2rem; }
.pagination a, .pagination span { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; background: var(--surface); }
.pagination [aria-current="page"] { background: var(--green-700); color: #fff; border-color: var(--green-700); font-weight: 700; }

/* Detail pages */
.detail { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .detail { grid-template-columns: 1fr 21rem; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; }
.panel + .panel { margin-top: 1.25rem; }
.panel h2 { font-size: 1.25rem; font-family: var(--font-body); }
.facts { margin: 0; }
.facts dt { font-weight: 700; margin-top: 0.85rem; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0.1rem 0 0; overflow-wrap: anywhere; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.toc { border-left: 4px solid var(--line); padding-left: 1rem; margin-bottom: 2rem; }
.toc ol { margin: 0; }

.community-hero { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 52rem) { .community-hero { grid-template-columns: 1fr 22rem; } }
.community-hero .art { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

/* Calendar */
.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--surface); }
.calendar caption { text-align: left; font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--green-900); padding-bottom: 0.75rem; }
.calendar th { font-size: 1rem; padding: 0.5rem; background: var(--stone); border: 1px solid var(--line); }
.calendar td { vertical-align: top; border: 1px solid var(--line); height: 6.5rem; padding: 0.35rem; font-size: 0.95rem; }
.calendar td.out { background: #f6f4ee; color: var(--ink-soft); }
.calendar td.today { box-shadow: inset 0 0 0 3px var(--gorse); }
.calendar .day { font-weight: 700; display: block; }
.calendar ul { list-style: none; padding: 0; margin: 0.2rem 0 0; }
.calendar li { margin: 0 0 0.2rem; line-height: 1.25; }
.calendar li a { display: block; padding: 0.15rem 0.3rem; border-radius: 4px; background: var(--lough-100); text-decoration: none; color: var(--lough-700); overflow-wrap: anywhere; }
.calendar li.cancelled a { background: var(--red-100); color: var(--red-700); text-decoration: line-through; }
@media (max-width: 47.99rem) { .calendar-wrap { display: none; } }
@media (min-width: 48rem) { .calendar-mobile-note { display: none; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.data th, table.data td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--stone); font-weight: 700; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td .btn-row { gap: 0.4rem; }

/* Admin */
.admin-layout { display: grid; gap: 2rem; }
@media (min-width: 62rem) { .admin-layout { grid-template-columns: 15rem 1fr; } }
.admin-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; align-self: start; }
.admin-nav ul { list-style: none; padding: 0; margin: 0; }
.admin-nav li { margin: 0; }
.admin-nav a { display: flex; justify-content: space-between; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.admin-nav a:hover { background: var(--stone); }
.admin-nav a[aria-current="page"] { background: var(--green-100); color: var(--green-900); font-weight: 700; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin-bottom: 2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.stat .n { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--green-900); display: block; line-height: 1.1; }
.stat .l { color: var(--ink-soft); font-size: 1rem; }
.stat a { text-decoration: none; }
.diff { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.diff-row { display: grid; grid-template-columns: 11rem 1fr; border-bottom: 1px solid var(--line); }
.diff-row:last-child { border-bottom: 0; }
.diff-row > * { padding: 0.65rem 0.85rem; }
.diff-row dt { font-weight: 700; background: var(--stone); }
.diff-row dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-row.changed dd { background: var(--gorse-100); }
.diff-row .was { display: block; color: var(--ink-soft); text-decoration: line-through; font-size: 1rem; }
@media (max-width: 40rem) { .diff-row { grid-template-columns: 1fr; } }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); }
.timeline li { padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -9px; top: 0.45rem; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--green-700); }

/* Preview frame */
.preview-frame { border: 3px dashed var(--lough-700); border-radius: var(--radius); padding: 1.5rem; background: var(--surface); position: relative; }
.preview-label { position: absolute; top: -0.85rem; left: 1rem; background: var(--lough-700); color: #fff; font-weight: 700; padding: 0 0.6rem; border-radius: 4px; font-size: 0.95rem; }

/* Saved toggle */
.save-btn[aria-pressed="true"] { background: var(--green-100); }
.save-btn svg { fill: none; }
.save-btn[aria-pressed="true"] svg { fill: currentColor; }

/* Footer */
.footer { background: var(--green-900); color: #e8efe9; margin-top: 0; padding: 3rem 0 2rem; font-size: 1rem; }
.footer a { color: #fff; }
.footer a:hover { color: var(--gorse); }
.footer h2 { color: #fff; font-size: 1.15rem; font-family: var(--font-body); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 2rem; }
.footer ul { list-style: none; padding: 0; }
.footer-note { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 1.5rem; color: #cfdcd3; max-width: 60rem; }
.footer-note p { max-width: none; }

.empty { text-align: left; padding: 2rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty h3 { margin-bottom: 0.4rem; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 0; }
.steps li::before { content: counter(step); display: inline-flex; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--green-700); color: #fff; font-weight: 700; align-items: center; justify-content: center; margin-bottom: 0.6rem; }
.steps h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.steps p { margin: 0; color: var(--ink-soft); }

.split { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }

details.disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 0.75rem; }
details.disclosure summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 700; color: var(--green-900); list-style-position: inside; }
details.disclosure[open] summary { border-bottom: 1px solid var(--line); }
details.disclosure > div { padding: 1rem 1.25rem; }

#map { height: 28rem; border-radius: var(--radius); border: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

@media print {
  .proto-banner, .site-header, .nav, .footer, .no-print, .filters, .btn, .breadcrumbs { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .page-head { background: none; border: 0; padding: 0; }
  a { color: #000; }
  .prose a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: 10pt; }
  .detail { display: block; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* Grid children may shrink below their content width so wide tables scroll inside .table-wrap */
.admin-layout > *, .with-sidebar > *, .detail > *, .split > *, .hero-grid > * { min-width: 0; }

/* Inline icons inside text */
.meta svg, p > svg, .facts svg { display: inline-block; vertical-align: -0.2em; width: 1.1em; height: 1.1em; margin-right: 0.15em; }
@media (min-width: 40rem) { .finder-grid { grid-template-columns: 1.6fr 1fr auto; } }
.split .steps { grid-template-columns: 1fr; }
.split .steps li { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: start; }
.split .steps li::before { grid-row: span 2; margin: 0; }
@media (max-width: 39.99rem) {
  .header-tools { width: 100%; justify-content: flex-start; gap: 0 0.25rem; flex-wrap: wrap; }
  .header-tools .menu-toggle { margin-left: auto; }
  .icon-link { padding: 0.5rem 0.35rem; gap: 0.3rem; }
  .menu-toggle { padding-left: 0.6rem; padding-right: 0.6rem; }
  .proto-banner { font-size: 0.95rem; }
}
.icon-link { white-space: nowrap; }
details.filter-collapse { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.filter-collapse > summary { cursor: pointer; padding: 0.9rem 1.25rem; font-weight: 700; color: var(--green-900); min-height: 48px; }
details.filter-collapse[open] > summary { border-bottom: 1px solid var(--line); }
details.filter-collapse .filters { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
details.filter-collapse .filters h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
details.filter-collapse > summary h2 { display: inline; font-family: var(--font-body); font-size: 1.15rem; margin: 0; }

/* ---------- Community photos ---------- */
.community-hero .art .photo { margin: 0; }
.community-hero .art .photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.community-hero .art .photo figcaption { font-size: 0.8rem; line-height: 1.4; color: var(--ink-soft); background: var(--surface); padding: 0.4rem 0.6rem; }
.card-photo { margin: -1.25rem -1.35rem 0.75rem; border-radius: 10px 10px 0 0; overflow: hidden; height: 110px; }
.card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- DS3 brand ---------- */
/* The DS3 brandmark is never shown narrower than 200px on screen (DS3 brand guidelines);
   the header logo row below sizes it to stay above that at every width. */
.site-title .brand-text { border-left: 2px solid var(--line); padding-left: 0.9rem; }
@media (max-width: 40rem) { .site-title .brand-text { display: none; } }
.hero-photo { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-photo figcaption { font-size: 0.9rem; color: var(--ink-soft); padding: 0.55rem 0.8rem; }
/* PEACEPLUS logo: full colour, on white, at least as large as the DS3 brandmark (SEUPB rules). */
.funding { background: #fff; border-top: 1px solid var(--line); }
.funding-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.5rem; padding-top: 1.75rem; padding-bottom: 1.75rem; }
.funding-inner img { width: 300px; max-width: 100%; height: auto; }
.funding-inner p { margin: 0; max-width: 34rem; color: var(--ink); }
/* Header logo: one combined PEACEPLUS + DS3 image (images/brand/peaceplus-ds3-lockup.png, 1466x408),
   on white, with the PEACEPLUS artwork unaltered. Sized by height on wide screens, by width on
   phones; width/height stay proportional so the aspect ratio holds. The acknowledgement sits beneath. */
.header-funding { background: #fff; border-bottom: 1px solid #edf0eb; }
.header-funding-inner { padding-top: 0.75rem; padding-bottom: 0.65rem; }
.header-lockup { display: block; width: auto; height: 8rem; max-width: 100%; }
.header-funding-note { margin: 0.55rem 0 0; max-width: none; font-size: 0.875rem; line-height: 1.45; color: var(--ink-soft); }
@media (max-width: 32.99rem) {
  .header-lockup { width: 100%; max-width: 28.75rem; height: auto; margin: 0 auto; }
  .header-funding-note { text-align: center; }
}
.header-inner .site-title .brand-text { display: block; border: 0; padding-left: 0; }

/* ---------- Impact page ---------- */
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.impact-stat { display: flex; flex-direction: column; gap: 0.25rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--surface); }
.impact-value { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 700; line-height: 1.1; color: var(--green-900); font-variant-numeric: tabular-nums; }
.impact-label { font-weight: 600; }
.impact-hint { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Mobile Lab availability calendar ---------- */
.labcal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.5rem; }
.labcal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.labcal caption { font-weight: 700; font-size: 1.15rem; text-align: left; padding-bottom: 0.5rem; }
.labcal th { font-size: 0.85rem; font-weight: 600; padding: 0.25rem 0; text-align: center; }
.labcal td { border: 1px solid var(--line); height: 3.25rem; vertical-align: top; padding: 0.2rem 0.25rem; }
.labcal-day { display: block; font-weight: 600; font-size: 0.95rem; }
.labcal-status { display: block; font-size: 0.75rem; line-height: 1.15; }
.labcal-free { background: var(--green-100); }
.labcal-part { background: var(--gorse-100); }
.labcal-full { background: var(--red-100); }
.labcal-past { background: transparent; color: var(--ink-soft); }
.labcal-empty { border: none !important; }
.labcal-legend { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; list-style: none; padding: 0; margin: 0; }
.labcal-legend li { display: flex; align-items: center; gap: 0.5rem; }
.labcal-key { display: inline-block; width: 1.25rem; height: 1.25rem; border: 1px solid var(--line); border-radius: 0.25rem; }
.labcal-nav { display: flex; justify-content: space-between; }
.setup-key { display: inline-block; margin-top: 0.4rem; padding: 0.4rem 0.6rem; font-size: 1.1rem; letter-spacing: 0.05em; background: var(--stone); border-radius: 0.4rem; word-break: break-all; }
