/**
 * Accessibility and Contrast Fixes
 * Ensures WCAG 2.1 AA compliance
 */

/* ===== Global Contrast Improvements ===== */

/* Ensure all links have sufficient contrast */
a {
    color: #2C3E50;
    text-decoration: underline;
}

a:hover, a:focus {
    color: #F39C12;
    text-decoration: none;
}

/* Links on dark backgrounds */
.ct-hero-section a,
.success-metrics a,
.footer-cta a {
    color: #FFFFFF;
    text-decoration: underline;
}

/* ===== Focus States for Accessibility ===== */
*:focus {
    outline: 3px solid #F39C12 !important;
    outline-offset: 2px !important;
}

/* Better focus for buttons */
.ct-btn:focus,
.wp-block-button__link:focus {
    outline: 3px solid #FFFFFF !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 6px rgba(243, 156, 18, 0.3) !important;
}

/* ===== Text Readability ===== */

/* Minimum font sizes */
p, li, span {
    font-size: max(16px, 1rem);
}

small, .small-text {
    font-size: max(14px, 0.875rem);
}

/* Line height for readability */
p, li {
    line-height: 1.6;
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
    .ct-hero-section {
        background: #1A1A1A !important;
    }
    
    .ct-hero-title,
    .ct-hero-subtitle {
        color: #FFFFFF !important;
        text-shadow: none !important;
    }
    
    .ct-btn-primary {
        background: #F39C12 !important;
        color: #000000 !important;
        border: 2px solid #F39C12 !important;
    }
    
    .ct-btn-secondary {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #F39C12 !important;
        border: 2px solid rgba(243, 156, 18, 0.5) !important;
    }
    
    .ct-btn-secondary:hover {
        background: rgba(243, 156, 18, 0.15) !important;
        color: #F39C12 !important;
        border-color: #F39C12 !important;
    }
    
    .metric-number,
    .metric-label {
        text-shadow: none !important;
    }
    
    .value-prop-description,
    .case-study-description,
    .resource-card p,
    .section-subtitle,
    .cta-subtitle {
        color: #2C3E50 !important;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    /* Invert light backgrounds */
    .wp-block-group.section:nth-child(even) {
        background: #1A1A1A;
    }
    
    .wp-block-group.section:nth-child(odd) {
        background: #0D0D0D;
    }
    
    /* Text colors for dark mode */
    .section-title,
    .value-prop-title,
    .case-study-title,
    h2, h3 {
        color: #FFFFFF;
    }
    
    .section-subtitle,
    .value-prop-description,
    .case-study-description,
    p {
        color: #B8C5D6;
    }
    
    /* Cards in dark mode */
    .value-prop-card,
    .case-study-card,
    .resource-card {
        background: #1A1A1A;
        border-color: #2C3E50;
    }
    
    .testimonial-quote {
        background: #1A1A1A;
        color: #FFFFFF;
    }
    
    /* Lead magnet section dark mode */
    .lead-magnet-section {
        background: #0D0D0D;
    }
    
    .lead-magnet-benefits {
        background: #1A1A1A;
        border-left-color: #F39C12;
    }
    
    .lead-magnet-text h2,
    .lead-magnet-benefits li {
        color: #FFFFFF;
    }
}

/* ===== Screen Reader Only Content ===== */
.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;
}

/* ===== Skip to Content Link ===== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #F39C12;
    color: #FFFFFF;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
    border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== Reduced Motion Support ===== */
@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;
    }
    
    .ct-particle,
    .ct-hero-section::before {
        animation: none !important;
    }
}

/* ===== Specific Fixes for Problem Areas ===== */

/* Hero section text shadows for readability */
.ct-hero-title {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Success metrics better contrast */
.success-metrics .section-title::after {
    background: #F39C12; /* Solid color instead of gradient */
}

/* Trust logos better hover state */
.ct-trust-logo:hover,
.ct-trust-logo:focus {
    background: #F39C12;
    color: #FFFFFF;
    border-color: #F39C12;
}

/* Button improvements */
.ct-btn-primary,
.wp-block-button.btn-primary .wp-block-button__link {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Form fields contrast */
input[type="text"],
input[type="email"],
textarea,
select {
    border: 2px solid #5A6C7D;
    background: #FFFFFF;
    color: #2C3E50;
    font-size: 16px;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: #F39C12;
    background: #FFFFFF;
}

/* Placeholder text contrast */
::placeholder {
    color: #5A6C7D;
    opacity: 1;
}

/* Selection color */
::selection {
    background: #F39C12;
    color: #FFFFFF;
}

::-moz-selection {
    background: #F39C12;
    color: #FFFFFF;
}