/* Panel de accesibilidad y clases de preferencia. Usa los tokens del sistema (--piedra, --papel, --tinta, --accion…). */

/* ---------- botón flotante ---------- */
.a11y-flotante{position:fixed;left:16px;bottom:16px;z-index:65;width:52px;height:52px;display:grid;place-items:center;padding:0;border-radius:50%;
  background:var(--accion);color:var(--accion-t,#fff);border:3px solid var(--papel);box-shadow:0 4px 16px rgb(0 0 0/.28);cursor:pointer;transition:transform .2s,background .2s}
.a11y-flotante:hover{background:var(--accion-h);transform:scale(1.06)}
.a11y-flotante:focus-visible{outline:3px solid var(--tinta);outline-offset:3px}
@media print{.a11y-flotante{display:none}}

/* ---------- diálogo ---------- */
.a11y-dialogo{border:0;padding:0;background:transparent;color:var(--tinta);width:min(640px,calc(100vw - 2*var(--s2)));max-height:calc(100vh - 2*var(--s2));overflow:visible}
.a11y-dialogo::backdrop{background:rgb(20 15 12/.7)}
.a11y-dialogo__caja{background:var(--piedra);border:1px solid var(--linea);border-top:6px solid var(--accion);border-radius:12px;padding:var(--s3);max-height:calc(100vh - 2*var(--s2));overflow:auto;box-shadow:0 18px 50px rgb(0 0 0/.35)}
.a11y-dialogo__cab{display:flex;align-items:center;justify-content:space-between;gap:var(--s2)}
.a11y-dialogo__titulo{margin:0;display:flex;align-items:center;gap:var(--s1);font:700 var(--t-3)/1.2 var(--f-ui);color:var(--tinta)}
.a11y-dialogo__titulo svg{color:var(--tinta-lad)}
.a11y-dialogo__txt{margin:var(--s1) 0 var(--s2);font-size:var(--t-0);color:var(--tinta-2)}
.a11y-grupo{border:0;border-top:1px solid var(--linea);margin:0;padding:var(--s2) 0 0;min-width:0}
.a11y-grupo+.a11y-grupo{margin-top:var(--s2)}
.a11y-grupo legend{font:700 var(--t-1) var(--f-ui);color:var(--tinta);padding:0 var(--s1) 0 0}
.a11y-fila{display:flex;gap:var(--s1);flex-wrap:wrap;margin-top:var(--s1)}
.a11y-rejilla{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s1);margin-top:var(--s2)}
@media (max-width:560px){.a11y-rejilla{grid-template-columns:repeat(2,minmax(0,1fr))}}
.a11y-tile{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;min-height:118px;padding:14px 8px 12px;text-align:center;
  font:700 var(--t-0)/1.25 var(--f-ui);color:var(--tinta);background:var(--papel);border:2px solid var(--linea-fuerte);border-radius:14px;cursor:pointer;transition:background var(--dur),color var(--dur),border-color var(--dur),transform .15s}
.a11y-tile:hover{border-color:var(--accion);transform:translateY(-1px)}
.a11y-tile__ico{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;background:var(--piedra-2);color:var(--tinta-lad)}
.a11y-tile__nombre{display:block}
.a11y-tile__valor{display:block;font-weight:400;font-size:.8rem;opacity:.85}
.a11y-tile__nivel{display:flex;gap:4px;min-height:8px}
.a11y-tile__nivel i{width:18px;height:6px;border-radius:3px;background:currentColor;opacity:.25}
.a11y-tile__nivel i.on{opacity:1}
.a11y-tile__ok{position:absolute;top:8px;right:8px;width:20px;height:20px;border-radius:50%;display:none;place-items:center;font-size:.72rem;background:currentColor}
.a11y-tile[aria-pressed="true"]{background:var(--accion);border-color:var(--accion);color:var(--accion-t,#fff)}
.a11y-tile[aria-pressed="true"] .a11y-tile__ico{background:rgb(255 255 255/.18);color:inherit}
.a11y-tile[aria-pressed="true"] .a11y-tile__ok{display:grid;color:var(--tinta-lad);background:var(--accion-t,#fff)}
.a11y-tile[aria-pressed="true"] .a11y-tile__ok{color:var(--tinta-lad)}
.a11y-btn{min-height:44px;min-width:44px;padding:0 var(--s2);font:700 var(--t-1)/1.2 var(--f-ui);color:var(--tinta);background:var(--papel);border:2px solid var(--linea-fuerte);border-radius:10px;cursor:pointer;transition:background var(--dur),color var(--dur),border-color var(--dur)}
.a11y-btn:hover:not(:disabled){border-color:var(--accion);background:var(--piedra-2)}
.a11y-pie{display:flex;gap:var(--s2);align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:var(--s3)}
.a11y-enlace{color:var(--enlace);font-size:var(--t-0)}
.a11y-reset{color:var(--tinta-lad)}
.a11y-primario{background:var(--accion);border-color:var(--accion);color:var(--accion-t,#fff)}
.a11y-primario:hover:not(:disabled){background:var(--accion-h);border-color:var(--accion-h)}
.a11y-cerrar{flex:none}
.a11y-dialogo :focus-visible{outline:3px solid var(--tinta);outline-offset:3px}
.a11y-vivo{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- efectos ---------- */
/* Tipografía sencilla */
html.a11y-fuente{--f-display:var(--f-ui);--f-titulo:var(--f-ui)}
html.a11y-fuente :is(h1,h2,h3,h4){font-family:var(--f-ui);font-weight:700}
/* Movimiento */
html.a11y-sin-movimiento *,html.a11y-sin-movimiento *::before,html.a11y-sin-movimiento *::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}
html.a11y-sin-movimiento .fv__lineas{opacity:0}
/* Espaciado de texto (WCAG 1.4.12) */
html.a11y-espaciado body{letter-spacing:.12em;word-spacing:.16em}
html.a11y-espaciado p{margin-bottom:2em}
/* Interlineado */
html.a11y-interlineado :is(body,p,li,dd,td,a,span,label){line-height:1.9}
html.a11y-interlineado :is(h1,h2,h3,h4){line-height:1.35}
/* Enlaces */
html.a11y-enlaces a:not(.a11y-flotante){text-decoration:underline!important;text-decoration-thickness:2px;text-underline-offset:3px;background:color-mix(in srgb,var(--oro) 28%,transparent)}
/* Títulos */
html.a11y-titulos :is(h1,h2,h3,h4){outline:2px dashed var(--accion);outline-offset:6px;background:color-mix(in srgb,var(--oro) 22%,transparent)}
/* Cursor grande */
html.a11y-cursor,html.a11y-cursor *{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 9-6.5 1.6L9.5 19z' fill='%23000' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2,auto!important}
html.a11y-cursor a,html.a11y-cursor a *,html.a11y-cursor button,html.a11y-cursor button *,html.a11y-cursor [role="button"]{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M9 2.5a1.5 1.5 0 013 0V9l6 1.5c1 .3 1.5 1 1.5 2V17c0 3-2 5-5 5h-3c-2 0-3.5-1-4.5-2.5L4 14.5c-.6-1 .3-2.2 1.4-1.7L8 14V4' fill='%23fff' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 14 4,pointer!important}
/* Guía de lectura */
.a11y-guia-lectura{position:fixed;left:0;right:0;top:0;height:44px;z-index:70;pointer-events:none;background:rgb(255 214 64/.22);border-block:2px solid rgb(0 0 0/.55);box-shadow:0 0 0 100vmax rgb(0 0 0/.0)}
.a11y-guia-lectura[hidden]{display:none}
/* Ocultar imágenes */
html.a11y-sin-imagenes :is(img,picture,video,svg.motivo,canvas):not(.logo):not(.a11y-flotante *):not(.a11y-dialogo *){visibility:hidden!important}
html.a11y-sin-imagenes :is(.mot-palacio,.fv,.hero-inmersivo,.escena,.im,.nt__im,.paisaje-sangre__img){background-image:none!important}
html.a11y-sin-imagenes .fv{display:none}

/* ---------- contraste alto: se redefinen los tokens, así sirve para todas las páginas ---------- */
html.a11y-contraste:not(#_){color-scheme:light;
  --piedra:#fff;--piedra-2:#fff;--piedra-3:#fff;--papel:#fff;--fondo:#fff;--mortero:#fff;--pie-bg:#fff;--terracota-claro:#fff;
  --tinta:#000;--tinta-2:#000;--tinta-az:#000;--tinta-lad:#5c0000;--linea:#000;--linea-fuerte:#000;
  --enlace:#0000a8;--enlace-v:#4b0082;--accion:#5c0000;--accion-h:#000;--accion-t:#fff;--ladrillo:#5c0000;--azul:#000;--noche:#000;
  --jardin:#003d10;--rio:#004455;--oro:#ffd400;--acento:#000;--error:#8a0000;--atm-a:#fff;--atm-b:#fff}
html.a11y-contraste-noche:not(#_){color-scheme:dark;
  --piedra:#000;--piedra-2:#000;--piedra-3:#000;--papel:#000;--fondo:#000;--mortero:#000;--pie-bg:#000;--terracota-claro:#000;
  --tinta:#fff;--tinta-2:#fff;--tinta-az:#fff;--tinta-lad:#ffd400;--linea:#fff;--linea-fuerte:#fff;
  --enlace:#ffd400;--enlace-v:#ff9ee6;--accion:#ffd400;--accion-h:#fff;--accion-t:#000;--ladrillo:#ffd400;--azul:#fff;--noche:#000;
  --jardin:#7dff9a;--rio:#7de8ff;--oro:#ffd400;--acento:#ffd400;--error:#ff8a8a;--atm-a:#000;--atm-b:#000}
html:is(.a11y-contraste,.a11y-contraste-noche) body{background:var(--piedra);color:var(--tinta)}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(p,li,span,td,th,dd,dt,label,small,figcaption,h1,h2,h3,h4){color:var(--tinta)}
html:is(.a11y-contraste,.a11y-contraste-noche) a{color:var(--enlace);text-decoration:underline}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.btn,.btn-sede,button[type=submit],.hh__campo button){border:2px solid var(--tinta)}
html:is(.a11y-contraste,.a11y-contraste-noche) *:focus-visible{outline:4px solid var(--tinta)!important;outline-offset:4px!important;box-shadow:0 0 0 4px var(--oro)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .cabecera{background:var(--piedra);backdrop-filter:none}
html:is(.a11y-contraste,.a11y-contraste-noche) .fv__lienzo,html:is(.a11y-contraste,.a11y-contraste-noche) .hh{background:var(--piedra)}
html.a11y-contraste-noche .fv__lienzo>img.fv__d,html.a11y-contraste-noche .hh__credito--dia{display:none}
html.a11y-contraste-noche .fv__lienzo>img.fv__n{display:block}
html.a11y-contraste-noche .cabecera .logo--color{display:none}
html.a11y-contraste-noche .cabecera .logo--blanco{display:block}
html.a11y-contraste .cabecera .logo--blanco{display:none}
html.a11y-contraste .cabecera .logo--color{display:block}
html.a11y-contraste .a11y-dialogo::backdrop,html.a11y-contraste-noche .a11y-dialogo::backdrop{background:rgb(0 0 0/.88)}
/* contraste alto de fondo claro aunque el tema sea nocturno */
html.a11y-contraste.tema-oscuro .cabecera .logo--blanco{display:none}
html.a11y-contraste.tema-oscuro .cabecera .logo--color{display:block}
html.a11y-contraste.tema-oscuro .fv__lienzo>img.fv__d,html.a11y-contraste.tema-oscuro .hh__credito--dia{display:block}
html.a11y-contraste.tema-oscuro .fv__lienzo>img.fv__n,html.a11y-contraste.tema-oscuro .hh__credito--noche{display:none}
html.a11y-contraste-noche .hh__credito--noche{display:inline}
html.a11y-contraste-noche:not(.tema-oscuro) .cabecera .logo--blanco{display:block}


/* ======================================================================================================
   Contraste alto (claro y noche), segunda parte: superficies decorativas y etiquetas.
   Los tokens ya dan texto negro (o blanco) sobre blanco (o negro). Lo que fallaba eran los contenedores con
   fondo fijo propio (cabeceras, héroes, tarjetas oscuras) y las etiquetas con fondo de color. Aquí pasan a la
   superficie del modo, con borde, y sus textos con color fijo (#fff…) usan los tokens.
   ====================================================================================================== */
html:is(.a11y-contraste,.a11y-contraste-noche) :is(
  .sv-cab,.legal-cab,.util-cab,.tr-cab,.ayto-hero,.ct-hero,.tp-hero,.tp-lh,.ev-hero,.ev-dato,.gob,.escena,.fi-accion,
  .cc-card--grande,.ct-em,.tp-grua,.tp-oficina,.dc--alto,.ac-canal,.cap__panel,.sec-hero,.ag-cab,.pais-hero,.hist-hero,.banda
):not(#_){background:var(--papel)!important;background-image:none!important;color:var(--tinta)!important;border-block:3px solid var(--tinta)}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(
  .sv-cab,.legal-cab,.util-cab,.tr-cab,.ayto-hero,.ct-hero,.tp-hero,.tp-lh,.ev-hero,.gob,.escena,.fi-accion,.ct-em,.sec-hero,.ag-cab,.pais-hero,.hist-hero,.banda
):not(#_)::before,html:is(.a11y-contraste,.a11y-contraste-noche) :is(
  .sv-cab,.legal-cab,.util-cab,.tr-cab,.ayto-hero,.ct-hero,.tp-hero,.tp-lh,.ev-hero,.gob,.escena,.fi-accion,.ct-em,.sec-hero,.ag-cab,.pais-hero,.hist-hero,.banda
):not(#_)::after{display:none!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(
  .sv-cab,.legal-cab,.util-cab,.tr-cab,.ayto-hero,.ct-hero,.tp-hero,.tp-lh,.ev-hero,.ev-dato,.gob,.escena,.fi-accion,
  .cc-card--grande,.ct-em,.tp-grua,.tp-oficina,.dc--alto,.ac-canal,.cap__panel,.sec-hero,.ag-cab,.pais-hero,.hist-hero,.banda
) :is(h1,h2,h3,h4,h5,p,li,dt,dd,small,time,figcaption,label,blockquote,cite,b,strong,em,i,span,div):not(#_){color:var(--tinta)!important;text-shadow:none!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(
  .sv-cab,.legal-cab,.util-cab,.tr-cab,.ayto-hero,.ct-hero,.tp-hero,.tp-lh,.ev-hero,.ev-dato,.gob,.escena,.fi-accion,
  .cc-card--grande,.ct-em,.tp-grua,.tp-oficina,.dc--alto,.ac-canal,.cap__panel,.sec-hero,.ag-cab,.pais-hero,.hist-hero,.banda
) a:not(.btn):not(.tp-num):not(.sv-grande):not(.chip):not(#_){color:var(--enlace)!important}

/* botones: rellenos = color de acción; de contorno o claros = superficie con borde */
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.btn--ladrillo,.btn--azul,.btn--oro,.sv-grande,.btn:not(.btn--linea):not(.btn--claro):not(.btn--noche-linea):not(.btn--linea-clara)):not(#_){background:var(--accion)!important;background-image:none!important;color:var(--accion-t)!important;border:2px solid var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.btn--linea,.btn--claro,.btn--noche-linea,.btn--linea-clara,.chip-f,.chip):not(#_){background:var(--papel)!important;color:var(--tinta)!important;border:2px solid var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.btn,.sv-grande,.chip-f) :is(span,b,i,strong,small,em):not(#_){color:inherit!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .sv-grande--sede:not(#_){background:var(--azul)!important;color:var(--accion-t)!important}

/* etiquetas pequeñas con fondo propio: texto/fondo invertidos respecto a la superficie */
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.tp-num,.tp-chip span,.ct-hoy,.ct-sede__n,.lugar__n,.mem__mes,.bot-fab__ia,.chip-f__n,.nt__dest,.prod-estado-big,.ev-fecha,.tp-paradas__l a.tp-num):not(#_){background:var(--tinta)!important;background-image:none!important;color:var(--papel)!important;border:2px solid var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .ev-fecha :is(b,span):not(#_){color:var(--papel)!important}

/* tablas: cabeceras con la superficie del modo */
html:is(.a11y-contraste,.a11y-contraste-noche) :is(th,thead td):not(#_){background:var(--papel)!important;color:var(--tinta)!important;border:2px solid var(--tinta)}
html:is(.a11y-contraste,.a11y-contraste-noche) th>:is(h2,h3,h4,h5):not(#_){color:inherit!important}

/* rótulos sobre imágenes y sobre el mapa: fondo sólido */
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.pais-hero__foto figcaption,.tp-mapa__cred,figure figcaption):not(#_){background:var(--papel)!important;color:var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .tp-mapa__cred a:not(#_){color:var(--enlace)!important}

/* Contraste alto, tercera parte: paneles de texto sobre fotos, fondos atmosféricos de temporada y controles sueltos */
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.tp-modo a,.tp-modo__t,.cc-card,.cc-card__txt,.dc__txt,.ac-canal,.ac-canal__txt):not(#_){background:var(--papel)!important;background-image:none!important;color:var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.tp-modo a,.tp-modo__t,.cc-card,.cc-card__txt,.dc__txt) :is(h1,h2,h3,h4,p,li,small,b,strong,em,i,span,div):not(#_){color:var(--tinta)!important;text-shadow:none!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.tp-modo a,.cc-card) :is(.tp-modo__img,.cc-card__img){opacity:.35}
html:is(.a11y-contraste,.a11y-contraste-noche) .ag-atm:not(#_){--ag-atm:var(--papel)!important;background:var(--papel)!important;background-image:none!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .meses li.on:not(#_){background:var(--tinta)!important;color:var(--papel)!important;border-color:var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .maq__ctrl:not(#_){color:var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .maq__ctrl button:not(#_){background:var(--papel)!important;color:var(--tinta)!important;border:2px solid var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) figcaption a:not(#_){color:var(--enlace)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .tp-modo__ic:not(#_){background:var(--tinta)!important;background-image:none!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not(#_){background:var(--papel)!important;color:var(--tinta)!important;border:2px solid var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.menu-boton,.bot__chip--llamar):not(#_){background:var(--tinta)!important;color:var(--papel)!important;border:2px solid var(--tinta)!important}
html:is(.a11y-contraste,.a11y-contraste-noche) :is(.menu-boton,.bot__chip--llamar) :is(span,svg):not(#_){color:inherit!important}
html:is(.a11y-contraste,.a11y-contraste-noche) .tp-modo a .tp-modo__ic :is(i,span,b):not(#_){background:var(--papel)!important;background-image:none!important;color:var(--tinta)!important;border:2px solid var(--tinta)!important}
