/* navigation shell: skip link, rail folds, search entry, the menu sheet with station tiles, the place bar.
   loads after components.css and base.css so it refines their rail and launcher rules */

.skip-link {
  position: fixed; z-index: 200; left: 12px; top: 12px;
  padding: 12px 18px; min-height: 44px; display: inline-flex; align-items: center;
  background: var(--panel-solid, #111); color: var(--ink); text-decoration: none;
  font: 600 13px var(--font-label); letter-spacing: 0.12em; text-transform: uppercase;
  box-shadow: inset 0 0 0 2px var(--chi);
  transform: translateY(-160%);
}
.skip-link:focus-visible { transform: none; }

/* ---------- rail ---------- */
#rail { gap: 10px; }
.rail-find {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  background: var(--well); color: var(--ink-2); border: 0; cursor: pointer; text-align: left;
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 13px var(--font-body);
  transition: color 0.15s, box-shadow 0.15s;
}
.rail-find span { flex: 1; min-width: 0; }
.rail-find kbd { font: 500 10px var(--font-label); letter-spacing: 0.08em; color: var(--ink-3); padding: 3px 6px; box-shadow: inset 0 0 0 1px var(--line-2); }
.rail-find:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--chi); }
.rail .knob-ring { padding: 8px; }
.rail .knob, #rail .knob { width: 64px; height: 64px; }

/* every station folds open to its places. the header is a button, the places are links */
.station { grid-template-columns: 22px minmax(0, 1fr) auto 14px; padding: 0 10px; min-height: 44px; gap: 8px; }
.station-icon { display: grid; place-items: center; color: var(--ink-3); font-style: normal; transition: color 0.15s; }
.station[aria-current="true"] .station-icon, .station:hover .station-icon { color: var(--chi); }
.station em { opacity: 0.75; }
.station-fold { width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); transition: transform 0.2s var(--spring); justify-self: end; }
.station[aria-expanded="true"] .station-fold { transform: rotate(45deg); }
.station-places { padding: 2px 0 8px 22px; margin-left: 10px; border-left: 1px solid var(--line); }
.station-places[hidden] { display: none; }
.key-rail { min-height: 40px; }

/* ---------- place bar over each page (phones) ---------- */
.station-bar {
  scroll-snap-type: x proximity; scroll-padding-inline: 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 28px), transparent 100%);
}
.station-bar .key-bar { scroll-snap-align: center; min-height: 44px; }
.switch-option { min-height: 44px; }

/* ---------- menu sheet ---------- */
.launcher-title { margin: 0; }
#launcher[inert] { visibility: hidden; transition: visibility 0s 0.3s; }
.bank-stations { gap: 10px; }
.station-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.station-tile {
  --cut: 12px;
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "i b e" "s s s";
  align-items: center; column-gap: 8px; row-gap: 2px;
  min-height: 72px; padding: 10px 12px; text-align: left;
  border: 0; background: none; color: var(--ink); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.station-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; clip-path: var(--cut-shape); background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 0.15s; }
.station-tile i { grid-area: i; display: grid; place-items: center; color: var(--chi); font-style: normal; }
.station-tile b { grid-area: b; font: 600 20px/1 var(--font-display); }
.station-tile em { grid-area: e; font: 500 11px var(--font-label); font-style: normal; color: var(--ink-3); }
.station-tile small { grid-area: s; font: 500 11px/1.3 var(--font-body); color: var(--ink-2); }
.station-tile:hover::before { background: var(--chi-dim); }
.station-tile:active { transform: scale(0.98); }
.station-tile[aria-current="true"]::before { background: var(--chi-dim); box-shadow: inset 0 0 0 1px var(--chi); }
.station-tile[aria-current="true"] em { color: var(--chi); }
.station-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .station-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .station-tile:last-child:nth-child(odd) { grid-column: auto; }
}

/* focus rings come from a11y.css, drawn inside the edge so the cut corners don't clip them */
.key:focus-visible, .station-tile:focus-visible { z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .station-fold, .station-tile { transition: none; }
}
html.calm .station-fold, html.calm .station-tile { transition: none; }
