/* Jack's Radio — accessible base styles. High contrast, large targets, visible focus. */
:root {
  --bg: #0b0b0c;
  --fg: #f5f5f5;
  --muted: #c9c9cf;
  --accent: #ffd24a;        /* focus ring: yellow on dark, >3:1 against bg and surfaces */
  --surface: #1b1b1f;
  --border: #4a4a52;
  --link: #9ecbff;
  --target: 48px;           /* generous touch/keyboard target */
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --fg: #131316;
    --muted: #3a3a40;
    --accent: #0b5cff;
    --surface: #f1f1f4;
    --border: #5a5a62;
    --link: #0a3fbf;
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  font: 1.125rem/1.55 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

/* Visible focus everywhere: >=2px ring with offset, contrast >3:1 via --accent. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Fallback for engines that focus without :focus-visible support. */
a:focus, button:focus, [tabindex]:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Screen-reader-only utility (live regions, visually hidden labels). */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link: off-screen until focused, then on-screen and obvious.
   Uses negative top so boundingBox().y < 0 before focus (satisfies e2e test). */
.skip-link {
  position: absolute;
  left: 0;
  top: -10rem;
  z-index: 100;
  background: var(--accent);
  color: #000;
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

.app-header { padding: 1rem 1.25rem; border-bottom: 2px solid var(--border); }
h1 { margin: 0; font-size: 1.75rem; }

/* Player region — fixed shell chrome. */
.player {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 1rem 1.25rem;
}
.now-playing { margin: 0 0 0.75rem; color: var(--muted); }
.player-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; }

button {
  min-width: var(--target);
  min-height: var(--target);
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--fg);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

/* Seek slider (role=slider, finite files only). Visible track; hidden via [hidden] attr. */
.player-seek {
  display: flex;
  align-items: center;
  min-width: 8rem;
  min-height: var(--target);
  padding: 0 0.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}
.player-seek:hover { border-color: var(--accent); }
.player-seek[hidden] { display: none; }
button:hover { border-color: var(--accent); }

/* Live badge — text-based, not color-only; visible to AT via DOM text content. */
.live-badge {
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  border: 2px solid currentColor;
}
.live-badge[hidden] { display: none; }

/* Visually-hidden utility (live regions and screen-reader-only content). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

main { padding: 1.25rem; max-width: 60rem; margin: 0 auto; }
section { margin: 0 0 2rem; }
h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.35rem; }

ul[data-list] { list-style: none; margin: 0; padding: 0; }
ul[data-list] > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
ul[data-list] .item-title { font-weight: 700; min-width: 30%; }
ul[data-list] .item-desc { color: var(--muted); flex: 1 1 12rem; }

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

/* Respect reduced motion: no transitions/animations. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Honor forced-colors / Windows High Contrast. */
@media (forced-colors: active) {
  :focus-visible, a:focus, button:focus, [tabindex]:focus { outline: 3px solid Highlight; }
}

.section-instruction { color: var(--muted); margin: 0 0 0.75rem; }

.app-footer { padding: 1rem 1.25rem; border-top: 2px solid var(--border); color: var(--muted); font-size: 0.95rem; }
