/* Accessibility styles shared by every app page (base.html). */

/* "Skip to main content": invisible until a keyboard user tabs to it */
.skip-link:focus {
    position: absolute; top: .5rem; left: .5rem; z-index: 2000;
    padding: .5rem 1rem; background: #fff; color: #02213C; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

/* A focused element should never land under a sticky bar (WCAG 2.4.11) */
html { scroll-padding-top: 4rem; }

/* Links inside alerts use the alert's own dark link color, which has enough contrast on the tinted background */
.alert a:not(.btn) { color: var(--bs-alert-link-color); font-weight: 600; }

/* Scrollable tables are keyboard-focusable regions; show where focus is */
.table-responsive:focus-visible, .results-wrapper:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

/* Chart hit areas: a clear focus ring instead of a faint tint */
svg .hit:focus-visible, svg .col-hit:focus-visible { stroke: #0b0b0b; stroke-width: 2px; outline: none; }

/* Light-tint buttons: outline-danger on a gray row fell just short of 4.5:1 */
.bg-light .btn-outline-danger { --bs-btn-color: #b02a37; --bs-btn-border-color: #b02a37; }

/* Form field boundaries at 3:1 against white (WCAG 1.4.11); Bootstrap's default #ced4da is about 1.5:1 */
.form-control, .form-select { border-color: #8a9299; }
.form-check-input { border-color: #6c757d; }

/* One solid focus ring everywhere (WCAG 2.4.7 / 1.4.11): Bootstrap's translucent glow is under 3:1 on white */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, [contenteditable]:focus-visible, .form-control:focus-visible, .form-select:focus-visible,
.form-check-input:focus-visible, .btn-check:focus-visible + .btn {
    outline: 2px solid #0a58ca; outline-offset: 2px;
}
.navbar-dark :focus-visible, .bg-dark :focus-visible, .bg-primary :focus-visible, .btn-primary:focus-visible,
.btn-success:focus-visible, .btn-danger:focus-visible, .btn-dark:focus-visible { outline-color: #fff; outline-offset: -3px; }

/* A low percent correct (grading/partials/_pct_cell.html): red plus a ▼ marker, so color isn't the only cue */
.pct-low { color: #b42323; font-weight: 600; }

/* Standards mastery levels (partials/_mastery_cell.html): a letter on a tint; the letter carries the meaning */
.lvl { display: inline-block; min-width: 1.4em; padding: 0 .25em; border-radius: 3px; font-size: .75rem; font-weight: 700; text-align: center; }
.lvl-mastered { background: #dcf3e4; color: #0d5c2c; }
.lvl-approaching { background: #fdf0c8; color: #6b4a00; }
.lvl-not-yet { background: #fbe0e0; color: #8f1d1d; }
