/* Styles shared by the oceanic tracks pages */

/* Controls: map type and view buttons on one row; day slider on the next */
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; margin: 0.6rem 0 0.4rem; }
.map-controls + .map-controls { margin-top: 0; }
.map-controls form { width: auto; margin: 0 !important; }
.map-controls button { padding: 0.25em 0.6em; font-size: 13px; background: var(--theme-background); }
.map-controls .view-buttons { display: flex; gap: 0.35rem; }
/* Day slider: range only, no number box (the date is shown as a heading) */
.day-slider { flex: 1 1 12rem; }
.day-slider input[type="number"] { display: none; }
.day-slider input[type="range"] { width: 100%; max-width: none; }

/* November page: the selected date */
.day-label { margin-top: 0.4rem; font-weight: 600; }

/* Legend: one short line per system */
/* Legend: a grid of system | westbound | eastbound, so the columns line up */
.legend { display: grid; grid-template-columns: repeat(3, max-content); gap: 0 1rem; margin: 0.4rem 0; font-size: 13px; line-height: 1.6; }
.legend-line { display: contents; }
.legend-line > span { white-space: nowrap; }
.legend-line svg { vertical-align: middle; }
.legend-line .unavailable { color: var(--theme-foreground-faint); }

/* Map: square, sized from its own width (not vw, which includes page margins
   and, inside an auto-resizing iframe, would keep growing the page) */
#container { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 600px; margin: 0.5rem 0; border-radius: 8px; overflow: hidden; background: #000; }

/* Touch screens: the map ignores swipes (so the page scrolls) until tapped */
#container.locked, #container.locked * { touch-action: pan-y !important; }
.map-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 10px; border-radius: 12px; background: rgba(22, 26, 38, 0.75); color: #fff; font: 12px var(--sans-serif); pointer-events: none; }
#container:not(.locked) .map-hint { display: none; }

/* Track and FIR labels are HTML laid over the map canvas */
.label-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.label-overlay span { position: absolute; left: 0; top: 0; white-space: nowrap; }
.track-label { font: 700 11px var(--sans-serif); text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.fir-label { font: 9px var(--monospace); color: rgba(0, 0, 0, 0.45); }

/* Notes under the map, in the same small type as the source line */
details { margin-top: 1rem; font-size: 14px; }

/* Phones: the map runs edge to edge; the text around it keeps a small inset */
@media (max-width: 500px) {
  #observablehq-center { margin-left: 0; margin-right: 0; }
  #observablehq-main > :not(#container), #observablehq-footer { padding-left: 10px; padding-right: 10px; }
  #container { border-radius: 0; }
  /* Legend: eastbound on its own line, under westbound */
  .legend { grid-template-columns: max-content max-content; }
  .legend .Eastbound { grid-column: 2; }
}

/* Hover over, click or tap the system abbreviations in the legend for their
   full names (tabindex makes a tap focus them) */
.legend abbr { position: relative; text-decoration: underline dotted; cursor: help; outline: none; }
.legend abbr:hover::after, .legend abbr:focus::after {
  content: attr(data-full); position: absolute; left: 0; top: 100%; margin-top: 4px; z-index: 100;
  padding: 3px 8px; border-radius: 4px; background: var(--color-exo-black); color: #fff;
  font-size: 12px; font-weight: 400; white-space: nowrap; pointer-events: none;
}
