/* The search pages (backend/pages.py): the board's colours and type, light enough to read like a timetable.
   Served at /site.css?v=<mtime> with a year's immutable cache; the query changes whenever this file does. */
/* The site's two faces, served from here rather than Google Fonts (one host, no render-blocking stylesheet). */
@font-face{font-family:'Fredoka';font-style:normal;font-weight:300 700;font-display:swap;src:url(/fonts/Fredoka-latin.woff2) format('woff2')}
@font-face{font-family:'VT323';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/VT323-latin.woff2) format('woff2')}
:root{--ink:#0b1020;--navy:#0e1730;--panel:#152040;--cream:#fdf6e3;--muted:#b7c2de;--led:#ffb627;--line:#2a3658}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:radial-gradient(1200px 600px at 50% -200px,#243466,transparent),var(--navy);color:var(--cream);
  font:17px/1.6 'Fredoka',ui-rounded,system-ui,sans-serif}
a{color:var(--led);text-underline-offset:3px}
a:hover{color:#ffd88a}
.wrap{max-width:860px;margin:0 auto;padding:max(18px,env(safe-area-inset-top)) 18px 40px}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px;color:var(--cream);text-decoration:none;font-weight:700;font-size:20px}
.top-live{font-weight:600}
.crumbs{font-size:13px;color:var(--muted);margin:18px 0 0}
.crumbs a{color:var(--muted)}
h1{font-size:clamp(28px,5.5vw,42px);line-height:1.12;margin:10px 0 4px;color:var(--led);text-shadow:0 0 18px rgba(255,182,39,.35)}
.tag{margin:0 0 14px;font-size:12px;font-weight:700;letter-spacing:1.5px;text-transform:uppercase;color:var(--muted)}
.lead{font-size:18px;color:#e6ebf7}
h2{font-size:25px;line-height:1.2;margin:36px 0 10px}
h3{font-size:18px;margin:22px 0 6px;color:var(--led)}
h3 small{font-size:13px;font-weight:500;color:var(--muted)}
h3.q{color:var(--cream);font-size:17px;margin-bottom:0}
p{margin:10px 0}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr));gap:10px;margin:18px 0}
.stat{background:#06080d;border:4px solid var(--ink);border-radius:16px;box-shadow:0 5px 0 var(--ink),inset 0 0 0 3px #232a40;padding:10px 14px}
.stat b{display:block;font-family:'VT323',monospace;font-weight:400;font-size:36px;line-height:1;color:var(--led);text-shadow:0 0 10px rgba(255,182,39,.6)}
.stat span{display:block;margin-top:4px;font-size:13px;line-height:1.35;color:var(--muted)}
ul.next{list-style:none;padding:0;margin:10px 0;background:var(--panel);border:3px solid var(--line);border-radius:14px;overflow:hidden}
ul.next li{display:flex;flex-wrap:wrap;gap:4px 12px;padding:10px 14px;border-top:2px dashed var(--line)}
ul.next li:first-child{border-top:0}
ul.next li[hidden],[data-upcoming][hidden]{display:none}
.t{font-family:'VT323',monospace;font-size:22px;line-height:1.1;color:var(--led);white-space:nowrap}
.asof,.note,.data-note{font-size:14px;color:var(--muted)}
.data-note{margin-top:36px}
.none{color:var(--muted)}
.actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.btn{display:inline-block;padding:10px 16px;border:3px solid var(--ink);border-radius:14px;background:var(--led);color:var(--ink);
  font-weight:700;text-decoration:none;box-shadow:0 4px 0 var(--ink)}
.btn:hover{color:var(--ink)}
.btn.ghost{background:var(--cream)}
.btn:active{transform:translateY(3px);box-shadow:0 1px 0 var(--ink)}
.steps{padding-left:22px}
.steps li{margin:6px 0}
.notes,.shares{padding-left:20px;color:#e6ebf7}
.links{padding-left:20px}
.links li{margin:4px 0}
.az{columns:2;column-gap:28px}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:12px}
.card{display:block;padding:14px 16px;background:var(--panel);border:3px solid var(--line);border-radius:16px;text-decoration:none;color:var(--cream)}
.card b{display:block;font-size:19px;color:var(--led)}
.card span{font-size:14px;color:var(--muted)}
.card:hover{border-color:var(--led)}
.scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
table.tt{width:100%;border-collapse:collapse;background:var(--panel);border:3px solid var(--line);border-radius:14px;overflow:hidden;font-size:15px}
.tt th,.tt td{padding:8px 10px;text-align:left;border-top:2px dashed var(--line);vertical-align:top}
.tt thead th{border-top:0;font-size:11px;letter-spacing:1.3px;text-transform:uppercase;color:var(--muted);background:#1b2850}
.tt td.t{font-size:21px}
.tt small{color:var(--muted);font-size:12px}
.tt .nw{white-space:nowrap}
.chip{display:inline-block;margin-left:4px;padding:0 6px;border-radius:6px;background:#2b3a6a;color:#dbe3f7;font-size:11px;font-weight:700;white-space:nowrap}
.site-foot{margin-top:44px;padding-top:18px;border-top:2px dashed var(--line);font-size:14px;color:var(--muted)}
.site-foot nav{display:flex;flex-wrap:wrap;gap:6px 14px;margin-bottom:8px}
@media (max-width:560px){
  body{font-size:16px}
  .lead{font-size:17px}
  .az{columns:1}
  /* NY Penn to anywhere: five columns in 339px. The Usual track column is the track over how often ("13/14",
     then "(16 of 19)"; its heading already says track), and the rest give up a few pixels each: the widest
     trips, "Gladstone · 12 stops" among them, then fit with about 10px to spare at 375px wide. */
  .tt th,.tt td{padding:7px 3px}
  .tt thead th{letter-spacing:.3px}
  .tt td.t{font-size:17px}
  .tt{font-size:14px}
  .tt small{font-size:11px}
  .tt .usual .word{display:none}
  .tt .share{display:block;color:var(--muted);font-size:11px}
}
/* zoomed-in phones (Safari's page zoom, Android's display and font size): about 300-340px wide at 125%, 260 at 150%,
   under 200 at 200%. The timetables tighten first, from 340px, so they still fit without scrolling sideways. */
@media (max-width:340px){
  .tt th,.tt td{padding:5px 2px}
  .tt{font-size:12px}
  .tt thead th{font-size:9px;letter-spacing:0}
  .tt td.t{font-size:15px}
  .tt small,.tt .share{font-size:10px}
  .chip{margin-left:2px;padding:0 4px;font-size:10px}
}
/* 150% and up: narrower margins and type, and long words and links break instead of running off the side */
@media (max-width:300px){
  body{font-size:15px;overflow-wrap:break-word}
  a{overflow-wrap:anywhere}
  .wrap{padding:max(10px,env(safe-area-inset-top)) 6px 30px}
  .brand{font-size:17px}
  h1{font-size:24px}
  h2{font-size:21px;margin-top:28px}
  .lead{font-size:16px}
  .tag{letter-spacing:1px}
  .stat{padding:8px 10px}
  .stat b{font-size:30px}
  .card{padding:10px 12px}
  .card b{font-size:17px}
  .steps,.notes,.shares,.links{padding-left:18px}
  /* the date and time of a departure may go on two lines; pages.py keeps each of them in one piece */
  ul.next li{padding:8px 10px;gap:2px 8px}
  ul.next li > *{min-width:0}
  ul.next .t{white-space:normal;font-size:20px}
  /* the Ride column goes: it's Arrives minus Departs */
  .tt th:nth-child(3),.tt td:nth-child(3){display:none}
}
/* 175% and up: four columns still don't fit, so each timetable row stacks the arrival under the departure, with the
   train beside them and the usual track at the right; the train's line and stop count may wrap between the two
   (pages.py keeps "12 stops" together) */
@media (max-width:240px){
  .tt,.tt thead,.tt tbody{display:block}
  .tt tr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:auto 1fr;grid-template-areas:"dep train usual" "arr train usual";align-items:start;
    gap:0 8px;padding:6px 8px;border-top:2px dashed var(--line)}
  .tt thead tr{border-top:0;background:#1b2850}
  .tt th,.tt td{padding:0;border-top:0}
  .tt th:nth-child(1),.tt td:nth-child(1){grid-area:dep}
  .tt th:nth-child(2),.tt td:nth-child(2){grid-area:arr}
  .tt th:nth-child(4),.tt td:nth-child(4){grid-area:train}
  .tt th:nth-child(5),.tt td:nth-child(5){grid-area:usual;text-align:right}
  .tt td:nth-child(2){color:var(--cream);text-shadow:none}
  .tt .nw{white-space:normal}
}
