/* Accessibility Styles for WCAG 2.1 Level AA Compliance */

/* Skip Navigation Links */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

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

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

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

/* Focus Indicators */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

/* Touch Target Size - Applied only where needed without breaking existing layouts */
/* Original button styles preserved - WCAG compliance handled through proper spacing in templates */

/* Error Messages */
.error-message,
.validation-error {
    color: #d93025;
    font-weight: bold;
}

.error-message::before {
    content: "Error: ";
}

/*/* Form Field Requirements */*/
/*.required::after {*/
/*    content: " *";*/
/*    color: #d93025;*/
/*    font-weight: bold;*/
/*}*/

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline-width: 4px;
    }
}

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

/* Focus states for links */
a:hover,
a:focus {
    text-decoration: underline;
}

/* Form Labels */
label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 600;
}

/* Required Field Indicator Legend */
.form-required-legend {
    font-size: 0.875em;
    color: #666;
    margin-bottom: 1em;
}

/*/* Fieldset and Legend Styling */*/
/*fieldset {*/
/*    border: 1px solid #ccc;*/
/*    padding: 1em;*/
/*    margin-bottom: 1em;*/
/*}*/

legend {
    font-weight: bold;
    padding: 0 0.5em;
}

/* Status Messages */
.status-message[role="status"] {
    padding: 1em;
    margin: 1em 0;
    border: 2px solid #4A90E2;
    background-color: #e3f2fd;
    border-radius: 4px;
}

/* Loading States */
.loading[aria-busy="true"]::after {
    content: " Loading...";
    font-style: italic;
    color: #666;
}

/* Table Headers */
th[scope] {
    font-weight: bold;
    text-align: left;
}

/* Image Alt Text Placeholder - Development Only */
/* img:not([alt]) {
    border: 3px dashed #ff0000;
} */

/* Ensure Color Contrast */
.high-contrast {
    background-color: #fff;
    color: #000;
}

/* Focus visible polyfill for older browsers */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

/* Print Styles for Accessibility */
@media print {
    .skip-link,
    .no-print {
        display: none !important;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}
