/* RTIG microsite: QR Codes at Bus Stops (RTIGT066-1-0)
   Layout: RTIG-style lavender header band with centred page title, then a two-column
   body (guide text left, "Guide contents" block right, as on rtig.org.uk); one column below 960px.
   Colours and type are taken from the live rtig.org.uk theme (vanipro). Light theme only, to match the main site. */

:root {
  /* Brand colours (rtig.org.uk) */
  --navy: #003361;          /* text and headings (12.8:1 on white) */
  --red: #E01129;           /* RTIG accent: decorative bars only */
  --link: #CF1026;          /* RTIG red, deepened slightly so link text passes 4.5:1 on white and lavender */
  --lavender: #E9EBF5;      /* header band and side blocks */
  --lavender-deep: #E0E2F6; /* RTIG decorative circle */
  --blush: #F3E7F0;         /* RTIG decorative circle */
  --white: #FFFFFF;
  --muted: #4E5880;         /* secondary text (6.9:1 on white, 5.8:1 on lavender) */
  --rule: #C9CEE3;          /* hairlines and table borders (decorative) */
  --tint: #F5F6FB;          /* subtle panel fill */

  /* Type (rtig.org.uk: Roboto headings, Open Sans body at 18px / 1.6) */
  --font-heading: "Roboto", "Segoe UI", Arial, sans-serif;
  --font-body: "Open Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;

  --container: 72rem;
  --gutter: 1rem;
  --radius: 6px;
  --focus: 3px solid var(--navy);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 1.125rem;      /* 18px */
  line-height: 1.6;
}

img, svg { max-width: 100%; height: auto; }
p, ul, ol, dl, figure { margin: 0; }

/* ---------- Links and focus ---------- */
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }
:focus-visible { outline: var(--focus); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }

.skip-link {
  position: absolute; left: 1rem; top: -100rem; z-index: 100;
  background: var(--navy); color: var(--white); padding: 0.75rem 1rem;
  font-family: var(--font-heading); font-weight: 700; text-decoration: none; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--white); outline: 3px solid var(--red); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 40em) { :root { --gutter: 1.5rem; } }

/* ---------- Site header (lavender band, as rtig.org.uk) ---------- */
.site-header { background: var(--lavender); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 2rem; padding-block: 1.25rem 0.5rem;
}
.site-logo { display: inline-block; line-height: 0; border-radius: 2px; }
.site-logo img { width: 150px; height: auto; display: block; }

.header-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.header-links a {
  display: inline-block; position: relative; padding-block: 0.6rem;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.0625rem; line-height: 1.2;
  color: var(--navy); text-decoration: none;
}
.header-links a::after {   /* RTIG menu marker: short red bar under each item */
  content: ""; position: absolute; left: 0; bottom: 0.15rem; width: 20px; height: 2px; background: var(--red);
  transition: width 0.2s ease;
}
.header-links a:hover::after, .header-links a:focus-visible::after { width: 100%; }
@media (prefers-reduced-motion: reduce) { .header-links a::after { transition: none; } }

/* ---------- Page title band ---------- */
.page-header { background: var(--lavender); padding-block: 2.25rem 3rem; text-align: center; }
.page-header h1 {
  font-family: var(--font-heading); font-weight: 700; color: var(--navy);
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); line-height: 1.25;
  margin: 0 auto; max-width: 30ch; text-wrap: balance;
}
.page-header h1 .num { color: var(--muted); font-weight: 700; }
.page-header .lead { margin: 1rem auto 0; max-width: 40rem; font-size: 1.1875rem; }
.page-header .doc-meta { margin: 0.75rem 0 0; font-size: 1rem; color: var(--muted); }
.page-header .doc-meta span + span::before { content: "·"; margin-inline: 0.6em; }

.breadcrumb { margin-top: 1rem; }
.breadcrumb ol { list-style: none; margin: 0 auto; padding: 0; max-width: 46rem; font-size: 1.0625rem; }
.breadcrumb li { display: inline; }
.breadcrumb li + li::before {
  content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin-inline: 0.6em 0.8em; vertical-align: 0.12em;
  border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg);
}
.breadcrumb a:hover { text-decoration-thickness: 2px; }

