/**
 * Accessibility CSS - WCAG 2.1 AA Compliant
 * Addresses color contrast, focus states, and screen reader utilities
 */

/* ========================================
   COLOR CONTRAST FIXES (WCAG AA 4.5:1)
   ======================================== */

/* Fix body text color for better contrast on light backgrounds */
body {
    color: #000000 !important; /* Black text for maximum contrast */
}

/* Fix paragraph text */
p {
    color: #000000 !important;
}

/* Fix light gray text that fails contrast */
.templatemo_lightgrey,
.templatemo_lightgrey * {
    color: #000000 !important;
}

/* Ensure headings have proper contrast */
h1, h2, h3, h4, h5, h6 {
    color: #000000 !important;
}

/* Ensure strong/bold text has proper contrast */
strong, b {
    color: #000000 !important;
    font-weight: 700;
}

/* Fix form labels */
label, .control-label {
    color: #000000 !important;
    font-weight: 600;
}

/* Fix link colors - using darker blue for better contrast */
a {
    color: #0056b3 !important;
    text-decoration: underline;
}

a:hover, a:focus {
    color: #003d82 !important;
    text-decoration: underline;
}

/* Fix logo text if present */
.logo, .logo * {
    color: #000000 !important;
}

/* ========================================
   FOCUS INDICATORS
   ======================================== */

/* Enhanced focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid #0056b3 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.3) !important;
}

/* Visible focus for Bootstrap buttons */
.btn:focus,
.btn:active:focus {
    outline: 3px solid #0056b3 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.3) !important;
}

/* ========================================
   SKIP NAVIGATION
   ======================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0056b3;
    color: #ffffff !important;
    padding: 8px 16px;
    text-decoration: none !important;
    z-index: 10000;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #ffffff !important;
}

/* ========================================
   SCREEN READER UTILITIES
   ======================================== */

.sr-only,
.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;
}

.sr-only-focusable:focus,
.screen-reader-text:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */

@media (prefers-contrast: high) {
    * {
        border-color: #000000 !important;
    }
    
    a {
        text-decoration: underline !important;
    }
}

/* ========================================
   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;
    }
}

/* ========================================
   BUTTON & FORM IMPROVEMENTS
   ======================================== */

/* Ensure buttons have sufficient contrast */
.btn-primary {
    background-color: #0056b3 !important;
    border-color: #004085 !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #003d82 !important;
    border-color: #002752 !important;
    color: #ffffff !important;
}

.btn-warning {
    background-color: #cc8800 !important;
    border-color: #996600 !important;
    color: #000000 !important;
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #996600 !important;
    border-color: #664400 !important;
    color: #000000 !important;
}

/* Form validation states with better contrast */
.has-error .control-label,
.has-error .help-block {
    color: #a94442 !important;
}

.has-success .control-label,
.has-success .help-block {
    color: #2d662d !important;
}

/* Required field indicator */
.required-indicator,
[aria-required="true"]::after {
    content: " *";
    color: #a94442;
    font-weight: bold;
}

/* ========================================
   ARIA LIVE REGIONS
   ======================================== */

[aria-live] {
    position: relative;
}

.aria-alert {
    padding: 12px 16px;
    margin: 10px 0;
    border: 2px solid #a94442;
    background-color: #f2dede;
    color: #000000 !important;
    border-radius: 4px;
}

.aria-status {
    padding: 12px 16px;
    margin: 10px 0;
    border: 2px solid #2d662d;
    background-color: #dff0d8;
    color: #000000 !important;
    border-radius: 4px;
}

/* ========================================
   TABLE ACCESSIBILITY
   ======================================== */

table caption {
    padding: 8px;
    color: #000000 !important;
    font-weight: bold;
    text-align: left;
}

th {
    color: #000000 !important;
    font-weight: bold;
}

/* ========================================
   MODAL ACCESSIBILITY
   ======================================== */

.modal-backdrop {
    background-color: #000000;
}

.modal-header {
    border-bottom: 2px solid #000000;
}

.modal-title {
    color: #000000 !important;
    font-weight: bold;
}

.modal-body {
    color: #000000 !important;
}

/* ========================================
   FOOTER ACCESSIBILITY
   ======================================== */

/* Fix copyright footer contrast */
.templatemo_bottom {
    background-color: #f5f5f5 !important;
    color: #000000 !important;
}

.templatemo_bottom .left,
.templatemo_bottom .right,
.templatemo_bottom a {
    color: #000000 !important;
    font-weight: 600;
}

.templatemo_bottom a:hover,
.templatemo_bottom a:focus {
    color: #0056b3 !important;
    text-decoration: underline !important;
}

/* ========================================
   RESPONSIVE FONT SIZING
   ======================================== */

@media (max-width: 768px) {
    body {
        font-size: 16px; /* Ensure text is readable on mobile */
    }
}

