/* Graham & Sons Plumbing - drawing-set design language
   Paper stock, bottle-green ink bars, oxidised-copper (patina) accents.
   Brass is reserved for warnings and the single "you are here" highlight. */

:root {
  --paper: #eef1eb;
  --paper-2: #e0e7df;
  --paper-3: #f8faf6;
  --ink: #12201e;
  --ink-2: #34443f;
  --bottle: #0d2b29;
  --bottle-2: #15423d;
  --patina: #1b6657;
  --patina-d: #124a3f;
  --brass: #e0b13a;
  --brass-tint: #fbf0cc;
  --brass-ink: #6b4d00;
  --hot: #a92e26;
  --cold: #255f7d;
  --line: #b5c2ba;
  --f-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 72rem;
  --pad: 1.35rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.125rem;
  line-height: 1.68;
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;
}

img, svg { max-width: 100%; }

a { color: var(--patina-d); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--bottle); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--brass-ink); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 100;
  background: var(--brass); color: var(--ink);
  font-family: var(--f-head); font-weight: 700;
  padding: 0.6rem 1rem; border-radius: 0 0 4px 4px;
}
.skip:focus { top: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem; }

/* ---------- Utility strip ---------- */
.strip { background: var(--bottle); color: #d7e4de; font-family: var(--f-head); font-size: 0.8125rem; line-height: 1.4; border-bottom: 1px solid #25524c; }
.strip .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; justify-content: space-between; padding-block: 0.5rem; }
.strip p { margin: 0; }
.strip strong { color: var(--brass); font-weight: 700; }
.strip ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.1rem; }
.strip a { color: #d7e4de; text-decoration: none; border-bottom: 1px solid transparent; }
.strip a:hover, .strip a[aria-current="page"] { color: #fff; border-bottom-color: var(--brass); }
.strip :focus-visible { outline-color: var(--brass); }

/* ---------- Header ---------- */
.site-header { background: var(--bottle-2); color: #fff; position: relative; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: #fff; text-decoration: none; font-family: var(--f-head); }
.brand:hover { color: #fff; }
.brand svg { width: 2.6rem; height: 2.6rem; flex: none; }
.brand-name { display: block; font-weight: 800; font-stretch: 112%; font-size: 1.1rem; line-height: 1.05; letter-spacing: 0.005em; }
.brand-sub { display: block; font-weight: 500; font-size: 0.75rem; color: #a9c7bd; margin-top: 0.2rem; letter-spacing: 0.02em; }

.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-btn {
  font-family: var(--f-head); font-weight: 700; font-size: 0.95rem;
  border: 2px solid #5f8a7f; border-radius: 3px; padding: 0.45rem 0.9rem; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; gap: 0.55rem; user-select: none;
}
.nav-btn::before { content: ""; width: 1.1rem; height: 0.8rem; background:
  linear-gradient(#fff,#fff) 0 0/100% 2px no-repeat,
  linear-gradient(#fff,#fff) 0 50%/100% 2px no-repeat,
  linear-gradient(#fff,#fff) 0 100%/100% 2px no-repeat; }
.nav-toggle:focus-visible + .nav-btn { outline: 3px solid var(--brass); outline-offset: 3px; }
.nav-toggle:checked + .nav-btn { background: #fff; color: var(--bottle); }
.nav-toggle:checked + .nav-btn::before { background:
  linear-gradient(var(--bottle),var(--bottle)) 0 50%/100% 2px no-repeat; }

.main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: var(--bottle); border-top: 3px solid var(--brass); padding: 0.5rem 1rem 1rem; }
.nav-toggle:checked ~ .main-nav { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav li + li { border-top: 1px solid #25524c; }
.main-nav a { display: block; padding: 0.8rem 0.25rem; color: #e8f1ed; text-decoration: none; font-family: var(--f-head); font-weight: 600; font-size: 1.02rem; }
.main-nav a:hover { color: #fff; background: #123b36; }
.main-nav a[aria-current="page"] { color: var(--brass); }
.main-nav a.is-section { color: #fff; box-shadow: inset 4px 0 0 var(--brass); padding-left: 0.8rem; }
.main-nav :focus-visible { outline-color: var(--brass); }

@media (min-width: 62rem) {
  .nav-btn { display: none; }
  .main-nav { display: block; position: static; background: none; border: 0; padding: 0; }
  .main-nav ul { display: flex; gap: 0.15rem; }
  .main-nav li + li { border: 0; }
  .main-nav a { padding: 0.55rem 0.7rem; font-size: 0.95rem; border-bottom: 3px solid transparent; }
  .main-nav a:hover { background: none; border-bottom-color: #6fa597; }
  .main-nav a[aria-current="page"] { border-bottom-color: var(--brass); color: #fff; }
  .main-nav a.is-section { box-shadow: none; padding-left: 0.7rem; border-bottom-color: #6fa597; }
}

/* ---------- Page head ---------- */
.crumbs { font-family: var(--f-head); font-size: 0.85rem; padding-top: 1.1rem; color: var(--ink-2); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: #6c7d77; }
.crumbs a { color: var(--ink-2); }
.crumbs [aria-current="page"] { font-weight: 600; color: var(--ink); }

.pagehead { padding-block: 1.2rem 2rem; position: relative; }
.pagehead h1, .hero h1 {
  font-family: var(--f-head); font-weight: 800; font-stretch: 118%;
  font-size: clamp(2rem, 6.2vw, 3.5rem); line-height: 1.04; letter-spacing: -0.012em;
  margin: 0 0 1rem; max-width: 22ch; text-wrap: balance;
}
.pagehead .lead { font-size: 1.28rem; line-height: 1.55; color: var(--ink-2); max-width: 38rem; margin: 0; }
.pipe-rule { height: 22px; margin-top: 1.7rem; position: relative; max-width: 38rem; }
.pipe-rule::before { content: ""; position: absolute; left: 11px; right: 0; top: 9px; height: 4px; background: var(--patina); }
.pipe-rule::after { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 4px solid var(--patina); }

/* ---------- Layout ---------- */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-bottom: 4rem; }
@media (min-width: 62rem) {
  .page.has-rail { grid-template-columns: minmax(0, 42rem) 19rem; gap: 4.5rem; }
  .rail { position: sticky; top: 1.25rem; align-self: start; }
}

.prose { padding-left: var(--pad); border-left: 2px solid var(--line); max-width: 42rem; }
.prose > * { max-width: 40rem; }
.prose > .wide, .prose > .tablewrap, .prose > figure { max-width: 100%; }
.prose p { margin: 0 0 1.15rem; }
.prose h2 {
  font-family: var(--f-head); font-weight: 800; font-stretch: 108%; font-size: clamp(1.45rem, 3.6vw, 1.85rem);
  line-height: 1.16; letter-spacing: -0.006em; margin: 2.8rem 0 0.9rem; position: relative; text-wrap: balance;
}
.prose h2:first-child { margin-top: 0; }
.prose h2::before {
  content: ""; position: absolute; left: calc(-1 * var(--pad) - 9px); top: 0.28em; width: 16px; height: 16px;
  border-radius: 50%; background: var(--paper); border: 4px solid var(--patina);
}
.prose h3 { font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; line-height: 1.25; margin: 1.9rem 0 0.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: 0.45rem; padding-left: 0.2rem; }
.prose li::marker { color: var(--patina); font-weight: 700; }
.prose strong { font-weight: 700; }

/* Steps: a real sequence, so it is numbered */
.steps { list-style: none; padding: 0 !important; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 0 3.1rem; margin-bottom: 1.2rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -0.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--bottle); color: #fff; font-family: var(--f-head); font-weight: 800; display: grid; place-items: center; font-size: 1rem;
}
.steps > li > strong:first-child { display: block; font-family: var(--f-head); font-size: 1.05rem; margin-bottom: 0.1rem; }

/* Callouts */
.stop, .note {
  margin: 1.8rem 0; padding: 1rem 1.1rem 1rem 1.2rem; border-left: 8px solid var(--brass); background: var(--brass-tint);
  font-size: 1.02rem; line-height: 1.55;
}
.stop p:last-child, .note p:last-child { margin-bottom: 0; }
.stop p, .note p { margin-bottom: 0.7rem; }
.stop .t, .note .t { display: block; font-family: var(--f-head); font-weight: 800; font-size: 1.05rem; margin-bottom: 0.25rem; }
.note { border-left-color: var(--patina); background: #dcebe5; }

/* Schedule tables (the pipe schedule from a drawing set) */
.tablewrap { overflow-x: auto; margin: 1.6rem 0; border: 2px solid var(--ink); background: var(--paper-3); -webkit-overflow-scrolling: touch; }
.tablewrap:focus-visible { outline-offset: 2px; }
table.schedule { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.98rem; line-height: 1.45; }
.schedule caption { text-align: left; font-family: var(--f-head); font-weight: 700; padding: 0.7rem 0.9rem; background: var(--paper-2); border-bottom: 2px solid var(--ink); }
.schedule th { text-align: left; font-family: var(--f-head); font-weight: 700; font-size: 0.9rem; background: var(--bottle); color: #fff; padding: 0.6rem 0.9rem; }
.schedule td { padding: 0.7rem 0.9rem; vertical-align: top; border-top: 1px solid var(--line); }
.schedule tbody th { background: none; color: var(--ink); font-size: 1rem; border-top: 1px solid var(--line); }
.schedule tbody tr:nth-child(even) td, .schedule tbody tr:nth-child(even) th { background: #eef2ec; }

/* Route list: link rows, not cards */
.routes { list-style: none; padding: 0 !important; margin: 1.2rem 0 1.8rem; border-top: 2px solid var(--ink); }
.routes li { margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.routes a { display: grid; gap: 0.1rem; padding: 0.85rem 0.2rem; text-decoration: none; color: var(--ink); }
.routes a:hover { background: var(--paper-2); }
.routes .rt { font-family: var(--f-head); font-weight: 700; font-size: 1.08rem; color: var(--patina-d); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.routes a:hover .rt { text-decoration-thickness: 2px; }
.routes .rd { font-size: 0.98rem; color: var(--ink-2); line-height: 1.45; }

/* Fittings: inline link chips */
.fittings { list-style: none; padding: 0 !important; margin: 1rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fittings li { margin: 0; padding: 0; }
.fittings a, .fittings span { display: inline-block; font-family: var(--f-head); font-weight: 600; font-size: 0.95rem; border: 2px solid var(--ink); padding: 0.3rem 0.7rem; border-radius: 2px 14px 2px 14px; text-decoration: none; color: var(--ink); background: var(--paper-3); }
.fittings a:hover { background: var(--bottle); color: #fff; border-color: var(--bottle); }
.fittings span { border-style: dashed; border-color: #7f8f88; color: var(--ink-2); background: none; font-weight: 500; }

/* Rail */
.rail { font-family: var(--f-head); font-size: 0.95rem; line-height: 1.45; }
.rail section { border-top: 4px solid var(--bottle); padding-top: 0.8rem; margin-bottom: 1.8rem; }
.rail .rh { font-weight: 800; font-size: 1.05rem; margin: 0 0 0.5rem; display: block; }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li { margin: 0; border-bottom: 1px solid var(--line); }
.rail li a { display: block; padding: 0.5rem 0; color: var(--ink); text-decoration: none; font-weight: 500; }
.rail li a:hover { color: var(--patina-d); text-decoration: underline; }
.rail .sos { background: var(--bottle); color: #e9f2ee; border-top-color: var(--brass); padding: 1rem 1.1rem; }
.rail .sos .rh { color: var(--brass); }
.rail .sos p { margin: 0 0 0.6rem; }
.rail .sos a { color: #fff; }

/* ---------- Home hero ---------- */
.hero {
  background-color: var(--paper);
  background-image: linear-gradient(rgba(18,32,30,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(18,32,30,.07) 1px, transparent 1px);
  background-size: 2.25rem 2.25rem;
  border-bottom: 2px solid var(--ink);
}
.hero .wrap { display: grid; gap: 2rem; padding-block: 2.5rem 2.75rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 6.4vw, 3.5rem); max-width: 16ch; }
.hero .lead { font-size: 1.3rem; line-height: 1.5; color: var(--ink-2); max-width: 34rem; margin: 0 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-block; font-family: var(--f-head); font-weight: 700; font-size: 1rem; padding: 0.75rem 1.2rem; border: 2px solid var(--ink); text-decoration: none; background: var(--bottle); color: #fff; border-radius: 2px; }
.btn:hover { background: var(--patina-d); color: #fff; }
.btn.alt { background: var(--paper); color: var(--ink); }
.btn.alt:hover { background: var(--brass); color: var(--ink); }
.figure-house { margin: 0; background: var(--paper-3); border: 2px solid var(--ink); }
.figure-house figcaption, figure.diagram figcaption { font-family: var(--f-head); font-size: 0.85rem; padding: 0.6rem 0.85rem; border-top: 2px solid var(--ink); color: var(--ink-2); line-height: 1.4; }
.figure-house svg, figure.diagram svg { display: block; width: 100%; height: auto; }
figure.diagram { margin: 2rem 0; border: 2px solid var(--ink); background: var(--paper-3); }
@media (min-width: 58rem) { .hero .wrap { grid-template-columns: 1fr 1.1fr; gap: 3rem; } }

.band-sos { background: var(--brass); color: var(--ink); border-bottom: 2px solid var(--ink); }
.band-sos .wrap { padding-block: 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; align-items: baseline; font-family: var(--f-head); }
.band-sos strong { font-weight: 800; font-size: 1.15rem; }
.band-sos p { margin: 0; font-size: 1rem; line-height: 1.4; }
.band-sos a { color: var(--ink); font-weight: 700; }

.section { padding-block: 3rem; }
.section.tint { background: var(--paper-2); border-block: 2px solid var(--ink); }
.section h2 { font-family: var(--f-head); font-weight: 800; font-stretch: 112%; font-size: clamp(1.6rem, 4.4vw, 2.3rem); line-height: 1.1; margin: 0 0 1rem; letter-spacing: -0.01em; max-width: 24ch; text-wrap: balance; }
.section .intro { max-width: 38rem; margin: 0 0 1.5rem; color: var(--ink-2); }
.section p { max-width: 40rem; }
.cols { display: grid; gap: 2.5rem; }
@media (min-width: 58rem) { .cols.two { grid-template-columns: 1fr 1fr; gap: 4rem; } .cols.map { grid-template-columns: 0.8fr 1.2fr; gap: 3rem; align-items: center; } }

/* Region map */
.regionmap { margin: 0; }
.regionmap svg { display: block; width: 100%; height: auto; }
.regionmap .stn { fill: var(--paper); stroke: var(--ink); stroke-width: 5; }
.regionmap a:hover .stn, .regionmap a:focus-visible .stn { fill: var(--brass); }
.regionmap a.on .stn { fill: var(--brass); }
.regionmap a:focus-visible { outline: none; }
.regionmap a:focus-visible .stn { stroke-width: 8; stroke: var(--brass-ink); }
.regionmap text { font-family: var(--f-head); font-weight: 700; font-size: 17px; fill: var(--ink); }
.regionmap a:hover text { text-decoration: underline; }
.regionmap figcaption { font-family: var(--f-head); font-size: 0.85rem; color: var(--ink-2); margin-top: 0.4rem; }

/* Region hub on areas page */
.region-block { border-top: 2px solid var(--ink); padding-top: 1rem; margin-top: 2rem; }
.region-block h3 { margin: 0 0 0.4rem; font-family: var(--f-head); font-weight: 800; font-size: 1.35rem; }
.region-block p { margin: 0 0 0.6rem; }

/* Checker */
.checker fieldset { border: 2px solid var(--ink); background: var(--paper-3); margin: 0 0 1.5rem; padding: 1rem 1.1rem; }
.checker legend { font-family: var(--f-head); font-weight: 800; padding: 0 0.4rem; }
.checker label { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.55rem 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 1.02rem; line-height: 1.45; }
.checker label:last-child { border-bottom: 0; }
.checker input { width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; accent-color: var(--patina); flex: none; }
.checker .result { display: none; margin-top: 1.2rem; }
.checker .result.show { display: block; }
.checker button { font-family: var(--f-head); font-weight: 700; font-size: 1rem; padding: 0.75rem 1.2rem; border: 2px solid var(--ink); background: var(--bottle); color: #fff; cursor: pointer; border-radius: 2px; }
.checker button:hover { background: var(--patina-d); }
.checker button.alt { background: var(--paper); color: var(--ink); margin-left: 0.5rem; }
.checker .controls { display: none; }
.js .checker .controls { display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bottle); color: #cfe0d9; font-family: var(--f-head); font-size: 0.95rem; line-height: 1.5; border-top: 6px solid var(--patina); }
.site-footer .wrap { padding-block: 2.5rem 1.5rem; }
.foot-grid { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; } }
.site-footer a { color: #e6f0ec; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--brass); }
.foot-h { font-weight: 800; color: var(--brass); margin: 0 0 0.6rem; display: block; font-size: 0.95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.foot-brand { display: flex; align-items: center; gap: 0.7rem; font-weight: 800; font-stretch: 112%; font-size: 1.15rem; color: #fff; margin-bottom: 0.7rem; }
.foot-brand svg { width: 2.4rem; height: 2.4rem; }
.foot-about p { margin: 0 0 0.7rem; max-width: 26rem; }
.legal { border-top: 1px solid #25524c; margin-top: 2rem; padding-top: 1.1rem; font-size: 0.85rem; color: #9fbab0; display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; justify-content: space-between; }
.legal p { margin: 0; max-width: 46rem; }

/* 404 */
.nf { padding-block: 3rem 5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero .figure-house .flow { stroke-dasharray: 16 6; animation: flow 1.8s linear infinite; }
  @keyframes flow { to { stroke-dashoffset: -22; } }
}

@media print {
  .strip, .site-header, .site-footer, .rail, .skip { display: none; }
  body { background: #fff; }
}

/* Schedule tables stack on narrow screens */
@media (max-width: 40rem) {
  .tablewrap { overflow-x: visible; }
  table.schedule { min-width: 0; display: block; }
  .schedule caption { display: block; }
  .schedule thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .schedule tbody, .schedule tr { display: block; }
  .schedule tr { border-top: 2px solid var(--ink); padding: 0.5rem 0; }
  .schedule tbody tr:first-child { border-top: 0; }
  .schedule tbody th, .schedule td { display: block; border: 0 !important; padding: 0.2rem 0.9rem; }
  .schedule td::before { content: attr(data-label); display: block; font-family: var(--f-head); font-weight: 700; font-size: 0.82rem; color: var(--patina-d); }
}
