/* Text contrast for Bootstrap's colour utilities (QA-050, QA-057).
   Loaded by both page shells (base.html and app_shell.html).

   Light mode: the app background is #f8f9fa, where Bootstrap's primary,
   success, danger and secondary text are 4.26-4.49:1. These are the same hues
   one shade darker (Bootstrap's own 20 % shades), 5:1 or better. */
:root:not([data-bs-theme="dark"]) .text-primary { color: #0a58ca !important; }
:root:not([data-bs-theme="dark"]) .text-success { color: #146c43 !important; }
:root:not([data-bs-theme="dark"]) .text-danger { color: #b02a37 !important; }
:root:not([data-bs-theme="dark"]) .text-secondary { color: #565e64 !important; }
:root:not([data-bs-theme="dark"]) .btn-outline-primary { --bs-btn-color: #0a58ca; --bs-btn-border-color: #0a58ca; }
:root:not([data-bs-theme="dark"]) .btn-outline-secondary { --bs-btn-color: #565e64; --bs-btn-border-color: #6c757d; }
:root:not([data-bs-theme="dark"]) .nav-link.text-danger { color: #b02a37 !important; }
/* Links, .btn-link and nav links read --bs-link-color (#0d6efd, 4.26:1 on #f8f9fa);
   inline code is #d63384 (4.34:1). */
:root:not([data-bs-theme="dark"]) {
    --bs-link-color: #0a58ca;
    --bs-link-color-rgb: 10, 88, 202;
    --bs-code-color: #b02a6b;
}
/* Yellow outline text is 1.6:1 on white; keep the yellow border, darken the text. */
:root:not([data-bs-theme="dark"]) .btn-outline-warning { --bs-btn-color: #7a5600; }

/* Dark mode: Bootstrap 5.3 keeps .text-primary, .text-success, outline buttons and
   .link-secondary at their light-mode colours in dark mode, which is about
   3:1 on the dark cards. These are Bootstrap's own dark "emphasis" colours,
   4.5:1 or better on #1e293b and #212529. Fills (.bg-*, .text-bg-*, .btn-*)
   are untouched. */
[data-bs-theme="dark"] .text-primary { color: #6ea8fe !important; }
[data-bs-theme="dark"] .text-success { color: #75b798 !important; }
[data-bs-theme="dark"] .text-danger { color: #ea868f !important; }
[data-bs-theme="dark"] .text-info { color: #6edff6 !important; }
[data-bs-theme="dark"] .text-warning { color: #ffda6a !important; }
[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .link-secondary { color: #adb5bd !important; }

[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #6ea8fe;
    --bs-btn-border-color: #6ea8fe;
    --bs-btn-hover-color: #0f172a;
    --bs-btn-hover-bg: #6ea8fe;
    --bs-btn-hover-border-color: #6ea8fe;
    --bs-btn-active-color: #0f172a;
    --bs-btn-active-bg: #9ec5fe;
    --bs-btn-active-border-color: #9ec5fe;
}
[data-bs-theme="dark"] .btn-outline-dark,
[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #cbd5e1;
    --bs-btn-border-color: #64748b;
    --bs-btn-hover-color: #0f172a;
    --bs-btn-hover-bg: #cbd5e1;
    --bs-btn-hover-border-color: #cbd5e1;
    --bs-btn-active-color: #0f172a;
    --bs-btn-active-bg: #e2e8f0;
    --bs-btn-active-border-color: #e2e8f0;
}
