/**
 * Montlick Injury Attorneys - Accessibility Styles
 * WCAG 2.1 AA Compliance
 * 
 * This file contains all accessibility-related CSS overrides and additions.
 * It should be enqueued LAST to ensure it overrides any problematic styles.
 * 
 * @version 1.0.0
 * @since 2026-02
 */

/* ==========================================================================
   1. SKIP NAVIGATION LINK (WCAG 2.4.1 Bypass Blocks)
   ========================================================================== */

/**
 * Skip link allows keyboard users to bypass repetitive navigation.
 * Hidden by default, visible on focus.
 */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 999999;
    padding: 12px 24px;
    background-color: #0A1631;
    color: #fff;
    font: 700 1.4rem/1.3 'Open Sans', sans-serif;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    transition: top 0.3s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 0;
    outline: 2px solid #78BE38;
    outline-offset: 2px;
}

/* Ensure skip link works with admin bar */
.admin-bar .skip-link:focus,
.admin-bar .skip-link:focus-visible {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .skip-link:focus,
    .admin-bar .skip-link:focus-visible {
        top: 46px;
    }
}

/* ==========================================================================
   2. SCREEN READER ONLY TEXT (WCAG 1.3.1 Info and Relationships)
   ========================================================================== */

/**
 * Visually hidden but accessible to screen readers.
 * Use for providing context that sighted users don't need.
 */
.screen-reader-text,
.sr-only {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

/**
 * Allow screen reader text to become visible when focused.
 * Useful for skip links and other focusable hidden elements.
 */
.screen-reader-text:focus,
.sr-only:focus,
.screen-reader-text:focus-visible,
.sr-only:focus-visible {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #0A1631;
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   3. VIDEO PAUSE CONTROLS (WCAG 2.2.2 Pause, Stop, Hide)
   ========================================================================== */

/**
 * Visually hidden video pause controls that appear on focus.
 * Allows keyboard users to pause auto-playing videos.
 */
.sr-only.video-pause-control {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    background: transparent;
}

.sr-only.video-pause-control:focus,
.sr-only.video-pause-control:focus-visible {
    position: absolute;
    width: auto;
    height: auto;
    padding: 10px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    z-index: 100;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Ensure video containers have relative positioning for pause control */
.banner-media__large,
.hp-mobile-banner__video,
.form-bg-video,
.banner-media,
.video-wrapper,
.video-player {
    position: relative;
}

/* ==========================================================================
   4. FOCUS INDICATORS (WCAG 2.4.7 Focus Visible)
   ========================================================================== */

/**
 * Override any outline:none rules and provide visible focus indicators.
 * Using brand green (#78BE38) for consistency with design system.
 */

/* Global focus styles */
.btn:focus,
.btn:focus-visible,
.btn-primary:focus,
.btn-primary:focus-visible,
.underline-link:focus,
.underline-link:focus-visible,
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: 2px solid #78BE38 !important;
    outline-offset: 2px !important;
}

/* Button focus styles */
.btn:focus,
.btn:focus-visible,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-secondary:focus,
.btn-secondary:focus-visible,
.gform_button:focus,
.gform_button:focus-visible {
    outline: 2px solid #78BE38 !important;
    outline-offset: 2px !important;
}

/* Enhanced button focus with box-shadow for better visibility */
.btn-primary:focus,
.btn-primary:focus-visible,
.gform_button:focus,
.gform_button:focus-visible {
    outline-color: #0A1631 !important;
    box-shadow: 0 0 0 4px rgba(120, 190, 56, 0.4);
}

/* Link focus styles */
.link:focus,
.link:focus-visible,
.underline-link:focus,
.underline-link:focus-visible {
    outline: 2px solid #78BE38 !important;
    outline-offset: 2px !important;
}

/* Hamburger menu focus */
.hamburger:focus,
.hamburger:focus-visible {
    outline: 2px solid #78BE38 !important;
    outline-offset: 4px !important;
}

/* High contrast focus for dark backgrounds */
.footer a:focus,
.footer a:focus-visible,
.footer button:focus,
.footer button:focus-visible,
.header a:focus,
.header a:focus-visible,
.header button:focus,
.header button:focus-visible,
.header-menu a:focus,
.header-menu a:focus-visible,
[class*="bg-dark"] a:focus,
[class*="bg-dark"] a:focus-visible,
[class*="bg-navy"] a:focus,
[class*="bg-navy"] a:focus-visible,
.contact-form a:focus,
.contact-form a:focus-visible,
.contact-reviews-sec a:focus,
.contact-reviews-sec a:focus-visible,
.subscribe-form a:focus,
.subscribe-form a:focus-visible {
    outline-color: #fff !important;
}

/* Form input focus - ensure inputs are clearly focused */
.gfield input:focus,
.gfield input:focus-visible,
.gfield select:focus,
.gfield select:focus-visible,
.gfield textarea:focus,
.gfield textarea:focus-visible {
    outline: 2px solid #78BE38 !important;
    outline-offset: 0 !important;
    border-color: #78BE38 !important;
}

/* Card and interactive element focus */
.banner-cards__item:focus,
.banner-cards__item:focus-visible,
.step-card:focus,
.step-card:focus-visible,
.testimonial-slider__item:focus,
.testimonial-slider__item:focus-visible {
    outline: 2px solid #78BE38 !important;
    outline-offset: 4px !important;
}

/* ==========================================================================
   5. REDUCED MOTION (WCAG 2.3.3 Animation from Interactions)
   ========================================================================== */

/**
 * Respect user's motion preferences.
 * Reduces or removes animations for users who prefer reduced motion.
 */
@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;
    }
    
    .skip-link {
        transition: none;
    }
    
    /* Disable auto-playing sliders */
    .slick-slider {
        /* Sliders should not auto-advance */
    }
}

