/* WCAG 2.2 AA colour (qa/playwright/test_accessibility.py measures it with axe-core).
   Bootstrap 5.3's light link blue (#0d6efd) is 4.26:1 on the app's body-tertiary surface and
   `.link-secondary`/`.text-muted` grey (#6c757d) is 4.44:1; AA needs 4.5:1 for body-size text.
   Variables only, so every link and every library widget that reads them is fixed at once. */
[data-bs-theme="light"], :root:not([data-bs-theme]) {
  --bs-link-color: #0a58ca;
  --bs-link-color-rgb: 10, 88, 202;
  --bs-link-hover-color: #084298;
  --bs-link-hover-color-rgb: 8, 66, 152;
  --bs-secondary-color: rgba(33, 37, 41, 0.8);
}
[data-bs-theme="light"] .link-secondary, [data-bs-theme="light"] .text-muted {
  color: #565e64 !important;
}
[data-bs-theme="light"] .btn-outline-secondary {
  --bs-btn-color: #565e64; --bs-btn-border-color: #565e64;
  --bs-btn-hover-bg: #565e64; --bs-btn-hover-border-color: #565e64;
  --bs-btn-active-bg: #565e64; --bs-btn-active-border-color: #565e64;
}

/* Dark: Bootstrap 5.3 does not lift its outline-button or text-danger colours for a dark
   surface (3.3-3.4:1 on #212529). These are Bootstrap's own `*-text-emphasis` dark tints. */
[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-check:not(:checked) + .btn-outline-primary {
  --bs-btn-color: #6ea8fe; --bs-btn-border-color: #6ea8fe;
  --bs-btn-hover-bg: #6ea8fe; --bs-btn-hover-color: #000; --bs-btn-hover-border-color: #6ea8fe;
  --bs-btn-active-bg: #6ea8fe; --bs-btn-active-color: #000; --bs-btn-active-border-color: #6ea8fe;
}
[data-bs-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #adb5bd; --bs-btn-border-color: #adb5bd;
  --bs-btn-hover-bg: #adb5bd; --bs-btn-hover-color: #000; --bs-btn-hover-border-color: #adb5bd;
  --bs-btn-active-bg: #adb5bd; --bs-btn-active-color: #000; --bs-btn-active-border-color: #adb5bd;
}
[data-bs-theme="dark"] .btn-outline-danger {
  --bs-btn-color: #ea868f; --bs-btn-border-color: #ea868f;
  --bs-btn-hover-bg: #ea868f; --bs-btn-hover-color: #000; --bs-btn-hover-border-color: #ea868f;
  --bs-btn-active-bg: #ea868f; --bs-btn-active-color: #000; --bs-btn-active-border-color: #ea868f;
}
[data-bs-theme="dark"] .text-danger { color: #ea868f !important; }
[data-bs-theme="dark"] .link-secondary, [data-bs-theme="dark"] .text-muted { color: #adb5bd !important; }
[data-bs-theme="dark"] .text-success { color: #75b798 !important; }
[data-bs-theme="dark"] .text-warning { color: #ffda6a !important; }
[data-bs-theme="dark"] .btn-outline-success {
  --bs-btn-color: #75b798; --bs-btn-border-color: #75b798;
  --bs-btn-hover-bg: #75b798; --bs-btn-hover-color: #000; --bs-btn-hover-border-color: #75b798;
}

/* WCAG 2.2 SC 2.5.8 target size: the explorer's look-alike buttons were 23 px tall (p-0). */
.explore-neighbour { min-height: 1.5rem; display: inline-flex; align-items: center; }
[data-bs-theme="light"] code { --bs-code-color: #a61e5f; }

/* WCAG 1.4.10 reflow at 320px. A `.visually-hidden` caption or label inside a scrolling table is
   position:absolute; with no positioned ancestor the scroller does not clip it, so its static
   place in an off-screen column widened the whole page (the classroom join codes, 83px). */
.table-responsive { position: relative; }
