/* 
 * Swyom Advisors Accessibility Fixes CSS
 * Complies with WCAG 2.1 AA Guidelines
 */

/* ==========================================================================
   1. Keyboard Focus Indicators (WCAG 2.4.7)
   ========================================================================== */

/* Force visible high-contrast outline on focus for all interactive elements */
/* Force visible high-contrast outline ONLY on keyboard focus-visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.swiper-pagination-bullet:focus-visible,
.elementor-accordion-title:focus-visible {
    outline: 3px solid #004ba6 !important;
    outline-offset: 2px !important;
}

/* Reset outline for mouse clicks to avoid showing borders during normal hover/click */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible),
.swiper-pagination-bullet:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   2. Color Contrast Adjustments (WCAG 1.4.3 & 1.4.11)
   ========================================================================== */

/* Main brand and generic text overrides for high contrast */
body, p, li, .elementor-text-editor, .elementor-text-editor p {
    color: #2b2b2b; /* Dark charcoal text has 14:1 contrast against white */
}

/* Specific text elements mentioned in audit */
.elementor-widget-text-editor, 
.aif-services-text,
.pms-services-text {
    color: #2b2b2b !important;
}

/* Heading colors - ensure strong contrast */
h1, h2, h3, h4, h5, h6 {
    color: #0b2240 !important; /* Deep blue has excellent contrast */
}

/* Compliance Orange replacements for text (original #DF6512 is too light) */
.contrast-orange-text,
a.contrast-orange-text {
    color: #b84b00 !important; /* >= 4.5:1 contrast against white */
}

/* Underline link in footer/privacy/terms to not distinguish by color alone (WCAG 1.4.1) */
a[href*="privacy-policy"],
a[href*="privacy-notice"],
a[href*="disclosure"],
a[href*="terms"],
.site-footer a,
.footer-navigation a {
    text-decoration: underline !important;
}

/* Input Fields & Borders (WCAG 1.4.11) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
    border: 1.5px solid #636363 !important; /* >= 4.5:1 contrast border */
    color: #2b2b2b !important;
    background-color: #ffffff !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #004ba6 !important;
    box-shadow: 0 0 0 2px rgba(0, 75, 166, 0.2) !important;
}

/* Placeholder Contrast */
::placeholder {
    color: #595959 !important; /* >= 4.5:1 contrast placeholder */
    opacity: 1 !important;
}

/* Form Error Messages */
.wpforms-error,
label.wpforms-error,
.error-text {
    color: #b30000 !important; /* High contrast dark red */
    font-weight: 600 !important;
    display: block !important;
    margin-top: 5px !important;
}

/* Button & Link Contrast - Ensure White Text inside Solid Submit Buttons */
.wpforms-submit,
.elementskit-btn,
.eael-pricing-button {
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Allow native backgrounds to shine, but ensure compliance on background colors if needed */
.wpforms-submit:hover,
.elementskit-btn:hover {
    color: #ffffff !important;
}

/* Specific contrast adjustments for homepage outline buttons (WCAG 1.4.3) */
.elementor-element-feb85a9 .elementor-button {
    color: #b84b00 !important;
    border-color: #b84b00 !important;
}
.elementor-element-feb85a9 .elementor-button .elementor-button-text {
    color: #b84b00 !important;
}

.elementor-element-d3de3e5 .elementor-button {
    color: #004ba6 !important;
    border-color: #004ba6 !important;
}
.elementor-element-d3de3e5 .elementor-button .elementor-button-text {
    color: #004ba6 !important;
}

/* Swiper Pagination Bullets (Issue 84) */
.swiper-pagination-bullet {
    background: #004ba6 !important;
    opacity: 0.65 !important;
}

.swiper-pagination-bullet-active {
    background: #004ba6 !important;
    opacity: 1 !important;
    outline: 2px solid #004ba6 !important;
    outline-offset: 2px !important;
}

/* Toggle Menu Icon (Issue 1) */
.elementor-menu-toggle i,
.elementor-menu-toggle svg {
    color: #004ba6 !important;
    fill: #004ba6 !important;
}

/* Skip Link styling (Issue 113) */
.skip-link.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    background-color: #004ba6 !important;
    color: #ffffff !important;
    padding: 15px 25px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    z-index: 100000 !important;
    top: 0;
    left: 0;
}

.skip-link.screen-reader-text:focus {
    clip: auto !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
    position: fixed !important;
    outline: none !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
}

/* ==========================================================================
   3. Reflow, Zoom & Layout fixes (WCAG 1.4.10)
   ========================================================================== */

/* Overlap prevention at 200% zoom */
@media (max-width: 1024px) {
    .swiper-button-next,
    .swiper-button-prev {
        margin: 5px !important;
    }
}

/* Prevent horizontal scrollbars inside modals/popups on 400% zoom (Reflow) */
.elementor-popup-modal,
.dialog-widget-content,
.dialog-lightbox-widget {
    max-width: 100vw !important;
    overflow-y: auto !important;
}

/* Ensure images and videos scale responsively */
img, video, iframe {
    max-width: 100% !important;
    height: auto !important;
}

/* ==========================================================================
   4. Form Field Visual Labels (Issue 51 & 52)
   ========================================================================== */
.wpforms-field-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #2b2b2b !important;
    margin-bottom: 5px !important;
}
