/*
 * css/settings.css · The Long Game — Settings overlay + onboarding component styles
 * Purpose: visual styles for settings.js components that are NOT already in styles.css:
 *   .settings-body, .settings-pace-desc, .settings-about-copy,
 *   .accent-swatch-row, .accent-swatch, .accent-swatch-dot, .accent-swatch-label,
 *   .pace-opts, .pace-opt, .pace-opt-label, .pace-opt-desc,
 *   .onboarding-hint, .onboarding-name-field
 * Note: .overlay, .overlay-header, .overlay-back, .overlay-title, .overlay-body,
 *       .settings-section-title, .data-row, .data-row-*, .theme-opts, .theme-opt,
 *       .surface-card, .surface-card--*, .btn, .form-label, .text-input,
 *       .onboarding-panel, .onboarding-card, .onboarding-*, .action-sheet-*
 *       are all defined in css/styles.css — do NOT re-declare them here.
 * Related: js/settings.js (renders these classes), css/styles.css (base system),
 *          index.html (must link this stylesheet with the current ?v=N)
 */

/* ===== SETTINGS OVERLAY BODY ===== */
/* Slight horizontal padding tightening for the settings rows */
.settings-body {
  padding-top: 8px;
}

/* Nudge pace description copy (above the pace option buttons) */
.settings-pace-desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 var(--space-3);
}

/* About section copy — Newsreader voice for the philosophical note */
.settings-about-copy {
  font-family: var(--serif);
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
}

/* ===== ACCENT SWATCH ROW ===== */
/* Horizontal scrollable row of colour-swatch buttons inside the Appearance card */
.accent-swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 2px;
}

/* Each swatch: a small circular colour dot + a text label */
.accent-swatch {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 8px;
  min-height: var(--tap);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font: 500 0.82rem/1 var(--sans);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

/* When selected: border adopts the swatch colour, label becomes ink */
.accent-swatch[aria-pressed="true"] {
  border-color: var(--swatch-color, var(--accent));
  background: color-mix(in srgb, var(--swatch-color, var(--accent)) 10%, var(--surface-2));
  color: var(--ink);
}

.accent-swatch:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* The filled colour circle */
.accent-swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
}

/* Small text label next to the dot */
.accent-swatch-label {
  white-space: nowrap;
  line-height: 1.2;
}

/* In dark mode, the dot border lightens slightly so it's visible on dark surfaces */
html[data-theme="dark"] .accent-swatch-dot {
  border-color: rgba(255, 255, 255, 0.12);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .accent-swatch-dot {
    border-color: rgba(255, 255, 255, 0.12);
  }
}

/* ===== NUDGE PACE PICKER ===== */
/* Vertical stack of three pace options — each is a radio-like toggle button */
.pace-opts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pace-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 13px 16px;
  min-height: 56px;     /* larger than --tap so the description copy has room */
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

/* Selected state: accent border + label becomes full ink */
.pace-opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  color: var(--ink);
}

.pace-opt[aria-pressed="true"] .pace-opt-label {
  color: var(--accent);
}

.pace-opt:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.pace-opt-label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  transition: color 0.15s;
}

.pace-opt-desc {
  font-size: 0.80rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ===== ONBOARDING — ADDITIONAL STYLES ===== */
/* .onboarding-panel, .onboarding-card, .onboarding-title, .onboarding-body,
   .onboarding-dots, .onboarding-dot, .onboarding-skip, .onboarding-compass
   are already defined in styles.css. Only supplement here. */

/* Subtle type hint shown on panel 2 (the "four kinds" hint) */
.onboarding-hint {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin: -8px 0 var(--space-5);
  text-align: center;
}

/* Name input wrapper on the last onboarding panel — left-aligned text */
.onboarding-name-field {
  text-align: left;
  margin-bottom: var(--space-5);
}

/* ===== GENTLE REMINDERS TOGGLE ===== */
/* A simple pill toggle (role=switch). The toggle button itself has no
   visible text — the adjacent .settings-toggle-label provides the label.
   Color is purely supplementary; shape + aria-checked carry the state. */

.settings-toggle {
  /* Reset button default styles */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  /* Ensure 44px tap target minimum */
  min-width: 44px;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.settings-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* The pill track */
.settings-toggle-track {
  display: flex;
  align-items: center;
  width: 48px;
  height: 28px;
  background: var(--line);
  border-radius: 999px;
  padding: 3px;
  transition: background 0.2s;
  position: relative;
}

/* Checked state: track goes accent-coloured */
.settings-toggle[aria-checked="true"] .settings-toggle-track {
  background: var(--accent);
}

/* The sliding thumb */
.settings-toggle-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* Thumb slides right when checked */
.settings-toggle[aria-checked="true"] .settings-toggle-thumb {
  transform: translateX(20px);
}

/* Label beside the toggle */
.settings-toggle-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
}

/* ===== REDUCED MOTION ===== */
/* styles.css disables all animation/transition globally under reduced-motion;
   the overrides below are included for belt-and-suspenders clarity on the
   swatch and pace-opt transitions specifically. */
@media (prefers-reduced-motion: reduce) {
  .accent-swatch,
  .pace-opt,
  .pace-opt-label,
  .settings-toggle-track,
  .settings-toggle-thumb {
    transition: none;
  }
}
