/* NERTA site styles. Colors match skills/mbta-style/SKILL.md. */
:root {
  --ink: #16161a;
  --ink-2: #3b3b44;
  --muted: #62626d;
  --paper: #fcfcfa;
  --card: #ffffff;
  --rule: #e2e2dd;
  --wash: #f2f2ee;
  --water: #bfe3e2;
  --link: #003da5;
  --red: #da291c; --orange: #ed8b00; --blue: #003da5; --green: #00843d;
  --yellow: #f5c400; --cyan: #00a9c9; --indigo: #3f3fb5; --silver: #7c878e;
  --rail: #80276c; --rail-line: #a98aa8; --ferry: #00796d; --gold: #ffd23f;
  --ok: #1e7b34; --warn: #b35c00; --bad: #b0151a;
  --radius: 10px;
  --wrap: 1200px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); line-height: 1.45; font-size: 16px; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* Utility bar */
.utility { background: var(--ink); color: #d9d9de; font-size: .82rem; }
.utility .wrap { display: flex; gap: 18px; justify-content: flex-end; align-items: center; min-height: 34px; flex-wrap: wrap; }
.utility a { color: #fff; text-decoration: none; }
.utility a:hover { text-decoration: underline; }
.utility .clock { margin-right: auto; font-variant-numeric: tabular-nums; }

/* Header */
.masthead { background: var(--card); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 50; }
.masthead .wrap { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { height: 58px; width: auto; }
.brand .word { display: flex; flex-direction: column; line-height: 1.05; }
.brand .word b { font-size: 1.05rem; letter-spacing: .02em; }
.brand .word span { font-size: .78rem; color: var(--muted); }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem; padding: 10px 12px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--wash); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--ink); border-radius: 8px 8px 0 0; }
.search { position: relative; }
.search input { width: 220px; padding: 10px 12px 10px 36px; border: 1.5px solid #c9c9c3; border-radius: 999px; font: inherit; font-size: .92rem; background: var(--paper); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1.5px solid var(--ink); border-radius: 8px; padding: 8px 12px; font: inherit; font-weight: 700; }
.stripe { display: grid; grid-template-columns: repeat(7, 1fr); height: 5px; }
.stripe i:nth-child(1) { background: var(--red); } .stripe i:nth-child(2) { background: var(--orange); }
.stripe i:nth-child(3) { background: var(--yellow); } .stripe i:nth-child(4) { background: var(--green); }
.stripe i:nth-child(5) { background: var(--cyan); } .stripe i:nth-child(6) { background: var(--blue); }
.stripe i:nth-child(7) { background: var(--indigo); }

.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 280px; background: #fff; border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; display: none; z-index: 60; }
.suggest.open { display: block; }
.suggest a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.suggest a:hover, .suggest a.active { background: var(--wash); }

/* Alert banner */
.banner { background: #fff4d6; border-bottom: 1px solid #f0d58a; font-size: .93rem; }
.banner .wrap { display: flex; gap: 12px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.banner .tag { background: var(--ink); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: .04em; }

/* Layout bits */
main { display: block; }
.section { padding: 40px 0; }
.section.tight { padding: 24px 0; }
.section.wash { background: var(--wash); }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: 1.15fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 1.2rem; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.page-head { background: var(--card); border-bottom: 1px solid var(--rule); padding: 28px 0 22px; }
.page-head.colored { color: #fff; border: 0; }
.page-head.colored .crumbs, .page-head.colored .crumbs a, .page-head.colored .lede { color: rgba(255,255,255,.88); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: #33333b; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover { background: var(--wash); }
.btn.small { padding: 7px 12px; font-size: .88rem; }
label.field { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 12px; }
label.field select, label.field input { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1.5px solid #c9c9c3; border-radius: 8px; font: inherit; font-weight: 400; background: #fff; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > * { flex: 1; }

/* Line bullets */
.bullet { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 11px; color: #fff; font-weight: 700; font-size: .74rem; letter-spacing: .02em; border: 1.5px solid rgba(0,0,0,.15); }
.bullet.yellow, .bullet.gold { color: var(--ink); }
.bullet.lg { min-width: 44px; height: 32px; border-radius: 16px; font-size: 1rem; }
.red { --c: var(--red); } .orange { --c: var(--orange); } .blue { --c: var(--blue); } .green { --c: var(--green); }
.yellow { --c: var(--yellow); } .cyan { --c: var(--cyan); } .indigo { --c: var(--indigo); } .silver { --c: var(--silver); }
.rail { --c: var(--rail); } .ferry { --c: var(--ferry); }
.bullet { background: var(--c, var(--ink)); }

/* Status list */
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.status-list li:last-child { border-bottom: 0; }
.status-list a.name { font-weight: 700; color: var(--ink); text-decoration: none; }
.status-list a.name:hover { text-decoration: underline; }
.status-list .state { margin-left: auto; font-size: .88rem; font-weight: 700; display: flex; align-items: center; gap: 6px; text-align: right; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

/* Hero */
.hero { background: linear-gradient(180deg, #fff 0%, var(--paper) 100%); border-bottom: 1px solid var(--rule); }
.hero .wrap { padding-top: 34px; padding-bottom: 34px; }
.hero h1 { margin-bottom: 6px; }

/* Map cards */
.map-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.map-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.1); transform: translateY(-2px); }
.map-card .thumb { aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--rule); }
.map-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.map-card .body { padding: 14px 16px 16px; }
.map-card .body b { display: block; margin-bottom: 2px; }
.map-card .body span { font-size: .88rem; color: var(--muted); }

/* News */
.news { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.news .date { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.news b { font-size: 1.05rem; }
.news:hover b { text-decoration: underline; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 8px 10px; }
table.data td { border-bottom: 1px solid var(--rule); padding: 9px 10px; font-variant-numeric: tabular-nums; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr:hover td { background: var(--wash); }
.table-scroll { overflow-x: auto; }

/* Stat tiles */
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.stat .k { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 2px; letter-spacing: -.02em; }
.stat .d { font-size: .85rem; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* Bars */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: .9rem; }
.bar .track { height: 14px; background: var(--wash); border-radius: 7px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--c, var(--ink)); border-radius: 7px; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.bar a { color: var(--ink); text-decoration: none; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar a:hover { text-decoration: underline; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif; fill: var(--muted); }

/* Departures board */
.board { background: #101014; color: #f4f4f0; border-radius: var(--radius); padding: 6px 18px 12px; font-variant-numeric: tabular-nums; }
.board .dir { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #2a2a31; }
.board .dir:last-child { border-bottom: 0; }
.board .to { font-weight: 700; font-size: 1.02rem; }
.board .to small { display: block; font-weight: 400; color: #a5a5ad; font-size: .8rem; }
.board .mins { display: flex; gap: 14px; font-weight: 700; font-size: 1.05rem; }
.board .mins span:first-child { color: var(--gold); }
.board .mins em { font-style: normal; font-weight: 400; font-size: .78rem; color: #a5a5ad; margin-left: 2px; }
.board .head { display: flex; justify-content: space-between; color: #a5a5ad; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 10px 0 4px; border-bottom: 1px solid #2a2a31; }

/* Stop list (line diagram) */
.strip-map { list-style: none; margin: 0; padding: 0; position: relative; }
.strip-map li { position: relative; padding: 0 0 0 40px; min-height: 42px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.strip-map li::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 8px; background: var(--c); }
.strip-map li:first-child::before { top: 50%; }
.strip-map li:last-child::before { bottom: 50%; }
.strip-map li::after { content: ""; position: absolute; left: 9px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.strip-map li.end::after { width: 18px; height: 18px; left: 7px; margin-top: -9px; border: 4px solid var(--c); }
.strip-map li a.stop { color: var(--ink); font-weight: 700; text-decoration: none; }
.strip-map li a.stop:hover { text-decoration: underline; }
.strip-map li.end a.stop { text-transform: uppercase; }
.strip-map .branch-head { padding-left: 0; min-height: 0; margin: 14px 0 4px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.strip-map .branch-head::before, .strip-map .branch-head::after { display: none; }

/* Interactive map */
.map-shell { display: grid; grid-template-columns: 1fr 340px; height: calc(100vh - 116px); min-height: 560px; }
#map { background: #fcfcfa; }
.map-side { border-left: 1px solid var(--rule); background: var(--card); overflow-y: auto; padding: 18px; }
.leaflet-container { font-family: inherit; }
.stop-hit { background: transparent; border: 0; }
.stop-hit div { width: 100%; height: 100%; border-radius: 50%; transition: box-shadow .12s; }
.stop-hit:hover div, .stop-hit.on div { box-shadow: 0 0 0 4px rgba(0,169,201,.9); }
.leaflet-tooltip.stop-tip { font-weight: 700; font-size: .85rem; border-radius: 6px; border: 1px solid var(--ink); box-shadow: none; }
.layer-toggles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.layer-toggles label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; border: 1px solid var(--rule); border-radius: 999px; padding: 4px 10px 4px 6px; cursor: pointer; }

/* Footer */
.foot { background: var(--ink); color: #c9c9cf; margin-top: 40px; font-size: .9rem; }
.foot .wrap { padding-top: 36px; padding-bottom: 28px; }
.foot .cols { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 24px; }
.foot h4 { color: #fff; margin: 0 0 10px; font-size: .92rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 0 0 7px; }
.foot a { color: #c9c9cf; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot .fine { border-top: 1px solid #33333a; margin-top: 26px; padding-top: 16px; font-size: .8rem; color: #8e8e97; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot .logo-chip { background: #fff; border-radius: 10px; padding: 10px; display: inline-block; margin-bottom: 12px; }
.foot .logo-chip img { height: 64px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10,10,14,.92); z-index: 100; display: none; }
.lightbox.open { display: block; }
.lightbox .bar-top { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 16px; color: #fff; z-index: 2; }
.lightbox .bar-top .btn { background: #fff; color: var(--ink); }
.lightbox .stage { position: absolute; inset: 60px 0 0; overflow: auto; display: grid; place-items: center; cursor: zoom-in; }
.lightbox .stage.zoomed { place-items: start; cursor: zoom-out; }
.lightbox .stage img { max-width: 96vw; max-height: calc(100vh - 80px); background: #fff; }
.lightbox .stage.zoomed img { max-width: none; max-height: none; width: 2400px; }

.pill-note { display: inline-flex; gap: 6px; align-items: center; background: var(--wash); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .93rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--wash); }
.tag.ok { background: #e2f3e6; color: var(--ok); } .tag.warn { background: #fff0dc; color: var(--warn); } .tag.bad { background: #fde4e4; color: var(--bad); }
.alert-item { border-left: 5px solid var(--c, var(--ink)); padding: 14px 16px; background: var(--card); border-radius: 0 var(--radius) var(--radius) 0; border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.alert-item + .alert-item { margin-top: 12px; }
.alert-item h3 { margin: 6px 0 4px; font-size: 1.02rem; }
.alert-item p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 1em; }
.trip-result { margin-top: 18px; }
.leg { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.leg .legline { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.leg .legline i { width: 6px; flex: 1; background: var(--c); border-radius: 3px; min-height: 20px; }
.leg b { display: block; }
.walk { color: var(--muted); font-size: .88rem; padding: 6px 0 6px 64px; border-top: 1px dashed var(--rule); }

@media (max-width: 980px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: repeat(2, 1fr); }
  .foot .cols { grid-template-columns: 1fr 1fr; }
  .search input { width: 160px; }
  .map-shell { grid-template-columns: 1fr; grid-template-rows: 62vh auto; height: auto; }
  .map-side { border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 1100px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--rule); }
  .nav.open { display: flex; }
  .nav .search input { width: 100%; }
  .brand img { height: 48px; }
  .brand .word span { display: none; }
  .bar { grid-template-columns: 110px 1fr 60px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .grid.four { grid-template-columns: 1fr; }
  .foot .cols { grid-template-columns: 1fr; }
  .utility .wrap { justify-content: space-between; }
  .utility .hide-sm { display: none; }
}
