/* Keuvel -- pages: the per-route layouts. Everything here belongs to one
   surface; anything two surfaces share lives in components.css. */

/* --- landing (/) -------------------------------------------------- */
/* Sign-in, sign-up and the signed-out landing each ask for one thing;
   the card bounds that ask to a surface instead of letting two short
   fields stretch the full container width. */
.auth-card {
  /* Tighter than the page default: the card's rows belong together. */
  --stack-space: var(--space-s);
  max-width: 24rem;
  margin-inline: auto;
  padding: var(--space-m);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.auth-card h1 { font-size: 1.25rem; }
/* The card's alternative action is a control, not a sentence, so it
   matches the submit button's width; `.secondary` keeps the primary
   action the only filled button on the screen. */
.auth-card .button { width: 100%; }

/* A claimed radio is the way into its presets, so the whole row is the
   tap target: full column width, and 44px tall for a thumb. */
.radio-list { display: flex; flex-direction: column; gap: var(--space-2xs); }
.radio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  min-height: 44px;
  padding: var(--space-2xs) var(--space-xs);
  /* The border is what says "row", so it carries WCAG 1.4.11's 3:1 via
     --text-muted rather than the hairline --border-subtle. */
  border: 1px solid var(--text-muted);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
}
.radio-row:hover { background: var(--bg-surface); color: var(--text); text-decoration: none; }
.radio-row .radio-row-action { font-weight: 400; font-size: var(--font-sm); color: var(--accent); }

/* --- configure (/configure) --------------------------------------- */
/* Search row: query input and country select side by side. */
.radio-search-row { display: flex; gap: var(--space-2xs); align-items: start; }
.radio-search-row input[type="search"] { flex: 1; margin-bottom: 0; }
.radio-search-row select { width: auto; min-width: 140px; max-width: 200px; margin-bottom: 0; }

/* Preset rows. Built by the page's own script, so these class names have
   no counterpart in the templates. */
.preset-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) 0;
  border-bottom: 1px solid var(--border-subtle);
}
/* The slot number is the row's index on the physical unit, so it reads
   as a number stamped on the enclosure: tabular, brass, wide enough for
   two digits. */
.preset-slot {
  min-width: 2rem;
  font-size: var(--font-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--accent);
}
.preset-icon { width: 32px; height: 32px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; }
/* flex-basis 0 + min-width lets the title take the leftover row width
   and wrap naturally instead of collapsing to one word per line. */
.preset-title { flex: 1 1 0; min-width: 6rem; }
.preset-quality { flex-shrink: 0; width: auto; min-width: 0; max-width: 9rem; font-size: var(--font-sm); }
.preset-remove { flex-shrink: 0; padding: var(--space-3xs) var(--space-2xs); }

/* Inline forms: add radio, add country, override a station field. */
.add-form, .override-form, .filter-form { display: flex; gap: var(--space-2xs); align-items: flex-start; }
.add-form input, .add-form select, .override-form input, .filter-form select { flex: 1; }
.filter-form { margin-bottom: var(--space-s); }
.save-btn, .actions { margin-top: var(--space-s); }

/* --- admin station detail ----------------------------------------- */
.metadata-table td:first-child { font-weight: 600; white-space: nowrap; width: 1%; }
.metadata-table td:last-child { word-break: break-all; }
.streams-table td { vertical-align: middle; }
.streams-table tr.stream-active { background: var(--bg-surface); }

.dup-item {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-3xs) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.dup-primary { font-weight: 600; }

/* A URL in a table cell: one line, ellipsised, so a long stream URL
   cannot widen the table past the viewport. */
.fixed-link, .tags-cell {
  display: inline-block;
  max-width: min(360px, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.tags-cell { cursor: default; }

/* Stream preview player: transport button, volume, loudness meter. */
.stream-player { margin-block: var(--space-xs); }
.stream-player-controls { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; }
.stream-player-controls button {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: var(--font-lg);
  flex-shrink: 0;
}
.stream-volume { width: 6rem; flex-shrink: 0; }
.stream-loudness {
  width: 8rem;
  height: 0.75rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.stream-loudness-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.05s linear; }
#stream-fallback { margin-block-start: var(--space-2xs); }
