/* ==========================================================================
   WCAG 2.2 Level AA Accessibility Overrides
   Purpose: Fix Level Access audit findings without changing UX/UI look and feel
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SKIP NAVIGATION LINK (WCAG 2.4.1 Bypass Blocks)
   -------------------------------------------------------------------------- */
.skip-to-main {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 10000;
    padding: 12px 24px;
    background-color: #054893;
    color: #ffffff;
    font-size: 16px;
    font-family: 'Roboto', Arial, sans-serif;
    font-weight: 700;
    text-decoration: none;
    border: 3px solid #ffffff;
    border-radius: 0 0 4px 0;
    transition: top 0.15s ease;
}
.skip-to-main:focus {
    top: 0;
    outline: 3px solid #e8a317;
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   2. FOCUS INDICATORS (WCAG 2.4.7 Focus Visible / 2.4.11 Focus Not Obscured)
   Minimum 2px outline with 3:1 contrast against adjacent colors
   -------------------------------------------------------------------------- */
*:focus {
    outline: 3px solid #e8a317;
    outline-offset: 2px;
}
*:focus:not(:focus-visible) {
    outline: none;
}
*:focus-visible {
    outline: 3px solid #e8a317;
    outline-offset: 2px;
}

/* High contrast focus for dark backgrounds */
footer *:focus-visible,
.bg-color-black *:focus-visible,
.bg-color-primary-dark *:focus-visible,
.section-header-small *:focus-visible {
    outline-color: #ffffff;
    outline-style: solid;
    outline-width: 3px;
    outline-offset: 2px;
}

/* Button focus states */
button:focus-visible,
.btn:focus-visible,
.btn-wide:focus-visible,
.btn-primary:focus-visible,
.btn-border:focus-visible,
.btn-black:focus-visible,
a.btn-wide:focus-visible {
    outline: 3px solid #e8a317;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(232, 163, 23, 0.3);
}

/* --------------------------------------------------------------------------
   3. COLOR CONTRAST FIXES (WCAG 1.4.3 Contrast Minimum)
   Ensuring 4.5:1 for normal text, 3:1 for large text
   -------------------------------------------------------------------------- */

/* Gray text on white backgrounds - increase contrast */
.color-gray {
    color: #545454 !important; /* Was lighter, now meets 4.5:1 on white */
}

/* Light text links on dark backgrounds */
footer a,
footer .footer__item,
footer .footer__item div {
    color: #e0e0e0 !important;
}
footer a:hover,
footer a:focus {
    color: #e8a317 !important;
}

/* Breadcrumb text on image overlays */
.section-title .breadcrumb-list a,
.section-title .breadcrumb-list li {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Placeholder text contrast */
::placeholder {
    color: #545454 !important;
    opacity: 1;
}
.placeholder-white::placeholder {
    color: #c0c0c0 !important;
    opacity: 1;
}

/* Ensure nav dropdown items have sufficient contrast */
.dropdown-menu .dropdown-item {
    color: #1a1a1a;
}
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    color: #000000;
    background-color: #e6e6e6;
}

/* --------------------------------------------------------------------------
   4. SCREEN READER ONLY / VISUALLY HIDDEN (Bootstrap 4 compatible)
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* --------------------------------------------------------------------------
   5. INTERACTIVE ELEMENT MINIMUM TARGET SIZE (WCAG 2.5.8 Target Size Minimum)
   Minimum 24x24px touch targets
   -------------------------------------------------------------------------- */
.quick-button a,
.quick-button button,
.quick-button-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.quick-button-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: inherit;
}

/* Social icon minimum tap targets */
.social-icon a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   6. BREADCRUMB STYLING (maintains existing look)
   -------------------------------------------------------------------------- */
.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}
.breadcrumb-list li {
    display: inline;
}
.breadcrumb-list a {
    text-decoration: none;
}
.breadcrumb-list a:hover,
.breadcrumb-list a:focus {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. FORM ELEMENT ACCESSIBILITY
   -------------------------------------------------------------------------- */

/* Visible focus for form inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #e8a317;
    outline-offset: 1px;
    border-color: #054893;
}

/* Error state styles */
.field-validation-error {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 4px;
}
.input-validation-error {
    border-color: #d32f2f !important;
    border-width: 2px;
}

/* --------------------------------------------------------------------------
   8. REDUCED MOTION SUPPORT (WCAG 2.3.3 Animation from Interactions)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   9. LINK DISTINGUISHABILITY (WCAG 1.4.1 Use of Color)
   Links within body text should be underlined
   -------------------------------------------------------------------------- */
.page-section a,
.page-html a,
.page-description a,
.page-list a,
.page-iframe a,
.home__priority-backtext a {
    text-decoration: underline;
}
.page-section a:hover,
.page-html a:hover,
.page-description a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* Navigation links should NOT be underlined */
nav a,
.nav a,
.dropdown-item,
.btn-wide,
.btn-border,
.btn-black,
.btn-primary {
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   10. SCROLL-TO-TOP BUTTON ACCESSIBILITY (auto-generated by theme JS)
   -------------------------------------------------------------------------- */
.scroll-to-top {
    min-width: 44px;
    min-height: 44px;
}

/* --------------------------------------------------------------------------
   11. HIGH CONTRAST MODE SUPPORT
   -------------------------------------------------------------------------- */
@media (forced-colors: active) {
    .skip-to-main:focus {
        outline: 3px solid ButtonText;
    }
    *:focus-visible {
        outline: 3px solid Highlight;
    }
    .btn-wide,
    .btn-primary,
    .btn-border,
    .btn-black {
        border: 2px solid ButtonText;
    }
}

/* --------------------------------------------------------------------------
   12. GOOGLE TRANSLATE WIDGET ACCESSIBILITY
   SVG elements inside Google Translate need to be hidden from AT
   -------------------------------------------------------------------------- */
.goog-te-gadget img,
.VIpgJd-ZVi9od-aZ2wEe {
    display: block;
}

/* --------------------------------------------------------------------------
   13. CONSTANT CONTACT FORM ACCESSIBILITY
   The embedded Constant Contact signup widget creates inaccessible elements
   -------------------------------------------------------------------------- */
.ctct-inline-form img.ctct-X {
    /* Ensure close button is accessible */
    min-width: 24px;
    min-height: 24px;
}