/* ---------- Body layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; padding-block: 2.5rem 3.5rem; }
@media (min-width: 60em) {
  .layout { grid-template-columns: minmax(0, 1fr) 19.5rem; gap: 3.5rem; }
}
.content { min-width: 0; }

/* ---------- Prose ---------- */
.prose { max-width: 46rem; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2, .prose h3 {
  font-family: var(--font-heading); font-weight: 700; color: var(--navy); line-height: 1.3; text-wrap: balance;
  margin: 2.75rem 0 0; scroll-margin-top: 1.5rem;
}
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.375rem; margin-top: 2.25rem; }
.prose > :first-child { margin-top: 0; }
.prose h2::after { content: ""; display: block; width: 45px; height: 2px; background: var(--red); margin-top: 0.6rem; }
.prose h3::after { content: ""; display: block; width: 30px; height: 2px; background: var(--red); margin-top: 0.45rem; }
.prose .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.prose h2 + *, .prose h3 + * { margin-top: 1rem; }

/* Numbered paragraphs, as in the Word edition (e.g. 3.1.2) */
.prose .np + .np { margin-top: 0.85rem; }
.np { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); column-gap: 0.75rem; scroll-margin-top: 1.5rem; }
.np-num { font-size: 0.9375rem; line-height: 1.95; color: var(--muted); font-variant-numeric: tabular-nums; }
.np-text { min-width: 0; }
.np-quote .np-text { border-left: 4px solid var(--red); background: var(--tint); padding: 0.75rem 1rem; }
@media (max-width: 30em) { .np { grid-template-columns: 2.9rem minmax(0, 1fr); column-gap: 0.5rem; } }

.prose ul { margin-block: 0.75rem 0; padding-left: 1.5rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li::marker { color: var(--navy); }
.np + ul, .np-list { margin-left: 4.35rem; }
@media (max-width: 30em) { .np + ul, .np-list { margin-left: 3.4rem; } }

/* Status panel on the overview page */
.status-panel { background: var(--lavender); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.status-panel h2 { margin: 0; font-size: 1.375rem; }
.status-panel h2::after { width: 30px; }
.status-panel p { margin-top: 0.6rem; }

/* ---------- Figures ---------- */
.figure { margin: 2rem 0; }
.figure-media {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white);
  padding: 1.25rem; display: flex; justify-content: center;
}
.figure-media img { display: block; }
.figure-media.qr img { width: 13.75rem; }        /* figures 2 and 3 shown at the same size for comparison */
.figure-media.photo { padding: 0; overflow: hidden; }
.figure-media.photo img { width: 100%; }
.figure-media svg { width: 100%; max-width: 26rem; }
.figure figcaption { margin-top: 0.6rem; font-size: 1rem; color: var(--muted); text-align: center; }
.figure figcaption .fig-label { font-weight: 700; color: var(--navy); margin-right: 0.4em; }

/* Inline SVG diagram (Figure 1) */
.diagram-text { font-family: var(--font-body); font-size: 15px; fill: var(--navy); }
.diagram-text.bold { font-weight: 700; }

/* ---------- Glossary ---------- */
.glossary { margin: 0; border-top: 1px solid var(--rule); }
.glossary div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.15rem 1.5rem; padding-block: 0.9rem; border-bottom: 1px solid var(--rule); }
@media (min-width: 40em) { .glossary div { grid-template-columns: 8rem minmax(0, 1fr); } }
.glossary dt { font-family: var(--font-heading); font-weight: 700; }
.glossary dd { margin: 0; }

/* ---------- Rationale tables ---------- */
.table-wrap { margin-top: 1.25rem; }
table.rationale { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.55; }
table.rationale th, table.rationale td { text-align: left; vertical-align: top; padding: 0.85rem 0.9rem; border-bottom: 1px solid var(--rule); }
table.rationale thead th {
  background: var(--lavender); font-family: var(--font-heading); font-weight: 700; font-size: 1rem; border-bottom: 2px solid var(--red);
}
table.rationale tbody th { font-weight: 600; width: 32%; }
table.rationale td.value { width: 17%; font-weight: 600; }
table.rationale tbody tr:nth-child(even) { background: var(--tint); }

@media (max-width: 47.99em) {
  /* Stack each row as a card on small screens; ARIA roles in the markup keep table semantics */
  table.rationale, table.rationale tbody, table.rationale tr, table.rationale th, table.rationale td { display: block; width: auto !important; }
  table.rationale thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.rationale tbody tr { border: 1px solid var(--rule); border-radius: var(--radius); margin-top: 1rem; background: var(--white) !important; overflow: hidden; }
  table.rationale tbody th { background: var(--lavender); border-bottom: 2px solid var(--red); font-weight: 700; }
  table.rationale td { border-bottom: 0; padding-top: 0.5rem; }
  table.rationale td.empty { display: none; }
  table.rationale td[data-label]::before {
    content: attr(data-label);
    content: attr(data-label) / "";
    display: block; font-family: var(--font-heading); font-weight: 700; font-size: 0.875rem;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem;
  }
}

