/* ==========================================================================
   bus.me.uk theme: "Destination blind"
   Amber LED dot-matrix on blind black, warm off-white type, route-line
   diagrams for stop lists. Loaded AFTER each page's inline <style>, so the
   token block below re-maps the variable names every page already uses.
   ========================================================================== */

@font-face {
  font-family: "Doto"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/doto.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/atkinson-next.woff2") format("woff2");
}

:root {
  /* core surfaces */
  --ink:      #0c0d0f;   /* the blind itself */
  --bg:       #111316;
  --panel:    #181b20;
  --panel-2:  #20242b;
  --border:   #2c313a;
  --text:     #f3efe4;   /* warm, like a printed timetable */
  --muted:    #aaa597;
  /* signal colours */
  --accent:   #ffb000;   /* amber LED */
  --accent-ink:#1a1204;  /* text on amber */
  --accent-glow: rgba(255,176,0,.35);
  --accent-2: #7cc8ff;   /* links */
  --good:     #3fd68b;   /* on time / live */
  --late:     #ff7a59;
  --radius:   14px;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-led:  "Doto", ui-monospace, "Courier New", monospace;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  /* faint LED-matrix texture: the site's signature */
  background-image: radial-gradient(rgba(255,176,0,.055) 1px, transparent 1.6px);
  background-size: 18px 18px;
  color: var(--text);
}
/* the map page must stay flat so the map is the focus */
body.is-map { background-image: none; }

a { color: var(--accent-2); text-underline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { letter-spacing: -.01em; line-height: 1.2; }
h1 { font-weight: 800; }

/* ---------- Icons ---------- */
.i { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.2em; flex: none; }
.i-lg { width: 1.6em; height: 1.6em; }

/* ---------- LED type ---------- */
.led {
  font-family: var(--font-led); font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em;
  text-shadow: 0 0 6px var(--accent-glow), 0 0 18px rgba(255,176,0,.18);
}
.led-blind {
  display: inline-block; background: var(--ink); border: 1px solid #23272e;
  border-radius: 10px; padding: .25em .6em .2em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), inset 0 -8px 16px rgba(0,0,0,.5);
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .55rem 1rem; background: rgba(12,13,15,.94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid #1f232a;
}
.site-header .brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.site-header .brand-mark { width: 38px; height: 38px; display: block; }
.site-header .brand-led { font-family: var(--font-led); font-weight: 900; font-size: 1.35rem; color: var(--accent);
  letter-spacing: .06em; text-shadow: 0 0 8px var(--accent-glow); line-height: 1; }
.site-nav { display: flex; align-items: center; gap: .2rem; }
.site-nav a { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); text-decoration: none;
  font-size: .92rem; font-weight: 600; padding: .45rem .7rem; border-radius: 999px; }
.site-nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a.nav-cta { background: var(--accent); color: var(--accent-ink); }
.site-nav a.nav-cta:hover { background: #ffc233; color: var(--accent-ink); }
@media (max-width: 640px) {
  .site-nav a .lbl { display: none; }
  .site-nav a { padding: .5rem; }
  .site-nav a.nav-cta .lbl { display: inline; }
  .site-nav a.nav-cta { padding: .45rem .75rem; }
  .site-header .brand-led { font-size: 1.1rem; }
  .site-header .brand-mark { width: 32px; height: 32px; }
}

/* Old per-page headers that have not been converted keep working */
header .brand-img { display: none; }

/* ---------- Live ticker (under the header) ---------- */
.ticker {
  background: var(--ink); border-bottom: 1px solid #1f232a; overflow: hidden;
  font-family: var(--font-led); font-weight: 800; color: var(--accent); font-size: .95rem;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 0 6px var(--accent-glow);
}
.ticker-track { display: inline-flex; gap: 3rem; padding: .4rem 0 .35rem; padding-left: 100%;
  animation: ticker 38s linear infinite; }
.ticker-track span { display: inline-flex; align-items: center; gap: .5rem; }
.ticker .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 8px var(--good); animation: pulse 1.6s ease-in-out infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; padding-left: 1rem; }
  .ticker .dot { animation: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .75rem 1.2rem; border-radius: var(--radius); font-weight: 700; font-size: 1rem;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  text-decoration: none; cursor: pointer; font-family: inherit; }
