/* ============================================================
 * Accessibility (WCAG 2.1 AA) overrides.
 *
 * This file is enqueued LAST (after the theme stylesheet, Bootstrap and
 * ws-actions.css) so these rules win by load order, with selector specificity
 * where a rule must beat an !important utility. It lives in its own enqueued
 * file because assets/styles/css/styles.css is NOT enqueued by the theme.
 * ============================================================ */

/* 2.4.7 Focus Visible — a visible keyboard focus ring (the theme provides none
 * and removes outlines in several places). Element-level :focus-visible
 * selectors so this beats single-class outline resets. Ring #0b5d4a clears 3:1
 * (1.4.11) on white and on the mint brand. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid #0b5d4a !important;
    outline-offset: 2px !important;
}

/* 1.4.3 Contrast — the worksheet action buttons (Save / Assign / Practice
 * Digitally, etc.) render white text on a mint/teal background (~1.45:1). The
 * teal is set either by a utility class OR an inline background-color, so cover
 * both. Scoped to elements that are BOTH green-bg AND .text-white, so plain
 * green backgrounds and legitimate white-on-dark text are untouched. */
.bg-green.text-white,
.bg-green-light.text-white,
.bg-green-dark.text-white,
[style*="background-color:#29f1c3"].text-white,
[style*="background-color: #29f1c3"].text-white,
[style*="background-color:#27f1c2"].text-white,
[style*="background-color: #27f1c2"].text-white {
    color: #07261f !important;
}

/* 1.4.1 Use of Color — underline links inside prose so they aren't distinguished
 * from body text by color alone. */
.ws-seo a,
.entry-content a {
    text-decoration: underline !important;
}

/* 2.4.1 Bypass Blocks — skip link. Hidden off-screen until focused, then it
 * slides into the top-left so keyboard users can jump past the nav to #main.
 * !important + class specificity beat the theme's global a{} reset. */
.lw-skip-link {
    position: absolute !important;
    left: -9999px;
    top: 0;
    z-index: 100000;
    display: inline-block !important;
    padding: 12px 20px;
    background: #ffffff !important;
    color: #0b5d4a !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    border: 2px solid #0b5d4a;
    border-radius: 0 0 8px 0;
}
.lw-skip-link:focus {
    left: 0 !important;
    outline: 3px solid #0b5d4a !important;
    outline-offset: 0;
}

/* 1.4.3 Contrast — the theme's gray/mint TEXT utilities fail on white. Their
 * values live in header.php's inline <style> (loaded after this file), so these
 * overrides use a `body` prefix to win on specificity rather than load order. */
body .text-gray,
body .text-gray4,
body .text-gray5 {
    color: #6c757d !important; /* were #828282 / #BDBDBD / #ADADAD (3.84 / 1.88 / 2.24:1) */
}
body .text-green,
body .text-green2 {
    color: #0f7c63 !important; /* were #51e5d3 / #29f1c3 (1.56 / 1.45:1) */
}

/* 1.4.3 — input placeholder text (was #828282, 3.84:1). */
body input::placeholder,
body textarea::placeholder {
    color: #6c757d !important;
}

/* 1.4.11 Non-text Contrast — input underline / textarea border (was #e0e0e0,
 * 1.27:1) need >= 3:1 as the field's only visible boundary. */
body .inputText {
    border-bottom-color: #767f88 !important;
}
body textarea {
    border-color: #767f88 !important;
}
