/* Network map page (public coverage view). Page rules only; the map widget's own rules
 * live in vendor/slippymap.css, and the status colours come from app.css tokens. */

.net {
  display: flex;
  flex-direction: column;
  gap: var(--a-s-3);
}

.net-intro {
  margin: 0;
  color: var(--a-text-2);
}

.net-title { margin: 0; }

/* Wide screens: the map and the station panel side by side. The DOM order is map first,
 * so a phone gets the map on top and the list under it with no reordering. */
.net-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--a-s-4);
  align-items: start;
}
.net-stage {
  display: flex;
  flex-direction: column;
  gap: var(--a-s-3);
  min-width: 0;
}

.net-map {
  height: clamp(320px, 60vh, 640px);
  border: 1px solid var(--a-border);
  border-radius: var(--a-r-2);
}

/* Says on the map itself that the stations are the example fleet. */
.net-example {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 4;
  margin: 0;
  padding: 2px 10px;
  border-radius: var(--a-r-pill);
  background: var(--a-header);
  color: var(--a-header-text);
  font-size: var(--a-fs-12);
  font-weight: 600;
}

.net-noscript {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: var(--a-s-2) var(--a-s-3);
  background: var(--a-raised);
  border: 1px solid var(--a-border-strong);
  border-radius: var(--a-r-1);
  z-index: 5;
}

/* The empty state: a designed card, not a blank canvas. */
.net-empty {
  background: var(--a-panel);
  border: 1px solid var(--a-border);
  border-radius: var(--a-r-2);
}

/* The side panel: counts, search, the state filter, then the list. */
.net-panel {
  display: flex;
  flex-direction: column;
  gap: var(--a-s-3);
  padding: var(--a-s-4);
  background: var(--a-panel);
  border: 1px solid var(--a-border);
  border-radius: var(--a-r-2);
  min-width: 0;
}
.net-count { margin: 0; font-size: var(--a-fs-16); font-weight: 600; }
.net-updated { margin: calc(var(--a-s-2) * -1) 0 0; font-size: var(--a-fs-12); color: var(--a-text-3); }
.net-tools { display: flex; flex-direction: column; gap: var(--a-s-3); }
.net-tools[hidden], .net-list li[hidden], .net-panel [hidden] { display: none; }
.net-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 420px;
  overflow-y: auto;
  border-top: 1px solid var(--a-border);
}
.net-list li {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--a-border);
}
.net-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--a-s-2);
  min-height: 36px;
  padding: 0 var(--a-s-2);
  border: 0;
  background: none;
  color: var(--a-text);
  font: inherit;
  text-align: left;
}
button.net-item { cursor: pointer; }
button.net-item:hover { background: var(--a-selected); }
button.net-item:focus-visible { outline: 2px solid var(--a-accent); outline-offset: -2px; }
.net-list li[data-selected="true"] { background: var(--a-selected); }
.net-code { font-family: var(--a-font-mono); font-size: var(--a-fs-13); font-weight: 600; }
.net-status { margin-left: auto; font-size: var(--a-fs-12); color: var(--a-text-2); }
.net-open {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--a-s-2);
  font-size: var(--a-fs-13);
}
.net-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Legend: the three shared status buckets (core::status -> data-bucket). */
.net-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--a-s-1) var(--a-s-4);
  font-size: var(--a-fs-12);
  color: var(--a-text-2);
}
.net-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.net-legend .status-ic { width: 14px; height: 14px; }

/* The kinds legend: the shapes the markers use, in a neutral ink (colour is the status). */
.net-legend-kinds { margin-top: calc(var(--a-s-1) * -1); }
.net-key {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: 1px solid var(--a-border-strong); background: var(--a-raised); color: var(--a-text-2);
}
.net-key-antenna { border-radius: 50% 50% 50% 4px; }
.net-key-tower { border-radius: 6px; }
.net-key-hollow { border-radius: 50%; border-style: dashed; border-width: 2px; }
.net-key .icon { width: 14px; height: 14px; }
.net-kind { font-size: var(--a-fs-12); color: var(--a-text-3); }
.net-place { order: 3; flex-basis: 100%; padding: 0 var(--a-s-2) var(--a-s-1); font-size: var(--a-fs-12); color: var(--a-text-2); }
.net-list li { flex-wrap: wrap; }