.btn:hover { text-decoration: none; border-color: #3b414c; background: #262b33; }
.btn-amber { background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 22px -8px var(--accent-glow); }
.btn-amber:hover { background: #ffc233; border-color: #ffc233; }

/* ---------- Route number badges: a tiny destination blind ---------- */
.line-badge, a.svc-row .badge, .route-badge {
  font-family: var(--font-led) !important; font-weight: 900 !important;
  background: var(--ink) !important; color: var(--accent) !important;
  border: 1px solid #2a2e35; border-radius: 7px;
  text-shadow: 0 0 5px var(--accent-glow); letter-spacing: .03em;
}

/* ---------- Cards and chips (shared by guides, company, vehicle pages) ---------- */
a.card, a.opcard, a.brand-card, .feature, .card-box {
  border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
a.card:hover, a.opcard:hover, a.brand-card:hover {
  border-color: var(--accent) !important; transform: translateY(-2px);
}
a.chip:hover, .chips a:hover { border-color: var(--accent) !important; }
.feature { border-left-color: var(--accent) !important; }
h2 .dot, .dir-section h2 .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

/* ---------- Stop lists as a route-line diagram ---------- */
ol.stops, ul.stops { position: relative; }
ol.stops li, ul.stops li { position: relative; padding-left: 2.6rem !important; }
ol.stops li::before, ul.stops li::before {
  content: ""; position: absolute; left: 1.15rem; top: 0; bottom: 0; width: 4px;
  background: var(--accent); opacity: .85;
}
ol.stops li:first-child::before, ul.stops li:first-child::before { top: 50%; }
ol.stops li:last-child::before, ul.stops li:last-child::before { bottom: 50%; }
ol.stops li::after, ul.stops li::after {
  content: ""; position: absolute; left: calc(1.15rem - 5px); top: 50%; margin-top: -7px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid var(--accent);
}
ol.stops li.passed::before { opacity: .3; }
ol.stops li.passed::after { border-color: #6b6658; }
ol.stops li:first-child::after, ol.stops li:last-child::after,
ul.stops li:first-child::after, ul.stops li:last-child::after { background: var(--accent); }

/* ---------- Photo helpers ---------- */
.photo-frame { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel); }
.photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-frame figcaption, .photo-credit { font-size: .72rem; color: var(--muted); line-height: 1.35; }
.photo-frame figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem .7rem .45rem;
  background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #d9d4c7; }
.photo-frame figcaption a { color: #f3efe4; }

/* ---------- Site footer ---------- */
.site-footer { margin-top: 3rem; border-top: 1px solid #1f232a; background: var(--ink); color: var(--muted); font-size: .88rem; }
.site-footer .cols { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem 1rem; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; }
.site-footer h3 { font-family: var(--font-led); font-weight: 900; color: var(--accent); text-transform: uppercase;
  font-size: 1rem; letter-spacing: .08em; margin-bottom: .6rem; text-shadow: 0 0 6px var(--accent-glow); }
.site-footer ul { list-style: none; }
.site-footer li { margin: .3rem 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer .legal { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 2rem; border-top: 1px solid #1f232a;
  font-size: .78rem; line-height: 1.6; }
.site-footer .brand-line { display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; color: var(--text); font-weight: 700; }
.site-footer .brand-line svg { width: 28px; height: 28px; }

/* Old per-page footers get the same look */
body > footer:not(.site-footer) { background: var(--ink); border-top: 1px solid #1f232a; }

/* ---------- Live map panel ---------- */
.dep-row .badge, .tt-line {
  font-family: var(--font-led) !important; font-weight: 900 !important;
  background: var(--ink) !important; color: var(--accent) !important;
  border: 1px solid #2a2e35; text-shadow: 0 0 5px var(--accent-glow); letter-spacing: .03em;
}
.dep-row .badge { font-size: .95rem !important; }
.dep-row .t { font-family: var(--font-led); font-weight: 800; color: var(--accent) !important;
  text-shadow: 0 0 5px var(--accent-glow); font-size: 1.02rem; }
#ttNowBtn { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent) !important; font-weight: 700; }
#ttPanel { border-top-color: var(--accent) !important; }
.is-map .banner { background: var(--ink); }
.site-header .loc-label { flex: 1; min-width: 0; text-align: right; color: var(--muted); font-size: .85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .site-header .loc-label { display: none; } }
.site-footer { text-align: left; padding: 0; }
