/* The public pages' navigation (/live and /gallery) - one segmented
   "Live | Gallery | Distances" switch, rendered server-side by
   pybroadcast/templating.py's _page_switch_html() and styled only here, so
   the two pages can't drift apart again. Loaded by both templates next to
   their own stylesheet. See the pybroadcast-frontend skill's "Page
   navigation" section for the pattern.

   Two looks for the same markup:
   - default: themed, for normal document pages (/gallery) - picks up the
     page's own --chip-bg/--chip-fg/--panel-border/--fg tokens;
   - .page-switch-overlay: compact translucent chrome for full-bleed image
     pages (/live), matching #status's pill, with vw-clamped sizes so it
     also scales inside the admin's ~380px /live preview iframe (see the
     frontend skill's clamp() rule). */

.page-switch {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--chip-bg, #1c2531); border: 1px solid var(--panel-border, #263142);
}
.page-switch-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px; font-size: 13px; line-height: 1.2;
  color: var(--chip-fg, #cbd5e1); text-decoration: none; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.page-switch-link:hover, .page-switch-link:focus-visible { color: var(--fg, #fff); }
.page-switch-link[aria-current="page"] { background: #2563eb; color: #fff; }

.page-switch-overlay {
  padding: 2px; box-sizing: border-box; height: var(--chrome-height, auto);
  background: var(--chrome-bg, rgba(0, 0, 0, 0.6)); border-color: var(--chrome-border, rgba(255, 255, 255, 0.1));
}
.page-switch-overlay .page-switch-link {
  gap: clamp(4px, 0.6vw, 6px);
  padding: 0 var(--chrome-pad-x, 12px);
  font-size: var(--chrome-font, 12px); letter-spacing: 0.02em; color: var(--chrome-fg, #ddd);
}
.page-switch-overlay .page-switch-link:hover,
.page-switch-overlay .page-switch-link:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.12); }
.page-switch-overlay .page-switch-link[aria-current="page"] { background: rgba(37, 99, 235, 0.9); color: #fff; }

/* On the Live entry while a broadcast is on - toggled by the page's own
   script (gallery.js polls /live/status, live.js uses /live/state). */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); animation: live-pulse 2s infinite;
}
.page-switch-overlay .live-dot { width: clamp(6px, 0.8vw, 8px); height: clamp(6px, 0.8vw, 8px); }
.live-dot.hide { display: none; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