/* On-page contents (long pages) */
.on-this-page { background: var(--tint); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.25rem; }
.on-this-page h2 { margin: 0; font-size: 1.125rem; }
.on-this-page h2::after { display: none; }
.on-this-page ul { list-style: none; padding: 0; margin: 0.5rem 0 0; columns: 2 16rem; column-gap: 2rem; }
.on-this-page li { break-inside: avoid; padding-block: 0.15rem; }

/* Sources */
.sources { list-style: none; padding: 0; }
.sources li { padding-block: 0.75rem; border-bottom: 1px solid var(--rule); font-size: 1rem; overflow-wrap: anywhere; }
.sources li + li { margin-top: 0; }

/* ---------- Guide contents (RTIG sidebar block) ---------- */
.sidebar { min-width: 0; }
.guide-nav {
  position: relative; overflow: hidden;
  background: var(--lavender); border-radius: var(--radius); padding: 1.25rem 1.25rem 1.5rem;
}
.guide-nav::before, .guide-nav::after {     /* RTIG's overlapping circles, purely decorative */
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.guide-nav::before { width: 2.6rem; height: 2.6rem; top: 1.1rem; right: 2.3rem; background: var(--lavender-deep); }
.guide-nav::after { width: 2rem; height: 2rem; top: 2rem; right: 1.4rem; background: var(--blush); opacity: 0.9; }
.guide-nav h2 {
  position: relative; z-index: 1; margin: 0 0 0.9rem; font-family: var(--font-heading); font-weight: 700;
  font-size: 1.75rem; line-height: 1.2;
}
.guide-nav h2::after { content: ""; display: block; width: 45px; height: 2px; background: var(--red); margin-top: 0.6rem; }
.guide-nav ul { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }
.guide-nav > ul > li + li { border-top: 1px solid var(--rule); }
.guide-nav a {
  display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); column-gap: 0.4rem;
  padding-block: 0.55rem; font-size: 1rem; line-height: 1.4; text-decoration: none;
}
.guide-nav a:hover { color: var(--navy); text-decoration: underline; }
.guide-nav .nav-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.guide-nav .appendix a { grid-template-columns: minmax(0, 1fr); }
.guide-nav a[aria-current="page"] { color: var(--navy); font-weight: 700; }
.guide-nav a[aria-current="page"] .nav-num { color: var(--navy); }
.guide-nav .sub { margin: -0.15rem 0 0.6rem 2.5rem; border-left: 2px solid var(--red); }
.guide-nav .appendix .sub { margin-left: 0.25rem; }
.guide-nav .sub a { grid-template-columns: minmax(0, 1fr); padding: 0.3rem 0 0.3rem 0.75rem; font-size: 0.9375rem; }

/* ---------- Previous / next ---------- */
.pager { margin-top: 3.5rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.pager ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 40em) { .pager ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pager li.next { grid-column: -2; text-align: right; }
.pager a {
  display: block; height: 100%; padding: 1rem 1.25rem; border: 2px solid var(--lavender); border-radius: var(--radius);
  text-decoration: none; color: var(--navy);
}
.pager a:hover { background: var(--lavender); }
.pager .pager-label {
  display: block; font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--link);
}
.pager .pager-title { display: block; margin-top: 0.2rem; font-family: var(--font-heading); font-weight: 700; font-size: 1.125rem; line-height: 1.35; }

/* ---------- Footer ---------- */
.site-footer { border-top: 4px solid var(--lavender); padding-block: 2rem 2.5rem; font-size: 1rem; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 2rem; }
@media (min-width: 48em) { .footer-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.footer-inner p { margin: 0; }
.footer-inner p + p { margin-top: 0.4rem; }
.footer-doc { font-family: var(--font-heading); font-weight: 700; font-size: 1.125rem; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { font-family: var(--font-heading); font-weight: 700; color: var(--navy); text-decoration: none; }
.footer-links a:hover { color: var(--link); text-decoration: underline; }
.legal { grid-column: 1 / -1; color: var(--muted); font-size: 0.9375rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

/* ---------- Print ---------- */
@media print {
  .skip-link, .header-links, .sidebar, .pager { display: none !important; }
  .site-header, .page-header { background: none; }
  body { font-size: 11pt; }
  .layout { display: block; padding: 0; }
  .prose { max-width: none; }
  a { color: var(--navy); }
  table.rationale tr, .figure { break-inside: avoid; }
}
