/*
Theme Name: Hello Elementor Child - Bioenergética Aspe
Theme URI: https://bioenergeticaaspe.es/
Description: Tema hijo con mejoras de accesibilidad WCAG 2.1 AA para Bioenergética Aspe
Author: Bioenergética Aspe
Template: hello-elementor
Version: 1.0.0
Text Domain: hello-elementor-child
*/

/* ========================================
   MEJORAS DE ACCESIBILIDAD - WCAG 2.1 AA
   Bioenergética Aspe
   Fecha: 2025-11-10

   NOTA: Estos estilos NO cambian la apariencia visual del sitio.
   Solo mejoran la accesibilidad para usuarios de teclado y lectores de pantalla.
   ======================================== */

/* ----------------------------------------
   1. TEXTO ALTERNATIVO PARA SCREEN READERS
   ---------------------------------------- */
.elementor-screen-only {
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    width: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.elementor-screen-only:focus {
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    padding: 0.5rem 1rem !important;
    position: absolute !important;
    white-space: normal !important;
    background-color: #fff !important;
    color: #000 !important;
    border: 2px solid #0066cc !important;
    z-index: 999999 !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

/* ----------------------------------------
   2. ICONOS DE REDES SOCIALES
   ---------------------------------------- */

/* Enfoque visual mejorado (solo visible con navegación por teclado) */
.elementor-social-icon:focus {
    outline: 3px solid #0066cc !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(0, 102, 204, 0.2) !important;
}

/* Área de click accesible (min 44x44px - WCAG 2.5.5) */
.elementor-social-icon {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hover y focus con feedback visual suave */
.elementor-social-icon:hover,
.elementor-social-icon:focus {
    opacity: 1 !important;
    transform: scale(1.1);
    transition: transform 0.2s ease-in-out;
}

/* ----------------------------------------
   3. ENLACE DE SALTO AL CONTENIDO
   ---------------------------------------- */

/* Ocultar visualmente pero mantener accesible */
.skip-link.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    width: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Visible SOLO al recibir foco con teclado (presionando TAB) */
.skip-link.screen-reader-text:focus {
    clip: auto !important;
    clip-path: none !important;
    background-color: #0066cc !important;
    color: #ffffff !important;
    display: block !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    height: auto !important;
    left: 6px !important;
    line-height: 1.5 !important;
    padding: 15px 25px !important;
    text-decoration: none !important;
    top: 6px !important;
    width: auto !important;
    z-index: 999999 !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    animation: skipLinkFadeIn 0.2s ease-in;
}

@keyframes skipLinkFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----------------------------------------
   4. LOGO Y NAVEGACIÓN PRINCIPAL
   ---------------------------------------- */

.site-logo a:focus,
.custom-logo-link:focus {
    outline: 3px solid #0066cc !important;
    outline-offset: 3px !important;
    border-radius: 4px;
}

/* ----------------------------------------
   5. ENFOQUE GENERAL EN ELEMENTOS INTERACTIVOS
   ---------------------------------------- */

/* Contenido principal */
#content:focus {
    outline: none;
}

/* Elementos interactivos dentro del contenido */
#content a:focus,
#content button:focus,
#content input:focus,
#content textarea:focus,
#content select:focus,
.elementor a:focus,
.elementor button:focus {
    outline: 3px solid #0066cc !important;
    outline-offset: 2px !important;
}

/* Botones de Elementor */
.elementor-button:focus {
    outline: 3px solid #0066cc !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(0, 102, 204, 0.2) !important;
}

/* ----------------------------------------
   6. MEJORAS DE CONTRASTE EN ENLACES
   ---------------------------------------- */

/* Subrayado más visible en enlaces (solo para accesibilidad) */
a {
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 3px;
}

/* ----------------------------------------
   7. FORMULARIOS ACCESIBLES
   ---------------------------------------- */

/* Etiquetas de formulario */
label {
    cursor: pointer;
}

/* Campos de formulario con error */
input:invalid:focus,
textarea:invalid:focus {
    outline: 3px solid #d32f2f !important;
    outline-offset: 2px !important;
}

/* ----------------------------------------
   8. RESPONSIVE Y ADAPTABILIDAD
   ---------------------------------------- */

@media (max-width: 768px) {
    /* Asegurar áreas de click en móviles */
    .elementor-social-icon {
        min-width: 48px !important;
        min-height: 48px !important;
    }

    /* Skip link más visible en móviles */
    .skip-link.screen-reader-text:focus {
        font-size: 0.9rem !important;
        padding: 12px 20px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Respetar preferencias de movimiento reducido */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .skip-link.screen-reader-text:focus {
        animation: none;
    }
}

/* ----------------------------------------
   9. ALTO CONTRASTE (Windows High Contrast Mode)
   ---------------------------------------- */

@media (prefers-contrast: high) {
    .skip-link.screen-reader-text:focus {
        border: 4px solid !important;
    }

    .elementor-social-icon:focus {
        outline-width: 4px !important;
    }
}

/* ----------------------------------------
   10. MODO OSCURO (Opcional)
   ---------------------------------------- */

@media (prefers-color-scheme: dark) {
    .skip-link.screen-reader-text:focus {
        background-color: #1a73e8 !important;
        color: #ffffff !important;
    }
}
