/* Road, event, list and About pages. Tokens, type and the brand come from base.css. */
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* ---- Header ---- */
.page-top { background: var(--surface); border-bottom: 1px solid var(--hairline); }
.page-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) {
  .page-top .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 6px; gap: 6px; }
  .page-top .site-nav { width: 100%; overflow-x: auto; margin: 0 -10px; }
  .page-top .site-nav a { white-space: nowrap; }
}

/* ---- Content ---- */
.page { max-width: 820px; margin: 0 auto; padding: 28px 20px 64px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 6px; opacity: 0.6; }
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 10px; }
h2 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; margin: 44px 0 14px; }
h3 { font-size: 15px; font-weight: 600; margin: 22px 0 8px; }
.lead { font-size: 18px; color: var(--ink-2); margin: 0 0 6px; }
.updated { color: var(--muted); font-size: 14px; margin: 0; }
.empty { color: var(--muted); margin: 0; }
.note { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .page { padding-top: 20px; }
  h1 { font-size: 27px; }
  h2 { margin-top: 36px; }
  .lead { font-size: 17px; }
}

/* ---- Buttons ---- */
.cta, .btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
  padding: 9px 15px; border-radius: 8px; font-weight: 600; font-size: 15px; line-height: 1.2;
}
.cta { background: var(--ink); color: var(--surface); }
.cta:hover { opacity: 0.88; }
.btn { border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); }
.btn:hover { background: var(--surface-2); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }

/* ---- Status summary at the top of a page ---- */
.status-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 22px 0 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
}
.status-card p { margin: 0; }
.status-card .state { font-weight: 600; }
.status-card .sub { color: var(--muted); font-size: 14px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); vertical-align: 2px;
}
.pill.live { background: var(--critical); color: #fff; }
.pill.ok { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }

/* ---- Incident cards ---- */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.event {
  display: grid; grid-template-columns: 27px 1fr; gap: 12px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
}
.event .glyph { --s: 22px; margin-top: 1px; }
.event p { margin: 0; }
.event .where { font-weight: 650; }
.event .where a { color: var(--ink); text-decoration: none; }
.event .where a:hover { text-decoration: underline; }
.event .what { color: var(--ink); }
.event .facts { color: var(--ink-2); font-size: 15px; }
.event .facts .delay { color: var(--ink); font-weight: 600; }
.event .srcs { color: var(--muted); font-size: 13px; margin-top: 2px; }
.event details { margin-top: 8px; font-size: 14px; }
.event summary { color: var(--muted); cursor: pointer; width: fit-content; font-size: 13px; }
.event summary:hover { color: var(--ink); }

.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--hairline); color: var(--ink-2); }
.timeline li { margin: 5px 0; }
.timeline time { color: var(--muted); margin-right: 8px; }
.timeline.big { font-size: 15px; margin-top: 0; }
.timeline.big li { margin: 8px 0; }

/* ---- Lists of links (other incidents) ---- */
.event-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.event-links li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.event-links a { font-weight: 550; color: var(--ink); text-decoration: none; }
.event-links a:hover { text-decoration: underline; }
.event-links .meta { color: var(--muted); font-size: 14px; white-space: nowrap; text-align: right; }
.event-links .meta b { color: var(--critical); font-weight: 600; }
@media (max-width: 640px) {
  .event-links li { display: block; }
  .event-links .meta { display: block; text-align: left; white-space: normal; }
}

