/* Show only the icon matching the current theme preference. */
[data-theme-preference="light"] .theme-icon-dark,
[data-theme-preference="light"] .theme-icon-system,
[data-theme-preference="dark"] .theme-icon-light,
[data-theme-preference="dark"] .theme-icon-system,
[data-theme-preference="system"] .theme-icon-light,
[data-theme-preference="system"] .theme-icon-dark {
    display: none;
}

/* ---------------------------------------------------------------------
 * Outdoor-visibility contrast fix (light mode only).
 *
 * Tabler's default light-mode text/border tokens are too washed out to
 * read on a tablet in direct sunlight. Scoped to [data-bs-theme="light"]
 * rather than bare :root, since Tabler redefines these same tokens again
 * under [data-bs-theme=dark] - a bare :root override would win the
 * cascade and leak into dark mode too.
 * ------------------------------------------------------------------- */
[data-bs-theme="light"] {
    /* Body text, and (via `color: var(--tblr-heading-color); --tblr-heading-color: inherit`) all headings. */
    --tblr-body-color: var(--tblr-gray-900); /* was #374151 ~10.3:1 -> #111827 ~17.7:1 */

    /* .text-body-emphasis / list-group hover+active text. */
    --tblr-emphasis-color: var(--tblr-black); /* was #374151 ~10.3:1 -> #000000 21:1 */

    /* .text-body-secondary, .form-text, <caption>, .figure-caption, disabled range-input thumbs. */
    --tblr-secondary-color: var(--tblr-gray-700); /* was rgba(31,41,55,.75) ~6.5:1 -> ~10.3:1 */

    /* .text-body-tertiary, disabled dropdown-item text. */
    --tblr-tertiary-color: var(--tblr-gray-500); /* was rgba(31,41,55,.5) ~3.05:1 -> ~4.83:1 */

    /* Form control / button outlines, card and table dividers. */
    --tblr-border-color: var(--tblr-gray-500); /* was #e5e7eb ~1.24:1 -> ~4.83:1 */
    --tblr-border-color-translucent: var(--tblr-gray-500); /* was rgba(4,32,69,.1) ~1.22:1 -> ~4.83:1 */
}

/* .text-secondary and .text-muted don't consume the tokens above - Tabler defines each of
 * these classes twice with equal specificity, and the later (winning) definition resolves
 * through --tblr-secondary / --tblr-muted instead. Those tokens also drive .btn-secondary,
 * badges, and alerts, so they can't be overridden globally without recoloring those too.
 * Override the classes directly, matching Tabler's own !important. */
[data-bs-theme="light"] .text-secondary {
    color: var(--tblr-gray-700) !important; /* was #6b7280 ~4.83:1 -> ~10.3:1 */
}

[data-bs-theme="light"] .text-muted {
    color: var(--tblr-gray-600) !important; /* was #6b7280 ~4.83:1 -> ~7.56:1 */
}

/* .accordion-body (troubleshooting pages, golfer_group_detail.html) has the same issue:
 * Tabler sets its color straight from the raw --tblr-secondary token instead of
 * inheriting --tblr-body-color, so it didn't pick up the fix above. No !important
 * needed - our selector already outweighs the vendor rule's bare .accordion-body. */
[data-bs-theme="light"] .accordion-body {
    color: var(--tblr-gray-700); /* was #6b7280 ~4.83:1 -> ~10.3:1 */
}

/* Base font-size/weight bump for outdoor tablet legibility. Applies to both themes:
 * Tabler never redefines these two tokens under [data-bs-theme=dark], so this is
 * theme-agnostic by construction. */
:root {
    --tblr-body-font-size: 1rem; /* 16px, up from 14px */
    --tblr-body-font-weight: 450; /* up from 400; Inter Var supports fine weight steps */
}
