/*
 * ADA Accessibility Overrides
 * Applied last so they take precedence over Bootstrap/W3CSS outline:0 rules.
 * WCAG 2.1 Level AA compliance — WCAG 2.4.1, 2.4.7
 */

/* ── Skip Navigation Link (WCAG 2.4.1) ────────────────────────────── */
/*
 * position:fixed keeps it off-screen relative to the VIEWPORT (not parent),
 * which guarantees it stays hidden regardless of surrounding stacking contexts.
 * It slides in from the top on keyboard :focus.
 */
.skip-link {
    position: fixed;
    top: -60px;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    background: #002956;
    color: #ffffff;
    padding: 12px 18px;
    z-index: 99999;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 3px solid #005fcc;
    transition: top 0.15s ease;
    /* Ensure it is invisible to mouse users and correctly hidden offscreen */
    opacity: 0;
    pointer-events: none;
}

.skip-link:focus {
    top: 0;
    opacity: 1;
    pointer-events: auto;
    outline: 3px solid #005fcc;
    outline-offset: -3px;
}

/* ── Global Visible Focus Indicators (WCAG 2.4.7) ─────────────────── */
/*
 * Bootstrap 3 + W3.CSS suppress outlines via `outline: 0` on :active/:focus.
 * Override those rules here with !important so keyboard users see a focus ring
 * on every interactive element regardless of what the framework nullifies.
 */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
[tabindex]:focus,
[tabindex]:focus-visible {
    outline: 3px solid #005fcc !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(0, 95, 204, 0.25) !important;
}

/* Mouse users: browsers apply their default behavior when :focus-visible is not matched */

/* ── Resource link (replaces the removed <button>-inside-<a>) ─────── */
.resource-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.resource-link:focus {
    outline: 3px solid #005fcc !important;
    outline-offset: 2px !important;
}

/* ── Navbar link focus ─────────────────────────────────────────────── */
.navbar-default .navbar-nav>li>a:focus,
.navbar-default .navbar-brand:focus,
.navbar-toggle:focus {
    outline: 3px solid #005fcc !important;
    outline-offset: 2px !important;
    background-color: transparent;
}