/* The nearest-station card, under the legend. */
.net-nearest { display: flex; flex-direction: column; gap: var(--a-s-2); align-items: flex-start; }
.net-nearest[hidden] { display: none; }
.net-nearest-hint { margin: 0; font-size: var(--a-fs-13); color: var(--a-text-2); }
.net-nearest-card { align-self: stretch; }
.net-nearest-card:empty { display: none; }
.net-card {
  display: flex; flex-direction: column; gap: var(--a-s-2); padding: var(--a-s-3) var(--a-s-4);
  background: var(--a-panel); border: 1px solid var(--a-border); border-radius: var(--a-r-2);
}
.net-card p { margin: 0; }
.net-card-line { font-weight: 600; }
.net-card-sub { font-size: var(--a-fs-13); color: var(--a-text-2); }
.net-card-out { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: var(--a-fs-13); }
.net-card-out li { color: var(--a-text-2); }
.net-card-out b { color: var(--a-text); font-family: var(--a-font-mono); font-weight: 600; }
.net-card-head { font-size: var(--a-fs-12); color: var(--a-text-2); text-transform: none; }
@media (pointer: coarse) { .net-nearest .btn { min-height: 44px; } }

/* Marker colours: the same data-bucket -> status custom property rules as the icons.
 * The marker element carries the status class from /network/stations.json. The marker
 * SURFACE is the theme's raised surface (slippymap.css), so each colourway pairs its own
 * status colours with a surface they were chosen against: dark chips on Desert and Nordic,
 * white on Light and Paper. Every pairing clears 3:1 non-text contrast. */
.slippy-marker.status-green { color: var(--a-ok); }
.slippy-marker.status-yellow { color: var(--a-warn); }
.slippy-marker.status-red { color: var(--a-bad); }
.slippy-marker.slippy-pin { color: var(--a-text); }

/* A position held back for low quality is the same shape drawn as a dashed outline, so the
 * marker does not claim a place. The surface stays opaque
 * so the glyph keeps the contrast the status colours were chosen for. */
.slippy-marker.net-hollow { border: 2px dashed currentColor; }
/* Two stations can sit within a marker's width. The one you focus, hover or open comes to the
 * front so it can be seen and pointed at. */
.slippy-marker:hover,
.slippy-marker:focus-visible,
.slippy-marker.is-open { z-index: 2; }
.slippy-popup .net-pop-flag { font-weight: 600; }
.net-flag { color: var(--a-text); font-weight: 600; }
.net-legend li[data-bucket="green"] .status-ic { color: var(--a-ok); }
.net-legend li[data-bucket="yellow"] .status-ic { color: var(--a-warn); }
.net-legend li[data-bucket="red"] .status-ic { color: var(--a-bad); }

/* ---------------------------------------------------------------- public shell
 * The bare signed-out layout: one top bar, no sidebar. Only the pages served by
 * network/public.html carry body.pub. */

body.pub {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--a-bg);
  color: var(--a-text);
}

.pub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-s-4);
  min-height: var(--a-topbar-h);
  padding: 0 var(--a-s-5);
  background: var(--a-header);
  color: var(--a-header-text);
  border-bottom: 1px solid var(--a-border);
}
/* Brand and links inherit the header ink; the avatar-less bar needs no extra rules. */
.pub-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--a-s-2);
  color: var(--a-header-text);
  text-decoration: none;
  font-size: var(--a-fs-16);
  font-weight: 600;
}
.pub-mark { width: 24px; height: 24px; border-radius: 6px; }
.pub-nav {
  display: flex;
  align-items: center;
  gap: var(--a-s-4);
}
.pub-link {
  color: var(--a-header-text);
  text-decoration: none;
  font-size: var(--a-fs-13);
  font-weight: 500;
}
.pub-link:hover { text-decoration: underline; }
.pub-link[aria-current="page"] { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.pub-content {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: var(--a-s-6) var(--a-s-5) var(--a-s-8);
}
.pub-hint {
  margin: 0;
  padding: var(--a-s-2) var(--a-s-5) var(--a-s-4);
}

/* Phone and narrow tablet: the list goes under the map, the map is capped at 60vh, and the
 * map controls stay finger-sized (slippymap.css grows them on coarse pointers). */
@media (max-width: 899px) {
  .net-body { grid-template-columns: minmax(0, 1fr); }
  .net-map { height: min(60vh, 520px); min-height: 280px; }
  .net-list { max-height: none; }
}

@media (max-width: 479px) {
  .pub-content { padding: var(--a-s-4); }
  .pub-bar { padding: 0 var(--a-s-4); }
  .pub-hint { padding: var(--a-s-2) var(--a-s-4) var(--a-s-4); }
}

/* The thin leg from a station's true point to its fanned-out marker. */
.slippy-segment.net-leg { stroke: #252a2e; stroke-width: 1; stroke-opacity: .45; }

/* Whether the map is current: the words and tones of the shell's live indicator. */
.net-live { margin: calc(var(--a-s-2) * -1) 0 0; font-size: var(--a-fs-12); color: var(--a-text-2); display: flex; align-items: center; gap: 6px; }

.net-legend { display: flex; flex-direction: column; gap: 8px; }
.net-legend-list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; gap: 4px 16px; }
