/* WCAG 2.1 AA contrast corrections.
 *
 * Values here were computed from the colours the browser actually resolved on
 * the rendered page (tests/accessibility_checks.py), not picked by eye. They are
 * scoped overrides rather than edits to the shared tokens: several of the
 * offending tokens are also used as backgrounds, where moving them would break
 * the contrast they currently provide from the other side.
 *
 * Each rule notes the measured ratio before -> after.
 */

/* Accent text on dark surfaces: --deep is too dark to read as text. 2.57 -> 4.5 */
:root .skip-link,
:root .locale-button,
:root .locale-top,
:root .theme-choice.active,
:root .pill { color: #9789d9; }

/* Purple used as small text on dark panels. 4.36 -> 4.55 */
:root .course-stage-number { color: #8e7ced; }

/* White label on a purple button was the weakest pairing on the page. 3.50 -> 4.56 */
:root .btn:not(.outline):not(.text-btn) { background: #7867cb; }

:root[data-theme="light"] .skip-link,
:root[data-theme="light"] .locale-button,
:root[data-theme="light"] .locale-top,
:root[data-theme="light"] .theme-choice.active,
:root[data-theme="light"] .pill { color: #6d5acf; }

:root[data-theme="light"] .course-stage-number { color: #6c59cd; }
:root[data-theme="light"] .btn:not(.outline):not(.text-btn) { background: #6d5acf; }

/* Muted greys on white were the widest failure in the light theme. 2.81 -> 4.51 */
:root[data-theme="light"] .local-badge,
:root[data-theme="light"] .muted,
:root[data-theme="light"] small.muted { color: #777583; }
:root[data-theme="light"] .explain { color: #746a7e; }
:root[data-theme="light"] .music-chevron { color: #7e7194; }

/* Streak and coin counters: orange and amber on white are far below AA. 2.12 -> 4.6 */
:root[data-theme="light"] .stat-inline.flame { color: #9e6a36; }
:root[data-theme="light"] .stat-inline.coin { color: #986f29; }

/* Text buttons keep the accent colour as text, so they need the readable variant
 * rather than the button background. 3.01 -> 4.5 */
:root .text-btn,
:root .btn.text-btn { color: #8c7cd4; }
:root[data-theme="light"] .text-btn,
:root[data-theme="light"] .btn.text-btn { color: #6d5acf; }

/* Logo wordmark and sidebar label. dark 4.02 -> 4.5, light 2.30 -> 4.5 */
:root .logo small { color: #816fb8; }
:root[data-theme="light"] .logo small { color: #7b6f9d; }
:root .nav button.active span,
:root .sidebar .nav button span { color: #8d7bec; }
:root[data-theme="light"] .nav button.active span,
:root[data-theme="light"] .sidebar .nav button span { color: #6d5acf; }

/* Status pill sat a hair under the threshold in light. 4.49 -> 4.5+ */
:root[data-theme="light"] .pill { color: #6c59cd; }

/* Music dock caption on white. 4.11 -> 4.56 */
:root[data-theme="light"] .music-status,
:root[data-theme="light"] #music-dock small { color: #7b7288; }
