/* History pages. Three colours: navy, Carolina blue, white; everything else is a mix of them. Light reads as paper,
   dark as the navy of the map. The plaque keeps the cast-aluminium look of the real markers. */
:root {
    --navy: #13294B; --blue: #4B9CD3; --white: #FFFFFF;
    --bg: var(--white); --ink: var(--navy); --muted: color-mix(in srgb, var(--navy) 66%, var(--white));
    --line: color-mix(in srgb, var(--navy) 13%, var(--white)); --wash: color-mix(in srgb, var(--blue) 9%, var(--white));
    --card: var(--white); --link: color-mix(in srgb, var(--blue) 62%, var(--navy));
    --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
    --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
    --wrap: 74rem;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: color-mix(in srgb, var(--navy) 82%, #000); --ink: var(--white); --muted: color-mix(in srgb, var(--white) 66%, var(--navy));
        --line: color-mix(in srgb, var(--white) 13%, var(--navy)); --wash: color-mix(in srgb, var(--blue) 14%, var(--navy));
        --card: var(--navy); --link: var(--blue); }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin: 0 auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; line-height: 1.02; text-transform: uppercase; margin: 0; }

/* ---------- Bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--white); border-bottom: 1px solid color-mix(in srgb, var(--white) 12%, var(--navy)); }
.bar-in { display: flex; align-items: center; gap: 22px; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--white); text-decoration: none; font: 700 15px/1 var(--body); white-space: nowrap; }
.brand svg { width: 17px; height: 17px; fill: var(--blue); }
.nav { display: flex; gap: 18px; }
.nav a { color: color-mix(in srgb, var(--white) 78%, var(--navy)); text-decoration: none; font: 600 14px/1 var(--body); }
.nav a:hover { color: var(--white); }
.find { position: relative; flex: 1; max-width: 340px; margin-left: auto; }
.find input, .hero-find input { width: 100%; height: 38px; padding: 0 12px; color: var(--white); background: color-mix(in srgb, var(--white) 8%, var(--navy));
    border: 1px solid color-mix(in srgb, var(--white) 18%, var(--navy)); border-radius: 2px; font: 500 14px/1 var(--body); }
.find input::placeholder, .hero-find input::placeholder { color: color-mix(in srgb, var(--white) 55%, var(--navy)); }
.find input:focus, .hero-find input:focus { outline: none; border-color: var(--blue); }
.found { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 60vh; overflow-y: auto; background: var(--navy);
    border: 1px solid color-mix(in srgb, var(--white) 18%, var(--navy)); border-radius: 2px; box-shadow: 0 18px 40px #0007; }
.found a { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding: 9px 12px; color: var(--white); text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--white) 10%, var(--navy)); }
.found a:hover, .found a.on { background: color-mix(in srgb, var(--blue) 22%, var(--navy)); }
.found .id { color: var(--blue); font: 600 12px/1.6 var(--body); }
.found b { font: 600 15px/1.2 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.found small { display: block; color: color-mix(in srgb, var(--white) 62%, var(--navy)); font-size: 12px; }
.cta { flex: none; padding: 9px 13px; color: var(--navy); background: var(--blue); border-radius: 2px; text-decoration: none; font: 700 14px/1 var(--body); }
.cta:hover { color: var(--navy); background: color-mix(in srgb, var(--blue) 85%, var(--white)); }

/* ---------- Hero (front page) ---------- */
.hero { position: relative; margin: 0; background: var(--navy); color: var(--white); }
.hero img { width: 100%; height: min(68vh, 620px); object-fit: cover; object-position: 50% 45%; filter: grayscale(1) contrast(1.05); opacity: .62; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--navy) 92%, transparent) 88%); pointer-events: none; }
.hero-text { position: absolute; left: 0; right: 0; bottom: 64px; z-index: 2; }
.hero h1 { max-width: 15ch; font-size: clamp(44px, 7vw, 92px); line-height: .92; }
.hero p { max-width: 46rem; margin: 18px 0 0; font: 400 clamp(17px, 1.6vw, 20px)/1.55 var(--serif); color: color-mix(in srgb, var(--white) 88%, var(--navy)); }
.hero-find { position: relative; max-width: 30rem; margin-top: 22px; }
.hero-find input { height: 48px; font-size: 16px; background: color-mix(in srgb, var(--navy) 70%, transparent); }
.hero figcaption { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 2; font-size: 12px; color: color-mix(in srgb, var(--white) 62%, var(--navy)); }
.hero figcaption a { color: inherit; }

