/*
=======================================================================
ACCESSIBILITY FIXES - WCAG 2.1 AA Compliance
=======================================================================
Fixes for color contrast issues to meet WCAG 2.1 AA standards (4.5:1 ratio)
*/

/* 
=======================================================================
1. IMPROVED COLOR PALETTE
=======================================================================
*/

/* Main colors with better contrast ratios */
:root {
    --main-color-dark: #c62828;        /* Darker red for better contrast - 4.5:1 with white */
    --main-color-original: #e53935;     /* Original red - keep for non-text elements */
    --secondary-color-dark: #2e2e2e;    /* Darker gray for better contrast */
    --text-gray-dark: #424242;          /* Darker gray for text - 7:1 with white */
    --text-gray-medium: #616161;        /* Medium gray for secondary text - 4.5:1 with white */
    --white: #ffffff;
    --black: #000000;
}

/* 
=======================================================================
2. BACKGROUND COLOR FIXES
=======================================================================
*/

/* Main background color - use darker version for text elements */
.background-main-color {
    background-color: var(--main-color-dark) !important;
}

/* Keep original color for decorative elements without text */
.background-main-color.no-text,
.background-main-color .icon-only,
.background-img-main-color:after {
    background-color: var(--main-color-original) !important;
}

/* Secondary background improvements */
.background-second-color {
    background-color: var(--secondary-color-dark) !important;
}

/* 
=======================================================================
3. TEXT COLOR FIXES
=======================================================================
*/

/* Main text color improvements */
.text-main-color {
    color: var(--main-color-dark) !important;
}

/* Gray text improvements */
header .contact-info {
    color: var(--text-gray-dark) !important;
}

header a.model-link {
    color: var(--text-gray-dark) !important;
}

/* Ensure white text has sufficient contrast */
.text-white,
.text-white a,
.service.layout-1 a.title,
.service.layout-1 .dis,
.service.layout-2 a.title,
.service.layout-3 a.title,
.service.layout-3 .dis {
    color: var(--white) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Add subtle shadow for better readability */
}

/* 
=======================================================================
4. NAVIGATION FIXES
=======================================================================
*/

/* Header navigation improvements */
header ul.nav-menu > li > a {
    color: var(--black) !important;
}

header ul.nav-menu > li.active > a,
header ul.nav-menu > li > a:hover {
    color: var(--main-color-dark) !important;
}

/* White navigation links */
header ul.white-link > li > a {
    color: var(--white) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 
=======================================================================
5. BUTTON AND INTERACTIVE ELEMENT FIXES
=======================================================================
*/

/* Search button */
#search .btn {
    background-color: var(--main-color-dark) !important;
    color: var(--white) !important;
}

/* Service layout buttons and links */
.service.layout-2 {
    background-color: var(--main-color-dark) !important;
}

/* 
=======================================================================
6. FORM AND INPUT FIXES
=======================================================================
*/

/* Search input */
#search input[type="search"] {
    color: var(--text-gray-dark) !important;
}

/* Form controls */
.form-control {
    color: var(--text-gray-dark) !important;
}

.form-control::placeholder {
    color: var(--text-gray-medium) !important;
}

/* 
=======================================================================
7. DROPDOWN AND MODAL FIXES
=======================================================================
*/

/* Dropdown menus */
header ul.nav-menu > li ul.sub-menu li a {
    color: var(--text-gray-dark) !important;
}

header ul.nav-menu > li ul.sub-menu li a:hover {
    color: var(--black) !important;
}

/* Dark dropdown improvements */
header ul.dropdown-dark .mega-menu-out .mega-menu-list li a {
    color: var(--white) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 
=======================================================================
8. BORDER AND ACCENT FIXES
=======================================================================
*/

/* Border colors */
.border-main-color {
    border-color: var(--main-color-dark) !important;
}

/* 
=======================================================================
9. HOVER STATES AND FOCUS INDICATORS
=======================================================================
*/

/* Improved focus indicators for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--main-color-dark) !important;
    outline-offset: 2px !important;
}

/* Remove default outline and add custom one */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--main-color-dark) !important;
    outline-offset: 2px !important;
}

/* 
=======================================================================
10. SPECIFIC COMPONENT FIXES
=======================================================================
*/

/* Header up-head section */
header .up-head {
    color: var(--white) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Social media links */
header ul.social-media a {
    color: var(--white) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Logo and branding elements - ensure sufficient contrast */
#logo img {
    filter: contrast(1.1) brightness(0.95);
}

/* 
=======================================================================
11. RESPONSIVE ACCESSIBILITY
=======================================================================
*/

/* Ensure text remains readable on mobile */
@media (max-width: 768px) {
    .text-white,
    header ul.white-link > li > a {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7) !important;
    }
    
    /* Increase touch target sizes for better accessibility */
    header a.mobile-toggle {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px !important;
    }
}

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

/* Support for users who prefer high contrast */
@media (prefers-contrast: high) {
    :root {
        --main-color-dark: #b71c1c;
        --secondary-color-dark: #1a1a1a;
        --text-gray-dark: #000000;
    }
    
    .text-white {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
}

/* 
=======================================================================
13. SCREEN READER ONLY CONTENT
=======================================================================
*/

/* Hide content visually but keep it accessible to screen readers */
.sr-only {
    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;
}

/* 
=======================================================================
14. HEADING STRUCTURE IMPROVEMENTS
=======================================================================
*/

/* Ensure proper heading hierarchy */
h1 {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
}

h2 {
    font-size: 2rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-bottom: 0.875rem !important;
}

h3 {
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-bottom: 0.75rem !important;
}

h4 {
    font-size: 1.5rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.625rem !important;
}

h5 {
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
}

h6 {
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
}

/* 
=======================================================================
15. REDUCED MOTION SUPPORT
=======================================================================
*/

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
