/* Shared styles for Historyways pages other than the homepage (which carries
   its own copy inline). Colours: one per site, the same ones used everywhere. */
:root {
  --paper: #F2F4F1; --white: #FFFFFF; --ink: #14202B; --body: #33424E; --muted: #46545F; --rule: #C9D1CC;
  --rail: #B4432E; --canal: #1F6F8B; --pier: #C98A12; --telford: #3D4A8F;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; }
a { color: var(--ink); }
a:hover { color: var(--rail); }
a:focus-visible { outline: 3px solid var(--canal); outline-offset: 3px; }
h1, h2, h3 { font-family: Archivo, system-ui, sans-serif; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mono a { color: inherit; }

header { border-bottom: 1px solid var(--rule); }
header .wrap { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand span { font-family: Archivo, system-ui, sans-serif; font-weight: 800; font-size: 24px; letter-spacing: -0.01em; }
header nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 500; }
header nav a { text-decoration: none; padding: 10px 0; }
header nav a[aria-current] { box-shadow: 0 2px 0 var(--ink); }

.hero { padding-top: 56px; padding-bottom: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero > div { flex: 1 1 420px; min-width: 0; }
.hero-text { display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-weight: 800; font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -0.02em; }
.hero h1 small { display: block; margin-top: 10px; font-family: Inter, system-ui, sans-serif; font-weight: 500; font-size: 20px; letter-spacing: 0; color: var(--muted); }
.lede { font-size: 19px; color: var(--body); max-width: 34em; }

.tally { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.tally li { flex: 1 1 120px; min-width: 0; padding: 12px 14px; background: var(--white); border-top: 5px solid var(--ink); border-radius: 4px; }
.tally a { display: flex; flex-direction: column; text-decoration: none; }
.tally b { font-family: Archivo, system-ui, sans-serif; font-weight: 800; font-size: 26px; line-height: 1.1; }
.tally span { font-size: 14px; color: var(--body); }
.tally .rail, .layer.rail { border-top-color: var(--rail); }
.tally .canal, .layer.canal { border-top-color: var(--canal); }
.tally .pier, .layer.pier { border-top-color: var(--pier); }
.tally .telford, .layer.telford { border-top-color: var(--telford); }

.map { background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.map svg { display: block; width: 100%; height: auto; }
.map svg a:focus-visible { outline: none; }
.map svg a:focus-visible > * { stroke: var(--ink); stroke-width: 3.5; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; font-weight: 500; }
.legend li { display: flex; align-items: center; gap: 8px; }
.key-rail { width: 18px; height: 0; border-top: 3px dashed var(--rail); }
.key-canal { width: 18px; height: 4px; background: var(--canal); }
.key-lostcanal { width: 18px; height: 0; border-top: 3px dotted var(--canal); }
.key-pier { width: 12px; height: 12px; border-radius: 50%; background: var(--pier); }
.key-telford { width: 11px; height: 11px; transform: rotate(45deg); background: var(--telford); }
.map-note { margin-top: 8px; font-size: 13px; color: var(--muted); }

.band { background: var(--white); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band .section { padding-bottom: 40px; }
.section { padding-top: 64px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; flex-direction: column; gap: 10px; }
.section-head h2 { font-weight: 800; font-size: clamp(1.75rem, 3.5vw, 2.25rem); letter-spacing: -0.01em; }
.section-head p { font-size: 18px; color: var(--body); max-width: 40em; }

/* Columns, not a grid, so a short box tucks under its neighbour instead of leaving a gap. */
.layers { columns: 2 440px; column-gap: 24px; }
.layer { break-inside: avoid; margin-bottom: 24px; background: var(--paper); border-top: 6px solid var(--ink); border-radius: 4px; display: flex; flex-direction: column; }
.layer-head { padding: 22px 24px 18px; display: flex; flex-direction: column; gap: 10px; }
.layer-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.layer h2 { font-weight: 800; font-size: 26px; letter-spacing: -0.01em; }
.chip { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--ink); border-radius: 3px; white-space: nowrap; }
.layer-head p { color: var(--body); }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li { padding: 12px 24px; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 20px; }
.rows a, .rows .name { font-weight: 600; font-size: 17px; }
.rows a { padding: 4px 0; }
.rows .meta { color: var(--body); font-size: 15px; }
.rows .more { color: var(--body); font-size: 15px; }
.layer-foot { padding: 14px 24px 20px; }
.layer-foot a { font-weight: 600; display: inline-block; padding: 8px 0; }

.near { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.near li { min-width: 0; }
.near a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 18px; background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px; text-decoration: none; }
.near b { font-family: Archivo, system-ui, sans-serif; font-weight: 700; font-size: 19px; }
.near .out { font-size: 13px; color: var(--muted); }
.dots { display: flex; align-items: center; gap: 7px; min-height: 12px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; }
.dots .rail { background: var(--rail); } .dots .canal { background: var(--canal); }
.dots .pier { background: var(--pier); } .dots .telford { background: var(--telford); border-radius: 0; transform: rotate(45deg) scale(.85); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nation { font-weight: 800; font-size: 24px; margin-top: 12px; }
.credit { font-size: 14px; color: var(--muted); max-width: 60em; }

footer { background: var(--ink); color: var(--paper); }
footer .wrap { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; }
footer .brand span { font-size: 20px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-weight: 500; }
footer a { color: var(--paper); padding: 10px 0; }
footer a:hover { color: var(--white); }
footer .made { color: #B9C4CC; font-size: 14px; }

@media (max-width: 560px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .hero { padding-top: 36px; padding-bottom: 48px; gap: 32px; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .layer-head, .rows li, .layer-foot { padding-left: 18px; padding-right: 18px; }
  .tally li { flex-basis: 40%; }
}
