/* ========================================
   WCAG 2.1 Level A - Accessibility
   ======================================== */

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--ehv-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--ehv-radius);
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: 16px;
    outline: 3px solid var(--ehv-secondary);
    outline-offset: 2px;
}

/* Focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--ehv-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Ensure all interactive elements have visible focus */
.ehv-btn:focus-visible {
    outline: 3px solid var(--ehv-secondary);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(45, 128, 47, 0.2);
}

.ehv-nav a:focus-visible {
    outline: 3px solid var(--ehv-primary);
    outline-offset: 2px;
    background: var(--ehv-primary-subtle);
}

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

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

    .ehv-card:hover,
    .ehv-btn:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --ehv-shadow: none;
        --ehv-shadow-md: none;
        --ehv-shadow-lg: none;
    }

    .ehv-card {
        border: 2px solid var(--ehv-text);
    }

    .ehv-btn--outline {
        border-width: 3px;
    }
}

/* Form error states */
.ehv-field--error input,
.ehv-field--error select,
.ehv-field--error textarea {
    border-color: var(--ehv-error);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}

.ehv-field__error {
    color: var(--ehv-error);
    font-size: 0.8125rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ehv-field__error::before {
    content: '\26A0';
}
