/* Accessibility Improvements - Focus States & WCAG Compliance */

/* ==================== FOCUS STATES ==================== */
/* Ensure all interactive elements have visible focus indicators */

/* Keyboard Focus (Tab key) - Visible on ALL interactive elements */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
    outline: 3px solid #C5A059 !important;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Alternative focus style for better visibility */
*:focus-visible {
    outline: 3px solid #C5A059 !important;
    outline-offset: 2px;
}

/* Remove default outline and add custom */
button {
    position: relative;
}

button:focus::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #C5A059;
    border-radius: 4px;
    pointer-events: none;
}

/* Nav links focus enhancement */
nav a:focus {
    background-color: rgba(197, 160, 89, 0.15);
    text-decoration: underline;
}



/* Links focus state */
a:focus:not(.nav-link):not([tabindex="-1"]) {
    outline: 2px dashed #C5A059;
    outline-offset: 2px;
}

/* ==================== CONTRAST IMPROVEMENTS ==================== */

/* Ensure minimum WCAG AA contrast (4.5:1 for normal text, 3:1 for large text) */

/* Footer text - improve contrast */
footer {
    background-color: #0B243E;
    color: #ffffff;
}

footer a {
    color: #C5A059;
    text-decoration: underline;
}

footer a:hover {
    color: #e8c877;
}

/* Button text contrast */
.btn, button, [role="button"] {
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
}

.btn:hover, button:hover, [role="button"]:hover {
    opacity: 0.9;
    text-decoration: underline;
}

/* Form labels */
label {
    color: #0B243E;
    font-weight: 600;
}

/* Info text */
.info-text, .helper-text {
    color: #333333;
    font-size: 14px;
}

/* Error messages - high contrast */
.error, .form-error, [role="alert"] {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
}

/* Success messages */
.success, .form-success, [role="status"] {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
}

/* ==================== SKIP LINKS ==================== */
/* Allow users to skip to main content */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

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

[aria-live] {
    position: relative;
}

/* Animated loading spinner for screen readers */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== HEADING HIERARCHY ==================== */

/* Ensure proper heading styles */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0B243E;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0B243E;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #0B243E;
}

/* ==================== TEXT READABILITY ==================== */

body {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
}

/* Ensure minimum font size */
p, li, td, label, input, textarea, select {
    font-size: 16px;
    line-height: 1.5;
}

/* Improve code readability */
code, pre {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #0B243E;
}

/* ==================== BUTTON & LINK ACCESSIBILITY ==================== */

/* Larger touch targets (44x44px minimum) */
button, a[role="button"], input[type="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
    font-size: 16px;
}

/* Spacing between interactive elements */
button + button,
button + a,
a + button {
    margin-left: 8px;
}

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

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
}

th {
    background-color: #0B243E;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 700;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

tr:nth-child(even) {
    background-color: #f9f8f6;
}

tr:hover {
    background-color: #f5f1e8;
}

/* ==================== FORM ACCESSIBILITY ==================== */

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

:-ms-input-placeholder {
    color: #999;
}

::-ms-input-placeholder {
    color: #999;
}


/* ==================== PRINT STYLES ==================== */

@media print {
    body {
        font-size: 12pt;
        color: #000;
        background: white;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    a::after {
        content: " (" attr(href) ")";
    }
    
    button, nav {
        display: none;
    }
}

/* ==================== SCREEN READER ONLY ==================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}
