/*
 * Tabler -> SIFT palette bridge. Loaded right
 * after static/vendor/tabler/tabler.min.css and before custom.css.
 *
 * Tabler derives every tint, hover, border and "-lt" variant from a handful of
 * base variables with color-mix(), so overriding the bases here keeps SIFT's
 * colours everywhere Tabler draws something. The values are the tokens in
 * base.html's inline :root block (GitHub-dark family). Change a colour there,
 * change it here too.
 *
 * html[data-bs-theme=dark] beats Tabler's own :root / [data-bs-theme=dark]
 * blocks on specificity, and sits on the same element where Tabler's derived
 * variables are computed, so the mixes pick these values up.
 */
html[data-bs-theme=dark] {
    color-scheme: dark;

    /* Accents */
    --tblr-primary: #58a6ff;
    --tblr-blue: #58a6ff;
    --tblr-azure: #79c0ff;
    --tblr-info: #79c0ff;
    --tblr-success: #3fb950;
    --tblr-green: #3fb950;
    --tblr-warning: #d29922;
    --tblr-yellow: #d29922;
    --tblr-danger: #f85149;
    --tblr-red: #f85149;
    --tblr-purple: #a371f7;
    --tblr-secondary: #b8c2cf;
    --tblr-primary-fg: #0d1117;

    /* Surfaces */
    --tblr-dark: #0d1117;
    --tblr-body-bg: #0d1117;
    --tblr-bg-surface: #161b22;
    --tblr-bg-surface-primary: #161b22;
    --tblr-bg-surface-secondary: #0d1117;
    --tblr-bg-surface-tertiary: #1c2129;
    --tblr-bg-surface-dark: #0d1117;
    --tblr-bg-forms: #0d1117;
    --tblr-bg-forms-disabled: #1c2129;
    --tblr-code-bg: #0d1117;

    /* Text */
    --tblr-body-color: #f0f6fc;
    --tblr-emphasis-color: #f0f6fc;
    --tblr-heading-color: #f0f6fc;
    --tblr-secondary-color: #b8c2cf;
    --tblr-tertiary-color: #8b949e;
    --tblr-code-color: #c9d1d9;
    --tblr-link-color: #58a6ff;
    --tblr-link-hover-color: #79c0ff;

    /* Lines */
    --tblr-border-color: #30363d;
    --tblr-border-color-translucent: #30363d;
    --tblr-border-dark-color: #21262d;
    --tblr-border-active-color: #484f58;
    --tblr-dark-mode-border-color: #30363d;
    --tblr-dark-mode-border-color-translucent: #30363d;

    /* Type: keep the vendored Plus Jakarta Sans */
    --tblr-font-sans-serif: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --tblr-body-font-family: var(--tblr-font-sans-serif);

    /* A handful of rules in our own CSS still read Bootstrap's --bs-* names;
       Tabler only defines --tblr-*, so alias them. */
    --bs-primary: #58a6ff;
    --bs-info: #79c0ff;
    --bs-warning: #d29922;
    --bs-dark: #0d1117;
    --bs-border-color: #30363d;
}
