/*
 * Capa de accesibilidad del tema WebLimpieza (WCAG 2.1 AA, la referencia de la norma
 * UNE-EN 301 549). Se carga la última en todo el sitio, detrás de Divi, el plugin del
 * directorio y el resto de hojas del tema. Solo corrige lo que afecta a la accesibilidad.
 * Author: Presencia en internet.
 */

/* 1. Foco visible con contraste de 3:1 como mínimo frente al fondo (1.4.11 y 2.4.7).
      Azul sobre superficies claras; cian sobre las oscuras. */
body.wl-brand { --wl-focus: #0565d7; }
body.wl-brand .wlb-footer,
body.wl-brand .wl-selection-bar,
body.wl-brand .wl3 > .wl-intro,
body.wl-brand .wl3 > .wl3-bottom,
body.wl-brand .wl3--company > .wl3-hero,
body.wl-brand .wlb-editorial-callout,
body.wl-brand:not(.wl-dir-v3) .wl-company .wl-contact,
body.wl-brand #moove_gdpr_cookie_info_bar { --wl-focus: #32c4f0; }
body.wl-brand :focus-visible,
body.wl-brand .wl3 .wl-company-select:has(:focus-visible) { outline-color: var(--wl-focus) !important; }
/* Aviso, ventana y botón flotante de cookies (plugin GDPR Cookie Compliance): sus botones no
   marcaban el foco y sus interruptores esconden la casilla real. */
body.wl-brand :is(#moove_gdpr_cookie_info_bar, #moove_gdpr_cookie_modal) :is(a, button):focus-visible,
body.wl-brand #moove_gdpr_save_popup_settings_button:focus-visible {
    outline: 3px solid var(--wl-focus) !important;
    outline-offset: 2px !important;
}
body.wl-brand #moove_gdpr_cookie_modal .cookie-switch:has(input:focus-visible) {
    outline: 3px solid var(--wl-focus);
    outline-offset: 3px;
    border-radius: 20px;
}

/* 2. Campos de formulario: el borde que los delimita, a 3:1 como mínimo (1.4.11). */
body.wl-brand :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="image"]):not([type="range"]):not([type="color"]), select, textarea) {
    border-color: #75879e !important;
}
body.wl-brand :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]), select, textarea):focus {
    border-color: var(--wl-focus) !important;
}
/* Divi dibuja estos campos sin borde y con un gris casi igual que el fondo. */
body.wl-brand #commentform :is(input[type="text"], input[type="email"], input[type="url"], textarea),
body.wl-brand .et_pb_contact_form :is(input.input, textarea.input, select) {
    border: 1px solid #75879e !important;
    background-color: #fff;
}

/* 3. Textos de ejemplo dentro de los campos: 4,5:1 (1.4.3). */
body.wl-brand :is(input, textarea)::placeholder { color: #5f6f84 !important; opacity: 1; }
body.wl-brand:not(.wl-dir-v3) .wl-company .wl-contact :is(input, textarea)::placeholder { color: #c3d2e3 !important; }

/* 4. Enlaces dentro de un texto: subrayados, para no depender solo del color (1.4.1). */
body.wl-brand :is(main, #main-content) :is(p, dd, td, th, figcaption, blockquote) a:not([class]),
body.wl-brand :is(main, #main-content) :is(.entry-content, .post-content, .wl-description, .et_pb_text_inner) li a:not([class]) {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

/* 5. Diseño anterior del directorio (solo lo ven los visitantes mientras el nuevo no esté
      activado): el aviso «¿Es tu empresa?» del plugin 0.10 quedaba oscuro sobre oscuro. */
body.wl-brand:not(.wl-dir-v3) .wl-company .wl-contact .wl-claim { color: #d6e2f0; }
body.wl-brand:not(.wl-dir-v3) .wl-company .wl-contact .wl-claim a { color: #9be3ff; }

/* 6. Quien pide menos movimiento no ve animaciones ni desplazamientos suaves. */
@media (prefers-reduced-motion: reduce) {
    body.wl-brand *,
    body.wl-brand *::before,
    body.wl-brand *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
