/* 
 * Swyom Advisors Accessibility Fixes CSS
 * Complies with WCAG 2.1 AA Guidelines
 */

/* ==========================================================================
   1. Keyboard Focus Indicators (WCAG 2.4.7)
   ========================================================================== */

/* Force ultra-visible high-contrast outline on focus for all interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus,
.swiper-pagination-bullet:focus,
.elementor-accordion-title:focus,
.eael-magnific-link:focus,
.eael-filterable-gallery-item-inner:focus,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #0056D2 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 8px rgba(0, 86, 210, 0.8) !important;
/* Sub-menu Dismissal via Esc Key (WCAG 1.4.13) */
.menu-item-has-children.swyom-submenu-dismissed .sub-menu,
.elementor-item-has-children.swyom-submenu-dismissed .elementor-nav-menu--dropdown,
.has-submenu.swyom-submenu-dismissed ul {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !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 on light backgrounds */
h1, h2, h3, h4, h5, h6 {
    color: #0b2240 !important; /* Deep blue has excellent contrast */
}

/* Contact page blue cards contrast fix (Ensure crisp white text on dark blue background) */
.contact-box-ic,
.contact-box-ic h1,
.contact-box-ic h2,
.contact-box-ic h3,
.contact-box-ic h4,
.contact-box-ic h5,
.contact-box-ic h6,
.contact-box-ic p,
.contact-box-ic a,
.contact-box-ic span,
.contact-box-ic div,
.contact-box-ic i,
.contact-box-ic .elementor-heading-title,
.contact-box-ic .elementor-icon-box-title,
.contact-box-ic .elementor-icon-box-description {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.contact-box-ic .elementor-button,
.contact-box-ic .elementor-button * {
    color: #ffffff !important;
}

/* 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 without collapsing iframe height */
img, video {
    max-width: 100% !important;
    height: auto !important;
}

iframe {
    max-width: 100% !important;
}

/* ==========================================================================
   Calendly Widget & Modal Popup Full-Display Fixes
   ========================================================================== */
iframe[src*="calendly"],
.calendly-inline-widget,
.calendly-inline-widget iframe {
    width: 100% !important;
    min-width: 100% !important;
    min-height: 680px !important;
    height: 680px !important;
    border: none !important;
}

/* Prevent Elementor Popup Dialog from cropping Calendly iframe */
.elementor-popup-modal .dialog-message,
.dialog-lightbox-message {
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

@media (max-width: 768px) {
    iframe[src*="calendly"],
    .calendly-inline-widget,
    .calendly-inline-widget iframe {
        min-height: 750px !important;
        height: 750px !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;
}

/* ==========================================================================
   5. Reflow & Zoom Overlap Prevention (Items #4 & #7)
   ========================================================================== */
/* Ensure Swiper / Elementor navigation buttons keep clean circular 44px dimensions */
.pp-slider-arrow,
.elementor-swiper-button,
.elementor-swiper-button-prev,
.elementor-swiper-button-next,
.swiper-button-prev,
.swiper-button-next {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    margin: 4px !important;
    z-index: 10 !important;
}

.pp-slider-arrow svg,
.elementor-swiper-button svg,
.swiper-button-prev svg,
.swiper-button-next svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
}

/* Container wrapper flex spacing for slider controls */
.pp-slider-arrow-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: 15px !important;
    justify-content: center !important;
    align-items: center !important;
}

@media screen and (max-width: 1280px) {
    .pp-slider-arrow,
    .elementor-swiper-button,
    .elementor-swiper-button-prev,
    .elementor-swiper-button-next {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
    }
}

/* ==========================================================================
   6. Blog & Specific Page Color Contrast Fixes (Item #57)
   ========================================================================== */
.elementor-post__title a,
.elementor-post__title,
.entry-title a {
    color: #C15710 !important; /* Compliant 4.53:1 contrast against #FFFFFF */
}

.elementor-post__title a:hover,
.elementor-post__title a:focus {
    color: #963e00 !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   7. Screen Reader Only Utility Class (.sr-only)
   ========================================================================== */
.sr-only,
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   8. Lighter Blue Tone Overrides for #004BA6 (Team Boxes, Text, Buttons)
   ========================================================================== */

/* Team Member Cards & Blue Background Boxes (.bblue) */
.bblue .elementor-widget-container,
div.bblue,
.bblue {
    background-color: #1E68D7 !important; /* Lighter tone of #004BA6 */
    color: #FFFFFF !important;
}

/* Ensure text inside .bblue team cards is pure crisp white */
.bblue .elementor-widget-container *,
.bblue h1, .bblue h2, .bblue h3, .bblue h4, .bblue h5, .bblue h6,
.bblue p, .bblue span, .bblue div, .bblue a {
    color: #FFFFFF !important;
}

/* Blue text classes & menu items */
.color-blue,
#menu-item-6586 > a {
    color: #1E68D7 !important;
}

/* Global inline style overrides for #004BA6 */
[style*="background-color: #004ba6"],
[style*="background-color: #004BA6"],
[style*="background: #004ba6"],
[style*="background: #004BA6"] {
    background-color: #1E68D7 !important;
}

[style*="color: #004ba6"],
[style*="color: #004BA6"] {
    color: #1E68D7 !important;
}

[style*="border-color: #004ba6"],
[style*="border-color: #004BA6"] {
    border-color: #1E68D7 !important;
}

/* Swiper bullets & form inputs */
.swiper-pagination-bullet-active {
    background: #1E68D7 !important;
    outline-color: #1E68D7 !important;
}

input:focus, textarea:focus, select:focus {
    border-color: #1E68D7 !important;
    box-shadow: 0 0 0 2px rgba(30, 104, 215, 0.25) !important;
}

