/**
 * Utilidades de Accesibilidad - ConectaTerapia
 * @description Mejoras de accesibilidad sin cambios visuales
 * @version 1.0.0
 */

/* =====================================================
   SKIP LINK (Para navegación por teclado)
   ===================================================== */

.ct-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ct-primary-600);
    color: white;
    padding: var(--ct-space-2) var(--ct-space-4);
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 var(--ct-radius-md) 0;
    font-weight: var(--ct-font-medium);
}

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

/* =====================================================
   FOCUS VISIBLE (Mejorar visibilidad de foco)
   ===================================================== */

/* Aplicar a todos los elementos interactivos */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--ct-primary-600);
    outline-offset: 2px;
}

/* Para elementos que ya tienen outline personalizado */
.ct-btn:focus-visible,
.ct-card:focus-visible {
    outline: 2px solid var(--ct-primary-600);
    outline-offset: 4px;
}

/* =====================================================
   SCREEN READER ONLY (Contenido solo para lectores)
   ===================================================== */

.ct-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;
}

/* Mostrar al recibir foco (útil para skip links) */
.ct-sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* =====================================================
   MEJORAR CONTRASTE (Solo si es necesario)
   ===================================================== */

/* Para enlaces que necesitan mejor contraste */
.ct-link--enhanced {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.ct-link--enhanced:hover {
    text-decoration-thickness: 3px;
}

/* =====================================================
   REDUCIR MOVIMIENTO (Prefers-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;
    }
}

/* =====================================================
   ATRIBUTOS ARIA VISUALES (Para desarrollo)
   ===================================================== */

/* Mostrar elementos con aria-hidden durante desarrollo */
/* Descomentar para debugging:
[aria-hidden="true"] {
    opacity: 0.5;
    border: 1px dashed red;
}
*/

/* Resaltar elementos sin aria-label durante desarrollo */
/* Descomentar para debugging:
button:not([aria-label]):not([aria-labelledby]),
a:not([aria-label]):not([aria-labelledby]):not([href]) {
    outline: 2px solid orange;
}
*/

/* =====================================================
   TOUCH TARGETS (Mejorar áreas clickeables en móvil)
   ===================================================== */

@media (hover: none) and (pointer: coarse) {
    /* Aumentar área de toque en móviles */
    .ct-btn,
    button,
    a,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Aumentar espaciado entre elementos clickeables */
    .ct-header-nav a,
    .ct-footer-nav a {
        padding: var(--ct-space-3);
        display: inline-block;
    }
}

/* =====================================================
   CONTADOR DE TAB (Para debugging de navegación)
   ===================================================== */

/* Descomentar para debugging durante desarrollo:
body::before {
    content: "Tab order test - use Tab to navigate";
    position: fixed;
    bottom: 0;
    right: 0;
    background: yellow;
    color: black;
    padding: 4px 8px;
    font-size: 12px;
    z-index: 99999;
}
*/