/* ==========================================================================
   6. HIGH CONTRAST MODE SUPPORT
   ========================================================================== */

/**
 * Ensure elements remain visible in Windows High Contrast Mode.
 */
@media (forced-colors: active) {
    .skip-link:focus {
        background-color: Highlight;
        color: HighlightText;
        forced-color-adjust: none;
    }
    
    .btn,
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
    
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid Highlight !important;
    }
}

/* ==========================================================================
   7. LANDMARK STYLING HELPERS
   ========================================================================== */

/**
 * Visual debugging for landmarks (uncomment during development)
 */
/*
[role="banner"],
[role="navigation"],
[role="main"],
[role="contentinfo"] {
    outline: 2px dashed rgba(120, 190, 56, 0.5);
}
*/

/* ==========================================================================
   8. FORM ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/**
 * Ensure required field indicators are visible.
 */
.gfield_required {
    color: #c00;
    font-weight: 700;
}

/**
 * Error message styling for better visibility.
 */
.gfield_error input,
.gfield_error select,
.gfield_error textarea {
    border-color: #c00 !important;
    border-width: 2px !important;
}

.validation_message,
.gfield_validation_message {
    color: #c00;
    font-weight: 600;
    margin-top: 4px;
}

/**
 * Ensure form labels are associated and visible.
 * Note: This shows labels that were previously hidden.
 * Remove if you prefer placeholder-only approach (not recommended for a11y).
 */
/*
.gfield .gform-field-label {
    display: block !important;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 1.4rem;
}
*/

/* ==========================================================================
   9. TABLE ACCESSIBILITY (WCAG 1.3.1)
   ========================================================================== */

/**
 * Screen reader only table captions.
 */
table caption.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/**
 * Ensure table headers are distinguishable.
 */
th[scope] {
    font-weight: 700;
}

/* ==========================================================================
   10. ICON ACCESSIBILITY
   ========================================================================== */

/**
 * Hide decorative icons from screen readers.
 * Note: This is a fallback - prefer adding aria-hidden="true" in HTML.
 */
.icon-decorative,
[class*="icon-"]:empty {
    speak: none;
}

/**
 * Ensure icon-only buttons have visible focus.
 */
button[aria-label]:not([aria-label=""]):focus,
a[aria-label]:not([aria-label=""]):focus {
    outline: 2px solid #78BE38 !important;
    outline-offset: 4px !important;
}

/* ==========================================================================
   11. TOUCH TARGET SIZE (WCAG 2.5.5)
   ========================================================================== */

/**
 * Ensure touch targets are at least 44x44px.
 * Applied to common interactive elements on mobile.
 */
@media (pointer: coarse) {
    .header-menu a,
    .footer-menu a,
    .footer-socials a,
    .hamburger {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ==========================================================================
   12. LINK DISTINCTION (WCAG 1.4.1)
   ========================================================================== */

/**
 * Ensure links are distinguishable from surrounding text.
 * Underline is the most reliable method.
 */
   
/*.faq-detail__content a,
.post-content a,
article a:not(.btn):not(.link):not(.underline-link) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}*/

.faq-detail__content a:hover,
.post-content a:hover,
article a:not(.btn):not(.link):not(.underline-link):hover {
    text-decoration-thickness: 2px;
}

.banner-inner > .hero-video{
    display: none;
}

@media (max-width:1024px){
    .hero-form .banner-content .hero-video{
        display: none;
    }

    .hero-form .banner-inner > .hero-video{
        display: block;
    }

    .hero-form .banner-media{
        padding-bottom: 0px;
    }
}

/* Touch targets: footer copy is editor-authored, so size the links here. */
.footer-info a {
    display: inline-block;
    padding-block: 4px;
}