.tally { display: grid; grid-template-columns: repeat(5, 1fr); margin: 32px 0 8px; border: 1px solid var(--line); border-radius: 2px; }
.tally div { padding: 18px 16px; border-right: 1px solid var(--line); }
.tally div:last-child { border-right: 0; }
.tally b { display: block; font: 700 36px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.tally span { color: var(--muted); font-size: 14px; }

.block { margin: 64px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.block-head h2 { font-size: 40px; }
.block-head p { margin: 0; max-width: 34rem; color: var(--muted); text-align: right; }

.eras { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 2px; }
.era { display: grid; align-content: start; gap: 4px; min-height: 150px; padding: 16px 14px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line);
    background: linear-gradient(var(--blue), var(--blue)) top / 100% 4px no-repeat; }
.era:last-child { border-right: 0; }
.era:hover { background-color: var(--wash); }
.era b { font: 700 20px/1.05 var(--display); text-transform: uppercase; }
.era span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.era em { margin-top: auto; padding-top: 18px; font: 600 13px/1 var(--body); font-style: normal; color: var(--link); }

.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.theme { display: grid; align-content: start; gap: 6px; padding: 16px; color: var(--ink); text-decoration: none; background: var(--card);
    border: 1px solid var(--line); border-radius: 2px; }
.theme:hover { border-color: var(--blue); background: var(--wash); }
.theme b { font: 700 21px/1.05 var(--display); text-transform: uppercase; }
.theme span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.theme em { margin-top: 4px; font: 600 13px/1 var(--body); font-style: normal; color: var(--link); }

.drives { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.drives.wide { margin-top: 10px; }
.drive { display: grid; gap: 4px; padding: 14px; color: var(--white); background: var(--navy); border-radius: 2px; text-decoration: none; }
.drive:hover { color: var(--white); background: color-mix(in srgb, var(--navy) 82%, var(--blue)); }
.drive b { font: 700 20px/1 var(--display); text-transform: uppercase; }
.drive span { color: color-mix(in srgb, var(--white) 70%, var(--navy)); font-size: 13px; }
.drive.alt { color: var(--ink); background: var(--wash); }
.drive.alt span { color: var(--muted); }
.drive.alt:hover { color: var(--ink); background: color-mix(in srgb, var(--blue) 20%, var(--bg)); }

.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ph { position: relative; display: block; overflow: hidden; border-radius: 2px; aspect-ratio: 4 / 3; color: var(--white); text-decoration: none; background: var(--navy); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.ph:hover img { transform: scale(1.04); }
.ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px; font-size: 13px; background: linear-gradient(transparent, #000c); }
.ph b { display: block; font: 700 16px/1.05 var(--display); text-transform: uppercase; }

.counties { columns: 5 12rem; column-gap: 24px; }
.counties a { display: flex; justify-content: space-between; padding: 5px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); break-inside: avoid; }
.counties a:hover { color: var(--link); }
.counties small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Stop page ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 18px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.stop { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; margin-bottom: 72px; }
.plaque { position: relative; padding: 26px 30px 18px; color: #111; text-align: center; border-radius: 3px; border: 4px solid #15191c;
    background: linear-gradient(160deg, #f3f5f6, #cfd5d8 55%, #e4e8ea); box-shadow: 0 0 0 1px #9aa3a8, 0 18px 40px #0003; }
.plaque h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: .04em; }
.plaque p { max-width: 38rem; margin: 12px auto 0; font: 500 18px/1.5 var(--body); }
.plaque-foot { display: flex; justify-content: center; gap: 14px; margin-top: 16px; padding-top: 10px; border-top: 1px solid #0003; font: 600 13px/1 var(--body); color: #333; }
.plaque-foot b { color: #111; }
.tag { display: inline-block; margin-bottom: 10px; padding: 3px 8px; color: #fff; background: #b84d36; border-radius: 1px; font: 700 11px/1.3 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.tag.site { background: #8a6a24; }
.where { margin: 18px 0 0; color: var(--muted); }
.where b { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.chips a { padding: 5px 10px; color: var(--ink); background: var(--wash); border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--bg)); border-radius: 2px; text-decoration: none; font: 600 13px/1.2 var(--body); }
.chips a:hover { border-color: var(--blue); }
.quote { margin: 30px 0 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--blue); }
.quote blockquote { margin: 0; font: 400 clamp(19px, 2vw, 23px)/1.5 var(--serif); font-style: italic; }
.quote figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.quote .who { font-weight: 700; color: var(--ink); }
.quote small { flex-basis: 100%; font-size: 13px; }
.photo { margin: 30px 0 0; }
.photo img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 2px; background: var(--wash); }
.photo.portrait img { width: auto; max-height: 420px; }
.photo figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.near { margin-top: 44px; }
.near h2, .side-block h2, .folk h2, .group h2 { font-size: 22px; margin-bottom: 10px; }
.near ol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.near a { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: baseline; padding: 10px 12px; color: var(--ink); text-decoration: none;
    border: 1px solid var(--line); border-radius: 2px; }
.near a:hover { border-color: var(--blue); }
.near .id, .list .id { color: var(--link); font: 600 12px/1.4 var(--body); }
.near b { font: 600 16px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.near small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stop-side { position: sticky; top: 78px; display: grid; gap: 18px; }
.locator { position: relative; padding: 12px; background: var(--wash); border-radius: 2px; }
.locator img { width: 100%; }
.lmap { position: relative; }
.locator i { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--navy); border: 2px solid var(--white);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 45%, transparent); }
.locator.big { min-width: 320px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.acts { display: grid; gap: 8px; }
.acts a { padding: 11px 14px; color: var(--ink); text-align: center; border: 1px solid var(--line); border-radius: 2px; text-decoration: none; font: 700 14px/1 var(--body); }
.acts a:hover { border-color: var(--blue); }
.acts a.primary { color: var(--white); background: var(--navy); border-color: var(--navy); }
.acts a.primary:hover { background: color-mix(in srgb, var(--navy) 80%, var(--blue)); }
.trips, .people { display: flex; flex-wrap: wrap; gap: 6px; }
.trips a { padding: 5px 9px; font-size: 13px; color: var(--ink); background: var(--wash); border-radius: 2px; text-decoration: none; }
.person { display: inline-flex; flex-direction: column; padding: 7px 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 2px; text-decoration: none; font-weight: 600; font-size: 14px; }
.person small { color: var(--muted); font-weight: 400; font-size: 12px; }
.person:hover { border-color: var(--blue); }

/* ---------- Lists (county, era, theme) ---------- */
.lede { display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; margin: 4px 0 30px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.lede h1 { font-size: clamp(40px, 6vw, 72px); }
.lede p { max-width: 44rem; margin: 12px 0 0; font: 400 18px/1.55 var(--serif); color: var(--muted); }
.btn { display: inline-block; padding: 10px 14px; color: var(--white); background: var(--navy); border-radius: 2px; text-decoration: none; font: 700 14px/1 var(--body); }
.btn:hover { color: var(--white); background: color-mix(in srgb, var(--navy) 80%, var(--blue)); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 36px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; filter: grayscale(1); }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.folk { margin-bottom: 36px; }
.group { margin: 0 0 34px; }
.group h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px; margin: 0; padding: 0; list-style: none; }
.list a { display: grid; grid-template-columns: 56px 1fr; gap: 2px 8px; padding: 10px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.list a:hover b { color: var(--link); }
.list b { font: 600 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.list small { grid-column: 2; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.prose { max-width: 44rem; margin: 0 0 80px; }
.prose h1 { font-size: 56px; margin-bottom: 18px; }
.prose h2 { font-size: 26px; margin: 30px 0 8px; }
.prose p, .prose li { font: 400 18px/1.6 var(--serif); }

.foot { margin-top: 40px; padding: 30px 0 40px; color: color-mix(in srgb, var(--white) 72%, var(--navy)); background: var(--navy); font-size: 14px; }
.foot a { color: var(--blue); }
.foot b { color: var(--white); }
.foot p { max-width: 52rem; margin: 0 0 10px; }

@media (max-width: 980px) {
    .nav { display: none; }
    .stop { grid-template-columns: 1fr; }
    .stop-side { position: static; }
    .eras { grid-template-columns: repeat(2, 1fr); }
    .era { border-bottom: 1px solid var(--line); min-height: 0; }
    .themes, .photos { grid-template-columns: repeat(2, 1fr); }
    .tally { grid-template-columns: repeat(2, 1fr); }
    .tally div { border-bottom: 1px solid var(--line); }
    .block-head { display: block; }
    .block-head p { text-align: left; margin-top: 6px; }
    .lede { flex-direction: column; }
    .locator.big { min-width: 0; width: 100%; }
    .gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .bar-in { gap: 12px; }
    .brand { font-size: 0; gap: 0; }
    .find { max-width: none; }
    .cta { padding: 9px 10px; font-size: 13px; }
    .hero img { height: 76vh; }
    .hero-text { bottom: 54px; }
    .themes, .photos, .near ol, .list { grid-template-columns: 1fr; }
    .plaque { padding: 20px 16px 14px; }
    .plaque p { font-size: 16px; }
    .gallery { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .ph img { transition: none; } }
