/* Shared styles for the enthusiast content pages (disused lines, closed stations,
   heritage railways, geographic tube map). Brand-matched to the homepage. */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --green:#0b2d27; --green-hover:#164038; --ink:#1f2933; --muted:#5b6670; --line:#e3e6e4; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink); background: #fbfcfb; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--green); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header .bar { max-width: 980px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 800; font-size: 17px; color: var(--green); text-decoration: none; letter-spacing: -0.01em; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; margin-left: 16px; }
.nav a:hover { color: var(--green); }
/* the "Open the map" button is a .btn inside .nav: keep its text white (beat `.nav a`) */
.nav a.btn, .nav a.btn:hover { color: #fff; }


.btn { display: inline-block; background: var(--green); color: #fff; text-decoration: none;
  padding: 12px 22px; border-radius: 8px; font-weight: 700; font-size: 15px; transition: background .15s; }
.btn:hover { background: var(--green-hover); }
.btn.small { padding: 8px 15px; font-size: 14px; }
.btn.ghost { background: #fff; color: var(--green); border: 2px solid var(--green); }
.btn.ghost:hover { background: #eef4f2; }

.page-head { background: linear-gradient(180deg, #eef4f2, #fbfcfb); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding: 48px 20px 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.page-head h1 { font-size: 34px; line-height: 1.15; color: var(--green); letter-spacing: -0.02em; margin-bottom: 16px; }
.page-head p.lead { font-size: 18px; color: var(--muted); margin-bottom: 24px; }

main .wrap { padding: 36px 20px; }
.page-shot { margin: 0 0 30px; }
.page-shot img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(11, 45, 39, 0.16); }
.page-shot figcaption { color: var(--muted); font-size: 13.5px; margin-top: 10px; text-align: center; }
.prose h2 { font-size: 21px; color: var(--green); margin: 30px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0; }

/* Headline figures counted from the map's own data (see scripts/build_stats.py). */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 4px 0 30px; }
.facts .fact { background: var(--green); color: #fff; border-radius: 12px; padding: 18px 14px; text-align: center; }
.facts .fact .n { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.facts .fact .l { font-size: 13px; opacity: .85; margin-top: 5px; }
@media (max-width: 540px) { .facts { grid-template-columns: 1fr; } }

/* A standing-out aside inside prose: travel advice on the incident note, and anything else
   a reader must not skim past. Amber rather than the site green, so it reads as a caveat
   rather than as another section. */
.prose .note { background: #fdf6e8; border: 1px solid #eeddba; border-left: 4px solid #d9a441;
  border-radius: 8px; padding: 12px 16px; margin: 0 0 18px; }

/* Time-and-event rows, e.g. a service's reported calling times. Left column narrow and
   tabular so the times line up down the page; the whole thing scrolls rather than pushing
   the page sideways on a phone. */
.prose table.figs { width: 100%; border-collapse: collapse; margin: 0 0 18px; display: block;
  overflow-x: auto; }
.prose table.figs th { width: 5.5em; text-align: left; vertical-align: top; padding: 6px 12px 6px 0;
  font-variant-numeric: tabular-nums; color: var(--green); white-space: nowrap; }
.prose table.figs td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.prose table.figs th { border-bottom: 1px solid var(--line); }

/* Two-column list of named lines/stations, for the "notable examples" blocks. */
.prose ul.cols { columns: 2; column-gap: 26px; padding-left: 20px; }
@media (max-width: 540px) { .prose ul.cols { columns: 1; } }

.related { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-top: 32px; }
.related h2 { font-size: 15px; color: var(--green); margin-bottom: 8px; }
.related a { display: block; padding: 5px 0; font-weight: 600; text-decoration: none; }
.related a:hover { text-decoration: underline; }

/* Site footer: the same markup on every page, so the whole site links together
   consistently. Styles are scoped under .site-footer so this block can be inlined
   verbatim into the pages that carry their own CSS (index, changelog, stats, ...). */
/* Brand mark (assets/brand/trainmap-logo-colour.svg, inlined by scripts/build_nav.py).
   flex: none, or the header's justify-content squeezes it; the gap stops it reading as
   part of the "T". */
.site-header .brand { display: inline-flex; align-items: center; gap: 9px; }
.site-header .brand-mark { width: 26px; height: 26px; flex: none; }
.site-header .menu-panel .m-brand { display: flex; align-items: center; gap: 9px; }
.site-header .menu-panel .brand-mark { width: 22px; height: 22px; flex: none; }
.site-footer .foot-mark { display: block; width: 30px; height: 30px; margin: 0 auto 10px; }
.site-footer { background: #fff; border-top: 1px solid #e3e6e4; margin-top: 40px;
  padding: 34px 0 48px; color: #5b6670; font-size: 14px; }
.site-footer .wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.site-footer .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; text-align: left; }
.site-footer h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em;
  color: #0b2d27; margin-bottom: 10px; }
.site-footer a { display: block; color: #0b2d27; text-decoration: none; padding: 4px 0; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .fine { margin-top: 26px; padding-top: 18px; border-top: 1px solid #e3e6e4;
  font-size: 13px; text-align: center; line-height: 1.6; }
.site-footer .fine a { display: inline; }
@media (max-width: 620px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 400px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* Mobile: sit the page head tight under the header rather than leaving a band of
   empty gradient, so the content starts higher up the screen. */
@media (max-width: 540px) {
  .page-head .wrap { padding: 18px 20px 26px; }
  .page-head h1 { font-size: 27px; margin-bottom: 12px; }
  .page-head p.lead { font-size: 16px; margin-bottom: 18px; }
  main .wrap { padding: 24px 20px; }
}

        /* Mobile menu: a native <details> disclosure, so it needs no JavaScript and keeps
           keyboard/screen-reader support. Hidden on desktop, where the links sit inline.
           NOTE the child combinator in the hide rule below: a descendant selector would
           also hide the links inside the open panel. */
        .nav { display: flex; align-items: center; flex-wrap: nowrap; }
        .nav a.btn { white-space: nowrap; }
        .menu { display: none; position: relative; margin-left: 12px; }
        .menu > summary {
          list-style: none; cursor: pointer; display: flex; align-items: center;
          padding: 6px; border-radius: 7px; color: #0b2d27;
        }
        .menu > summary::-webkit-details-marker { display: none; }
        .menu > summary::marker { content: ""; }
        .menu > summary:hover, .menu[open] > summary { background: #eef4f2; }
        .menu-panel {
          position: absolute; right: 0; top: calc(100% + 9px); z-index: 1200;
          background: #fff; border: 1px solid #e3e6e4; border-radius: 10px;
          box-shadow: 0 12px 34px rgba(11, 45, 39, .18); padding: 8px; min-width: 236px;
          max-height: calc(100vh - 96px); overflow-y: auto;
        }
        .menu-panel a {
          display: block; margin: 0; padding: 9px 12px; border-radius: 7px;
          color: #1f2933; font-size: 15px; font-weight: 600; white-space: nowrap;
        }
        .menu-panel a:hover { background: #eef4f2; color: #0b2d27; }
        .menu-panel .grp {
          font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
          color: #5b6670; font-weight: 700; padding: 10px 12px 4px; margin: 0;
        }
        .menu-panel .grp:first-child { padding-top: 4px; }
        @media (max-width: 600px) {
          .nav > a:not(.btn) { display: none; }
          .menu { display: block; }
        }

/* Contact page email block. The address itself is injected by JS, so this only styles
   the container, since there is no address in the markup to style. */
.email-card {
    background: #f4f8f6; border: 1px solid #d9e3df; border-radius: 10px;
    padding: 20px 22px; margin: 26px 0 30px;
}
.email-label {
    font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
    color: #5b6670; font-weight: 700; margin: 0 0 4px;
}
.email-line { font-size: 20px; font-weight: 700; color: #0b2d27; margin: 0; word-break: break-word; }
.email-line a { color: #0b2d27; }
.email-note { font-size: 13px; color: #5b6670; margin: 10px 0 0; line-height: 1.55; }

/* ---- Site nav: five top-level items, three with submenus -------------------------------
   Native <details> throughout, so it works with no JavaScript and keeps keyboard and
   screen-reader support. site.js only adds dismiss-on-outside-tap and Escape. */
.nav-item { position: relative; margin-left: 16px; }
.nav-item > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.nav-item > summary::-webkit-details-marker { display: none; }
.nav-item > summary::marker { content: ""; }
.nav-item > summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .12s ease;
}
.nav-item[open] > summary::after { transform: rotate(-135deg); margin-top: 2px; }
.nav-item > summary:hover, .nav-item[open] > summary { color: var(--green); }
.nav-item .drop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 1200;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(11, 45, 39, .18); padding: 8px; min-width: 250px;
}
.nav-item .drop a {
  display: block; margin: 0; padding: 9px 12px; border-radius: 7px;
  color: var(--ink); font-size: 14.5px; font-weight: 600; white-space: nowrap;
}
.nav-item .drop a:hover { background: #eef4f2; color: var(--green); }

/* Mobile: one full-screen sheet, with each top-level group's children indented beneath a
   heading so the two levels are unmistakable. The old panel was a cramped dropdown that
   ran off the bottom of small screens. */
.menu > summary .ico-close { display: none; }
@media (max-width: 700px) {
  .nav > a:not(.btn), .nav-item { display: none; }
  .nav > a.btn { display: none; }              /* the sheet carries the CTA instead */
  .menu { display: block; margin-left: 8px; position: static; }
  .menu[open] > summary .ico-open { display: none; }
  .menu[open] > summary .ico-close { display: inline-flex; }
  .menu[open] > summary { position: relative; z-index: 1301; }
  .menu-panel {
    position: fixed; inset: 0; z-index: 1300; overflow-y: auto;
    background: #fff; border: 0; border-radius: 0; box-shadow: none;
    padding: 74px 22px 40px; min-width: 0; max-height: none;
    display: flex; flex-direction: column;
  }
  .menu-panel .m-map {
    display: block; background: var(--green); color: #fff; text-align: center;
    padding: 13px 16px; border-radius: 10px; font-size: 16px; font-weight: 700;
    margin: 0 0 8px;
  }
  .menu-panel .m-map:hover { background: #164038; color: #fff; }
  .menu-panel .m-grp {
    font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); font-weight: 700; margin: 22px 0 2px; padding: 0;
  }
  .menu-panel .m-top {
    display: block; padding: 13px 0; font-size: 18px; font-weight: 700;
    color: var(--green); border-bottom: 1px solid var(--line); margin-top: 22px;
  }
  /* Children sit indented under their heading, behind ONE continuous rule down the left,
     so the two levels read at a glance rather than as one flat list. The rule lives on the
     wrapper: put it on each link and it renders as disconnected dashes. */
  .menu-panel .m-kids { border-left: 2px solid var(--line); margin: 2px 0 0 2px; }
  .menu-panel .m-sub {
    display: block; padding: 11px 0 11px 16px; font-size: 16px; font-weight: 600;
    color: var(--ink);
  }
  .menu-panel .m-brand {
    font-size: 17px; font-weight: 800; color: var(--green); letter-spacing: -0.01em;
    padding: 0 0 18px; display: block;
  }
  .menu-panel .m-sub:hover, .menu-panel .m-top:hover { color: var(--green); }
  body:has(.menu[open]) { overflow: hidden; }   /* no scrolling the page behind the sheet */
}

/* Station address + the postcode districts a station is nearest to (build_station_pages.py).
   High on the page and in plain text: "nearest station to <postcode>" is the site's
   strongest query and these pages carried no postcode at all before. */
.station-address { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 17px; margin: 4px 0 18px; font-size: 15px; }
.station-address p { margin: 0; }
.station-address p + p { margin-top: 7px; }
.station-addr .pc { font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.station-pc { color: #45504c; }
.station-pc strong { color: var(--green); }
