/**
 * Accessibility Enhancements for xboard.AI
 * WCAG 2.1 Level AA Compliance
 * European Accessibility Act (EAA) - Direttiva UE 2019/882
 */

/* ============================================
   SKIP LINKS - Hidden until focused
   ============================================ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue, #1e3a8a);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* ============================================
   FOCUS INDICATORS - Enhanced visibility
   ============================================ */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* Remove default outline but keep our custom one */
*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* ============================================
   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-width: 0;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================
   KEYBOARD NAVIGATION INDICATORS
   ============================================ */
.navbar a:focus,
nav a:focus {
    background-color: rgba(251, 191, 36, 0.1);
}

/* ============================================
   HIGH CONTRAST MODE SUPPORT
   ============================================ */
@media (prefers-contrast: high) {
    .navbar,
    .hero,
    .section {
        border: 2px solid currentColor;
    }

    a:focus,
    button: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;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   DARK MODE ACCESSIBILITY
   ============================================ */
[data-theme="dark"] .skip-link {
    background: #1e3a8a;
    color: white;
}

[data-theme="dark"] a:focus,
[data-theme="dark"] button:focus {
    outline-color: #fbbf24;
}
