/* NYC Subway page only. Shared look lives in ../assets/explainers.css. */

/* interactive drawings: same frame as .fig, but not the tap-to-zoom viewer */
.sfig { border: 2px solid #000; background: #fff; padding: 10px; margin: 14px 0; max-width: 560px; }
.sfig svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.say { font-size: 16px; line-height: 1.4; min-height: 2.8em; margin: 8px 0; }

/* picker buttons above a drawing */
.pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.pick .b95 { flex: 1 1 auto; min-height: 44px; }

/* route keys: beveled square tiles, not MTA artwork */
.routegrid { margin: 8px 0 12px; max-width: 560px; }
.rgroup > b { display: block; margin: 8px 0 4px; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.routegrid .rt { min-height: 52px; padding: 4px; }
.routegrid .rt.mate:not(.on) { background: #fff7c0; }
.bul { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; border: 1px solid #000; box-shadow: inset 2px 2px 0 rgba(255,255,255,.55), inset -2px -2px 0 rgba(0,0,0,.25); font: bold 20px/1 Arial, Helvetica, sans-serif; flex: none; }
.bul.sm { width: 24px; height: 24px; font-size: 14px; vertical-align: middle; border-radius: 4px; }
.stripe { height: 14px; border: 2px solid #000; }
.rlist { list-style: none; padding: 0; margin: 6px 0; }
.rlist li { margin: 6px 0; }

/* numbered tap drawings (station, hidden systems, station art) */
.sfig svg .hot { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .12s; }
.sfig svg .hot .ring { stroke: transparent; stroke-width: 4; }
.sfig svg .hot.on .ring { stroke: #c00; }
.sfig svg .hot.on circle:not(.ring):not(.hit) { fill: #ff5; }
.sfig svg .hot.pressed { transform: scale(.82); }
.sfig svg .hot:focus { outline: none; }
.sfig svg .hot:focus-visible .ring { stroke: #00f; }
.sfig svg [data-feature].lit { filter: drop-shadow(0 0 3px #f0f) drop-shadow(0 0 1px #f0f); }
#hidout, #artout, #rideout, #buildout { max-width: 560px; }

/* step bars under drawings */
.ridebar, #buildbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; max-width: 560px; }
.ridebar .b95, #buildbar .b95 { flex: 1 1 96px; min-height: 44px; }
.ridebar .nextbtn, #buildbar .nextbtn { flex-basis: 100%; }

/* station cut-away hotspots */
#cutaway .hot { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .12s; }
#cutaway .hot .ring { stroke: transparent; stroke-width: 4; }
#cutaway .hot.on .ring { stroke: #c00; }
#cutaway .hot.pressed { transform: scale(.82); }
#cutaway .hot:focus { outline: none; }
#cutaway .hot:focus-visible .ring { stroke: #00f; }
.spotbtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 8px 0; max-width: 560px; }
.spotbtns .b95 { justify-content: flex-start; min-height: 44px; }
#spotout, #trunkout, #carout, #keyout { max-width: 560px; }
#spotout:empty, #keyout:empty { display: none; }

/* car numbers */
.carnums { display: flex; flex-wrap: wrap; gap: 10px; }
.carnums > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.carnums small { font-size: 13px; }

/* map key */
.keyrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.keyrow .b95 { flex: 1 1 140px; justify-content: flex-start; min-height: 44px; }
#mapsvg .mst { transform-box: fill-box; transform-origin: center; }
#mapsvg[data-hl="all"] .k-all, #mapsvg[data-hl="loc"] .k-loc, #mapsvg[data-hl="acc"] .k-acc, #mapsvg[data-hl="xfer"] .k-xfer { animation: mapblink 1s steps(2) 3; }
@keyframes mapblink { 50% { opacity: .15; } }

/* power: the chosen current glows */
#powersvg .wire { stroke: #888; }
#powersvg[data-cur="ac"] .wire.ac, #powersvg[data-cur="dc"] .wire.dc { stroke: #e90; stroke-dasharray: 8 5; animation: flow .6s linear infinite; }
#powersvg[data-cur="ac"] .load.dc, #powersvg[data-cur="dc"] .load.ac { opacity: .3; }
@keyframes flow { to { stroke-dashoffset: -13; } }

/* day and night list */
.dnlist { max-width: 560px; border: 2px solid #000; background: #fff; }
.dnlist .dnsky { display: block; width: 100%; height: auto; }
.dnrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid #ccc; }
.dnrow.off span:not(.bul):not(.cite) { color: #888; }
.dnrow.off .bul { opacity: .35; }

/* end-of-level checks */
.check { max-width: 560px; }
.check .ck { border: 2px solid #000; background: #fff; padding: 10px 12px; margin: 10px 0; box-shadow: 3px 3px 0 #000; }
.check .opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.check .opt { flex: 1 1 140px; min-height: 44px; }
.check .opt.right { background: #bfe9c4; }
.check .opt.wrong { background: #f6c0c0; }
.check .why { margin-top: 8px; }

/* hour slider */
.hourrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: bold; }
.hourrow input { flex: 1; min-width: 0; min-height: 44px; }

/* depth gauge controls */
#depth + .row { margin-top: 8px; }

/* long cite labels wrap inside tool output */
.say .cite, #trunkout .cite, #spotout .cite, #carout .cite, #keyout .cite, #hidout .cite, #artout .cite, #rideout .cite, #buildout .cite, .dnrow .cite, .check .cite { white-space: normal; }

/* the shared sheet colors svg text without a fill; keep the fills drawn here */
svg text[fill="#fff"] { fill: #fff; }
svg text[fill="#c00"] { fill: #c00; }

@media (prefers-reduced-motion: reduce) {
  .page-sec svg * { animation: none !important; transition: none !important; }
  #powersvg .wire { animation: none !important; }
}

/* captions and results inside a drawing frame */
.sfig .cap { margin: 8px 0 0; }
.sfig .say { margin: 8px 0 0; min-height: 2.8em; }
.sfig > .pick { margin: 8px 0 0; }

/* side-by-side comparison: stays two columns on phones */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 560px; margin: 12px 0; }
.vs .vcol { min-width: 0; border: 2px solid #000; background: #fff; box-shadow: 3px 3px 0 #000; padding: 8px 10px; }
.vs h3 { margin: 0 0 6px; font-size: 16px; }
.vs p { margin: 6px 0; font-size: 14px; line-height: 1.4; }
.vs .cite { white-space: normal; }
.icongrid .ig > b { font-size: 15px; }

/* folded extra detail */
details.more { max-width: 560px; border: 2px solid #000; background: #fff; padding: 0 12px; margin: 14px 0; }
details.more summary { min-height: 44px; display: flex; align-items: center; }
details.more[open] { padding-bottom: 6px; }

@media (max-width: 560px) {
  .factgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fact { flex-direction: column; gap: 4px; padding: 8px; min-width: 0; }
  .fact b { font-size: 18px; }
  .fact span { overflow-wrap: anywhere; }
  .icongrid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 330px) {
  .vs { gap: 6px; }
  .vs .vcol { padding: 6px 7px; }
}
