/* ==========================================================================
   Font settings: the player's chosen app font + the picker that sets it.
   font-settings.js sets html[data-font] and --user-font. With no choice
   saved, nothing here changes the app's default Inter / Space Grotesk.
   ========================================================================== */

/* Point the app's own font tokens at the chosen font... */
html[data-font] {
  --font-sans: var(--user-font);
  --font-display: var(--user-font);
}

/* ...and cover the many rules that name 'Space Grotesk' / 'Inter' directly.
   Left alone on purpose:
   - icon ligatures (Material Symbols) - swapping the font breaks the icons
   - code samples - they stay monospace so answers line up
   - the celebration video captions, which use the Bangers display font */
html[data-font] body,
html[data-font] body *:not(.material-symbols-outlined):not(code, pre, kbd, samp, code *, pre *):not(.cv-kicker, .cv-title, .cv-shiny-tag) {
  font-family: var(--user-font) !important;
}

/* ---------- Picker (matches the read-aloud voice picker) ---------- */

.font-settings {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm, 0.5rem);
  color: var(--color-text-primary, #f1f5f9);
}

.font-settings-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm, 0.5rem);
  font-weight: 600;
}

.font-settings-select {
  width: 100%;
  max-width: 24rem;
  min-height: 44px; /* WCAG 2.5.8 target size */
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border, #475569);
  border-radius: 8px;
  background: var(--color-surface, #1e293b);
  color: var(--color-text-primary, #f1f5f9);
  font: inherit;
}

.font-settings-select:focus-visible {
  outline: 3px solid var(--color-link, #22d3ee);
  outline-offset: 2px;
}

.font-settings-sample {
  max-width: 24rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border, #475569);
  border-radius: 8px;
  background: var(--color-surface, #1e293b);
  font-size: 1.05rem;
  line-height: 1.5;
}

.font-settings-help,
.font-settings-status {
  margin: 0;
  color: var(--color-text-secondary, #cbd5e1);
  font-size: 0.9rem;
  line-height: 1.5;
}

.font-settings-status:empty {
  display: none;
}

/* Compact version inside the sidebar account menu */
.font-settings--compact {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.font-settings--compact .font-settings-label {
  font-weight: 500;
}

.font-settings--compact .font-settings-select {
  max-width: none;
}
