/**
 * Correcciones de accesibilidad WCAG 2.1 AA para Divi - SOLO FRONTEND
 * Generado para cumplir con requerimientos de Kit Digital Red.es
 * Fecha: 26/08/2025
 * 
 * IMPORTANTE: Estas correcciones NO se aplican en:
 * - Panel de administración de WordPress (.wp-admin)
 * - Divi Visual Builder (.et-fb, .et-fb-iframe-ancestor)
 * - Vista previa del builder (.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview)
 */

/* ============================================
   SOLO APLICAR EN FRONTEND - NO EN ADMIN
   ============================================ */

/* 1. CORRECCIÓN DE CONTRASTE DE ENLACES - SOLO FRONTEND */
/* ACTIVADO - Cambiando #2ea3f2 a #000000 para cumplir WCAG 2.1 AA */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et-social-icon a:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_password_protected_form .et_submit_button,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .form-submit .et_pb_button,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .nav-single a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .posted_in a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) #et_search_icon:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .wp-pagenavi a:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .wp-pagenavi span.current,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_bg_layout_light .et_pb_more_button {
    color: #000000 !important;
}

/* Enlaces con subrayado para mejor identificación - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) a {
    text-decoration: underline !important;
}

body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) a:hover {
    color: #333333 !important;
    text-decoration: none !important;
}

/* Border color para mantener consistencia - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et-search-form,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) blockquote {
    border-color: #000000 !important;
}

/* 2. CONTRASTE EN FORMULARIOS - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input.text:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input.title:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type=text]:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type=email]:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type=password]:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type=tel]:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) select:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) textarea:focus {
    border-color: #1a1a1a !important;
    color: #1a1a1a !important;
}

/* 3. PLACEHOLDER TEXT - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input::-webkit-input-placeholder,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) textarea::-webkit-input-placeholder {
    color: #767676 !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input::-moz-placeholder,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) textarea::-moz-placeholder {
    color: #767676 !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input:-ms-input-placeholder,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) textarea:-ms-input-placeholder {
    color: #767676 !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input::placeholder,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) textarea::placeholder {
    color: #767676 !important;
}

/* 4. FOCUS VISUAL - SOLO FRONTEND - MEJORADO CON MAYOR ESPECIFICIDAD */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) *:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) *:focus-visible,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) a:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) a:focus-visible,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) button:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) button:focus-visible,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input:focus-visible,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) select:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) select:focus-visible,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) textarea:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) textarea:focus-visible,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) [tabindex]:focus,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) [tabindex]:focus-visible {
    outline: 3px solid #000000 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.2) !important;
}

/* 5. BOTONES - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_button,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_module .et_pb_button,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) button,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type="submit"],
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type="button"] {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_button:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_module .et_pb_button:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) button:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type="submit"]:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) input[type="button"]:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
}

/* 6. TEXTO EN FONDOS OSCUROS - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_bg_layout_dark,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_bg_layout_dark * {
    color: #ffffff !important;
}

/* 7. TEXTOS PEQUEÑOS - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) small,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .small-text,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .wp-caption-text,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .post-meta,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .post-meta a {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #595959 !important;
}

/* 8. JERARQUÍA DE ENCABEZADOS - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) h1 { 
    font-size: 32px !important; 
    line-height: 1.2 !important;
    margin-top: 0.67em !important;
    margin-bottom: 0.67em !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) h2 { 
    font-size: 28px !important; 
    line-height: 1.3 !important;
    margin-top: 0.83em !important;
    margin-bottom: 0.83em !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) h3 { 
    font-size: 24px !important; 
    line-height: 1.4 !important;
    margin-top: 1em !important;
    margin-bottom: 1em !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) h4 { 
    font-size: 20px !important; 
    line-height: 1.4 !important;
    margin-top: 1.33em !important;
    margin-bottom: 1.33em !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) h5 { 
    font-size: 18px !important; 
    line-height: 1.5 !important;
    margin-top: 1.67em !important;
    margin-bottom: 1.67em !important;
}
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) h6 { 
    font-size: 16px !important; 
    line-height: 1.6 !important;
    margin-top: 2.33em !important;
    margin-bottom: 2.33em !important;
}

/* 9. ELEMENTOS DESHABILITADOS - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) [disabled],
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* 10. MENSAJES DE ERROR - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .error,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .error-message,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .woocommerce-error {
    background-color: #d32f2f !important;
    color: #ffffff !important;
    padding: 10px !important;
    border-radius: 4px !important;
}

/* 11. DIVI BUILDER PARALLAX - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_section_parallax .et_pb_row,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_slides .et_pb_slide_description {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

/* 12. ELEMENTOS INTERACTIVOS MÓVILES - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_mobile_menu li a:hover,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_mobile_menu li.current-menu-item a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .mobile_menu_bar:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* 13. TABLAS - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) table th {
    background-color: #f5f5f5 !important;
    color: #1a1a1a !important;
}

body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) table td {
    border-color: #d0d0d0 !important;
}

/* 14. TABINDEX - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) [tabindex]:not([tabindex="-1"]):not([tabindex="0"]) {
    position: relative !important;
}

/* 15. ICONOS SOCIALES HOVER - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et-social-icon a:hover::after,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .et_pb_social_media_follow_network_name {
    position: absolute !important;
    background: #1a1a1a !important;
    color: #ffffff !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
    z-index: 9999 !important;
}

/* 16. SKIP LINKS - SOLO FRONTEND */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor):not(.et_pb_pagebuilder_layout.et_pb_pagebuilder_preview) .screen-reader-text:focus {
    position: absolute !important;
    left: 6px !important;
    top: 7px !important;
    z-index: 999999 !important;
    clip: auto !important;
    display: block !important;
    padding: 10px 15px !important;
    background: #000000 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    text-decoration: none !important;
    border-radius: 3px !important;
}

/* ============================================
   CORRECCIÓN ADICIONAL PARA ENLACES #2ea3f2
   Asegura que TODOS los enlaces cumplan WCAG 2.1 AA
   ============================================ */

/* Sobrescribir TODOS los elementos con color #2ea3f2 */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) a[style*="color:#2ea3f2"],
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) a[style*="color:#2EA3F2"],
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) a[style*="color: #2ea3f2"],
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) a[style*="color: #2EA3F2"],
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) .et_pb_bg_layout_light a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) #main-header a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) #top-menu a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) .nav li a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) #footer-widgets a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) #footer-bottom a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) .entry-content a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) .et_pb_text a,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) .et_pb_module a {
    color: #000000 !important;
}

/* Asegurar que los botones con fondo oscuro mantengan su estilo */
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) .et_pb_bg_layout_dark .et_pb_button,
body:not(.wp-admin):not(.et-fb):not(.et-fb-iframe-ancestor) .et_pb_button.et_pb_bg_layout_dark {
    color: #ffffff !important;
}

/* ============================================
   VERIFICACIÓN PARA ADMIN Y BUILDER
   Los estilos originales se mantienen en:
   - Panel admin WordPress
   - Divi Visual Builder
   - Vista previa del builder
   ============================================ */