/* ---- Planned closures ---- */
.closures { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.closures li { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.closures .place { font-weight: 600; }
.closures .what { color: var(--ink-2); }
.closures time { color: var(--ink); font-weight: 550; white-space: nowrap; text-align: right; }
.closures .note { grid-column: 1 / -1; font-size: 13px; }
h3 + .closures { margin-top: 0; }
h3 a { text-decoration: none; }
@media (max-width: 640px) {
  .closures li { grid-template-columns: 1fr; }
  .closures time { text-align: left; }
}

/* ---- Figures ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.facts-list { padding-left: 20px; margin: 0; }
.facts-list li { margin: 6px 0; }
.bare { list-style: none; padding: 0; }

/* Event page: the facts as label/value rows. */
.facts-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 22px 0 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.facts-grid dt, .facts-grid dd { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--hairline); }
.facts-grid dt { color: var(--muted); font-size: 14px; padding-right: 8px; }
.facts-grid dd { font-weight: 550; }
.facts-grid dt:last-of-type, .facts-grid dd:last-of-type { border-bottom: 0; }

/* ---- Questions ---- */
.faq h3 { font-size: 16px; margin: 20px 0 4px; }
.faq p { margin: 0; color: var(--ink-2); }

/* ---- Road index and lists of roads ---- */
.road-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.road-grid a {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.road-grid a:hover { border-color: var(--ink-2); }
.road-grid .n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--critical); color: #fff; font-size: 12px; text-align: center; }
/* A road with a name ("A282 Dartford Crossing") takes two tiles, on one line, so every tile stays the same height. */
.road-grid a.named { grid-column: span 2; }
.road-grid a > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.road-grid .name { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
/* The padding keeps the plate's outer edge clear of the clipping above. */
.road-grid a > span:first-child:not(.plate) { padding: 1px; }
.road-grid .plate { font-size: 14px; }

/* A road's junctions (each a page): small tiles in a wrapping row. */
.junctions { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.junctions a {
  display: block; padding: 5px 10px; min-width: 48px; text-align: center; border: 1px solid var(--hairline); border-radius: 7px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
}
.junctions a:hover { border-color: var(--ink-2); }

/* ---- Embed code ---- */
details.embed { margin-top: 44px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); }
details.embed summary { cursor: pointer; font-weight: 600; }
details.embed p { color: var(--ink-2); font-size: 15px; }
.embed-code {
  width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-2); color: var(--ink); resize: vertical;
}

/* ---- "Add to your website" (/embed, public/embed.js) ---- */
.embed-builder {
  margin-top: 24px; padding: 18px; display: grid; gap: 14px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
}
.embed-builder .fields { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.embed-builder label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.embed-builder select {
  font: inherit; font-weight: 400; min-width: 180px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
}
.embed-builder select:focus { outline: none; border-color: var(--accent); }
.embed-builder .preview { border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; }
.embed-builder .preview .label {
  margin: 0; padding: 6px 12px; background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.embed-builder iframe { display: block; border: 0; }
.embed-builder .actions { margin: 0; }
.embed-builder button.cta { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.embed-builder button.cta.copied { background: var(--good); color: #fff; }

/* ---- Footer ---- */
.site-foot { background: var(--surface); border-top: 1px solid var(--hairline); font-size: 14px; color: var(--muted); }
.site-foot .wrap { padding-top: 32px; padding-bottom: 28px; }
.foot-cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.foot-cols p { margin: 10px 0 0; max-width: 30ch; }
.foot-cols h2 { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 10px; letter-spacing: 0; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-cols a { color: var(--muted); text-decoration: none; }
.foot-cols a:hover { color: var(--ink); text-decoration: underline; }
.legal { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: 12px; line-height: 1.6; }
@media (max-width: 720px) {
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-cols > :first-child { grid-column: 1 / -1; }
}

/* ---- Share button (public/share.js) ---- */
button.btn { font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn.share svg { flex: none; margin-left: -2px; }
.btn.share.copied { border-color: var(--good); color: var(--good); }

/* ---- Error pages ---- */
.error-page { padding: 24px 0 8px; }
.error-code { margin: 0 0 6px; color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.find-road { margin: 36px 0 0; }
.find-road label { display: block; font-weight: 600; margin-bottom: 8px; }
.find-road div { display: flex; gap: 8px; max-width: 420px; }
.find-road input {
  flex: 1; min-width: 0; font: inherit; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
}
.find-road input:focus { outline: none; border-color: var(--accent); }
.find-road button { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
