/*
 * Menú de accesibilidad ampliado y modo de alto contraste — Visores Territoriales y Campus Virtual.
 * Observaciones 2.2, 2.5, V1 y C7 del MinCIT (19-nov-2026).
 *
 * UNA sola fuente para los dos sitios (vision-region-visores/public/assets/a11y/); el tema del Campus lleva una copia
 * idéntica en publico/a11y/. Va con vr-a11y-menu.js.
 *
 * ALTO CONTRASTE. La versión anterior oscurecía una lista fija de selectores y forzaba el color del texto por
 * etiqueta: toda caja con `background:#fff` escrito a mano que no estuviera en la lista se quedaba blanca con el
 * texto ya en blanco (71 textos ilegibles en la portada, según el MinCIT). Aquí es al revés: TODO elemento pasa a
 * fondo negro y texto blanco, y solo se exceptúa lo que se nombra (imágenes, gráficos y los soportes de logotipo,
 * que necesitan fondo claro y no llevan texto). Amarillo #F9B81B para enlaces, títulos y controles: 11,9:1 sobre
 * negro. Blanco sobre negro: 21:1.
 */

/* ── Alto contraste universal ─────────────────────────────────────────────── */
html.a11y-contrast-raiz { background: #000 !important; }
/* :where() deja esta regla con la especificidad de `body.a11y-contrast` (0,1,1): cualquier regla posterior del modo
   (enlaces, títulos, botones) le gana sin pelear, y con !important le gana a todo el CSS normal del sitio. */
body.a11y-contrast,
body.a11y-contrast :where(*:not(img, svg, svg *, canvas, video, iframe, .a11y-fondo-claro, .a11y-fondo-claro *)) {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
body.a11y-contrast a,
body.a11y-contrast a *:not(img):not(svg):not(svg *),
body.a11y-contrast h1, body.a11y-contrast h2, body.a11y-contrast h3,
body.a11y-contrast h4, body.a11y-contrast h5, body.a11y-contrast h6,
body.a11y-contrast h1 *, body.a11y-contrast h2 *, body.a11y-contrast h3 * { color: #F9B81B !important; }
body.a11y-contrast a { text-decoration: underline !important; }
/* Controles: rótulo amarillo sobre negro con borde amarillo; el estado activo se marca con el borde doble, no
   invirtiendo colores (un fondo amarillo con texto heredado blanco es el 1,76:1 que señaló el MinCIT). */
body.a11y-contrast button,
body.a11y-contrast [role="button"],
body.a11y-contrast input[type="submit"],
body.a11y-contrast input[type="button"],
body.a11y-contrast .btn,
body.a11y-contrast button *:not(img):not(svg):not(svg *) { color: #F9B81B !important; }
body.a11y-contrast button,
body.a11y-contrast [role="button"],
body.a11y-contrast .btn,
body.a11y-contrast input,
body.a11y-contrast select,
body.a11y-contrast textarea { border: 2px solid #F9B81B !important; }
body.a11y-contrast [aria-pressed="true"],
body.a11y-contrast [aria-checked="true"],
body.a11y-contrast [aria-current="page"],
body.a11y-contrast [aria-selected="true"] { outline: 3px double #F9B81B !important; outline-offset: 1px; }
body.a11y-contrast :focus-visible { outline: 3px solid #F9B81B !important; outline-offset: 2px !important; }
body.a11y-contrast input::placeholder, body.a11y-contrast textarea::placeholder { color: #D9D9D9 !important; }
/* Enlace de salto: amarillo sobre negro, también con foco (antes podía quedar amarillo sobre amarillo). */
body.a11y-contrast .sr-only-focusable:focus,
body.a11y-contrast .vr-skip-link:focus { background: #000 !important; color: #F9B81B !important; outline: 3px solid #F9B81B !important; }
/* Gráficos de lienzo y SVG: se invierten con corrección de tono. Las etiquetas y ejes, oscuros sobre blanco en el
   modo normal, pasan a claros sobre negro conservando el contraste que ya tenían; los colores de serie se mantienen
   reconocibles. */
body.a11y-contrast canvas { filter: invert(1) hue-rotate(180deg) !important; }
body.a11y-contrast svg text, body.a11y-contrast svg tspan { fill: #fff !important; }
/* Soportes de logotipo: conservan el fondo claro (los logotipos a color sobre negro desaparecen). No llevan texto. */
body.a11y-contrast .a11y-fondo-claro { background-color: #fff !important; }

/* ── Ajustes del menú ─────────────────────────────────────────────────────── */
html.a11y-espaciado body { letter-spacing: .12em !important; word-spacing: .16em !important; }
html.a11y-espaciado body p, html.a11y-espaciado body li, html.a11y-espaciado body td,
html.a11y-espaciado body dd { line-height: 1.8 !important; }
html.a11y-espaciado body p { margin-bottom: 2em !important; }
html.a11y-grises { filter: grayscale(1); }
html.a11y-invertir { filter: invert(1) hue-rotate(180deg); }
html.a11y-grises.a11y-invertir { filter: grayscale(1) invert(1) hue-rotate(180deg); }
html.a11y-invertir img, html.a11y-invertir video, html.a11y-invertir picture { filter: invert(1) hue-rotate(180deg); }
html.a11y-enlaces a { text-decoration: underline !important; text-decoration-thickness: 2px !important;
    background: #FFF3C4 !important; color: #000 !important; outline: 1px solid #000; }
html.a11y-resaltar :focus { outline: 4px solid #F9B81B !important; outline-offset: 3px !important;
    box-shadow: 0 0 0 7px #000 !important; }
html.a11y-resaltar h1, html.a11y-resaltar h2, html.a11y-resaltar h3 { outline: 2px dashed currentColor; outline-offset: 4px; }
html.a11y-sin-animaciones *, html.a11y-sin-animaciones *::before, html.a11y-sin-animaciones *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-alinear body p, html.a11y-alinear body li, html.a11y-alinear body td,
html.a11y-alinear body h1, html.a11y-alinear body h2, html.a11y-alinear body h3,
html.a11y-alinear body dd { text-align: left !important; }
html.a11y-voz body { cursor: help; }

/* ── Panel flotante ───────────────────────────────────────────────────────── */
.vr-a11y-flotante { position: fixed; inset-inline-end: 0; top: 32vh; z-index: 900;
    background: #004884; border-radius: 10px 0 0 10px; padding: 12px 0 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28); font-family: 'Nunito Sans', 'Nunito Sans Fallback', Verdana, sans-serif; }
.vr-a11y-flotante .vr-a11y { display: flex; flex-direction: column; gap: 0; }
.vr-a11y-flotante .vr-a11y button { position: relative; background: transparent; color: #fff; border: 0;
    border-radius: 0; width: 48px; height: 44px; font-size: 20px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.vr-a11y-flotante .vr-a11y button:hover { background: rgba(255, 255, 255, .16); }
.vr-a11y-flotante .vr-a11y button:focus-visible { outline: 3px solid #FECC2F; outline-offset: -3px; }
.vr-a11y-flotante .vr-a11y button[aria-pressed="true"] { background: #FECC2F; color: #000; }
.vr-a11y-abrir-ico { font-size: 22px; }
.vr-a11y-flotante .vr-a11y-txt { position: absolute; inset-inline-end: 100%; top: 0; height: 100%; padding: 0 14px;
    display: flex; align-items: center; white-space: nowrap; pointer-events: none;
    background: #004884; color: #fff; border-radius: 8px 0 0 8px; font-size: 14px; font-weight: 700;
    opacity: 0; transform: translateX(10px); visibility: hidden;
    transition: opacity .18s ease, transform .25s ease, visibility 0s linear .18s; }
.vr-a11y-flotante .vr-a11y button:hover .vr-a11y-txt,
.vr-a11y-flotante .vr-a11y button:focus-visible .vr-a11y-txt { opacity: 1; transform: translateX(0); visibility: visible;
    transition: opacity .18s ease, transform .25s ease, visibility 0s; }
.vr-a11y-flotante .vr-a11y button[aria-pressed="true"] .vr-a11y-txt { background: #FECC2F; color: #000; }
/* Pantalla estrecha: fila horizontal abajo a la IZQUIERDA, la única esquina libre (a la derecha va «volver arriba»).
   Pegado al lateral se montaba encima del texto que pretende ayudar a leer (medido en el Campus a 375 px). */
@media (max-width: 767px) {
    .vr-a11y-flotante { top: auto; bottom: 0; inset-inline-start: 0; inset-inline-end: auto;
        border-radius: 0 10px 0 0; padding: 0; }
    .vr-a11y-flotante .vr-a11y { flex-direction: row; }
    .vr-a11y-flotante .vr-a11y button { width: 44px; height: 44px; }
    .vr-a11y-flotante .vr-a11y-txt { display: none; }
}

/* ── Menú ─────────────────────────────────────────────────────────────────── */
.vr-a11y-menu { position: absolute; inset-inline-end: 56px; top: -40px; width: min(440px, calc(100vw - 72px));
    max-height: min(78vh, 640px); overflow-y: auto; background: #fff; color: #1F1F1F;
    border: 2px solid #004884; border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
    font-size: 14px; text-align: left; }
.vr-a11y-menu[hidden] { display: none; }
@media (max-width: 767px) { .vr-a11y-menu { position: fixed; inset-inline: 8px; top: auto; bottom: 52px; width: auto; max-height: 72vh; } }
.vr-a11y-menu-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: #004884; color: #fff; margin: -14px -16px 10px; padding: 10px 14px; border-radius: 9px 9px 0 0; }
.vr-a11y-menu-tit { margin: 0; font-size: 17px; font-weight: 800; color: #fff; font-family: inherit; }
.vr-a11y-cerrar { background: transparent; color: #fff; border: 2px solid #fff; border-radius: 50%;
    width: 32px; height: 32px; font-size: 20px; line-height: 1; cursor: pointer; }
.vr-a11y-cerrar:focus-visible { outline: 3px solid #FECC2F; outline-offset: 2px; }
.vr-a11y-menu-sub { margin: 12px 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
    color: #004884; font-weight: 800; font-family: inherit; }
.vr-a11y-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .vr-a11y-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vr-a11y-op { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 72px; padding: 8px 6px; border: 1px solid #8A8A8A; border-radius: 10px; background: #fff;
    color: #1F1F1F; font: inherit; font-size: 12.5px; line-height: 1.25; cursor: pointer; text-align: center; }
.vr-a11y-op:hover { border-color: #004884; background: #EEF4FB; }
.vr-a11y-op:focus-visible { outline: 3px solid #004884; outline-offset: 2px; }
.vr-a11y-op[aria-pressed="true"] { background: #004884; color: #fff; border-color: #004884; }
.vr-a11y-op-ico { font-size: 20px; line-height: 1; }
.vr-a11y-perfiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .vr-a11y-perfiles { grid-template-columns: 1fr; } }
.vr-a11y-perfil { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 10px;
    border: 1px solid #8A8A8A; border-radius: 10px; background: #fff; color: #1F1F1F; font: inherit; cursor: pointer;
    text-align: left; }
.vr-a11y-perfil:hover { border-color: #004884; background: #EEF4FB; }
.vr-a11y-perfil:focus-visible { outline: 3px solid #004884; outline-offset: 2px; }
.vr-a11y-perfil[aria-checked="true"] { background: #004884; color: #fff; border-color: #004884; }
.vr-a11y-perfil-nom { font-weight: 800; font-size: 13px; }
.vr-a11y-perfil-ayuda { font-size: 12px; }
.vr-a11y-menu-pie { margin: 12px 0 0; font-size: 13px; }
.vr-a11y-menu-pie a { color: #004884; text-decoration: underline; font-weight: 700; }
.vr-a11y-nota { margin: 10px 0 0; font-size: 12px; color: #4D4D4D; }
.vr-a11y-vivo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.vr-a11y-txt { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .vr-a11y-flotante .vr-a11y-txt { transition: none; transform: none; } }

/* Botones primarios del sitio: el diseño normal los pinta de amarillo con texto oscuro; en este modo se unifican con
   el resto de controles (amarillo sobre negro), así ningún hijo queda amarillo sobre amarillo. */
body.a11y-contrast .vr-btn-primary, body.a11y-contrast .btn-primary,
body.a11y-contrast .vr-btn-primary *, body.a11y-contrast .btn-primary * {
    background: #000 !important; color: #F9B81B !important; }
