/* Secuencias contrastadas con Ydins. Se mantienen también con movimiento reducido,
   por la decisión editorial explícita de reproducir los efectos originales. */
[data-reveal-state="pending"] { opacity: 0; }
[data-reveal-state="animating"] { animation: content-enter 1000ms ease var(--reveal-delay, 0ms) both; }
[data-reveal-state="visible"] { opacity: 1; }
@keyframes content-enter { from { opacity: 0; } to { opacity: 1; } }

/* Cada slide conserva su caja; el motor cancela las secuencias al navegar rápido. */
.hero-slide[data-leaving] { opacity: 1; visibility: visible; pointer-events: none; }
.hero-slide-caption { isolation: isolate; }
.hero-caption-panel { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgb(0 0 0 / 75%); }
.hero-caption-text { display: block; }
[data-carousel] { touch-action: pan-y pinch-zoom; }
[data-carousel-ready] [data-carousel-track] { user-select: none; }
[data-dragging] { cursor: grabbing; }
.carousel-controls, .sector-arrow, .gallery-controls { visibility: hidden; }
[data-carousel-ready] .carousel-controls, [data-carousel-ready] .sector-arrow,
[data-carousel-ready] .gallery-controls { visibility: visible; }
[data-carousel-static] .carousel-controls, [data-carousel-static] .sector-arrow,
[data-carousel-static] .gallery-controls { display: none; }
.editorial-viewport { overflow-x: auto; }
.editorial-track { display: flex; gap: 24px; }
.editorial-track > figure { flex: 0 0 calc((100% - 24px) / 2); }
[data-carousel-ready] .editorial-viewport { overflow: hidden; }
/* Galerías de varias imágenes (01-10-2026, corrección de los compañeros): como en ydins.es, las vecinas asoman
   atenuadas (opacidad .2) hasta el borde de la pantalla en escritorio, y se ve que hay más fotos. Siguen inertes
   (ni foco ni clic) y .main-content recorta en horizontal, así que no aparece desplazamiento lateral. En móvil y
   en las galerías de una sola imagen visible (sistemas de unión) no cambia nada. */
@media (min-width: 769px) {
    [data-carousel-ready].editorial-carousel:not(.editorial-carousel--single) .editorial-viewport { overflow: visible; }
}
[data-carousel-ready] .editorial-track { transition: transform var(--motion-carousel) ease; }
[data-carousel-ready] .editorial-track > figure,
[data-carousel-ready] .sector-track > article { flex: 0 0 var(--slide-width); opacity: .2; transition: opacity var(--motion-normal) ease; }
[data-carousel-ready] [data-carousel-slide][data-active] { opacity: 1; }
.sector-carousel:not([data-carousel-ready]) .sector-viewport { overflow-x: auto; }
@media (min-width: 769px) {
    .main-content { overflow-x: clip; }
}

:is(.home-gallery, .editorial-gallery, .editorial-carousel) a { position: relative; isolation: isolate; }
:is(.home-gallery, .editorial-gallery, .editorial-carousel) a::before {
    content: ""; position: absolute; inset: 0; z-index: 1; background: rgb(32 55 97 / 40%);
    opacity: 0; pointer-events: none; transition: opacity var(--motion-normal) ease;
}
:is(.home-gallery, .editorial-gallery, .editorial-carousel) a::after {
    content: ""; position: absolute; top: 50%; left: 50%; z-index: 2; width: 28px; height: 28px;
    background: url('/assets/icons/expand.svg') center / contain no-repeat;
    opacity: 0; transform: translate(-50%, -50%); pointer-events: none; transition: opacity var(--motion-normal) ease;
}
:is(.home-gallery, .editorial-gallery, .editorial-carousel) a:focus-visible::before,
:is(.home-gallery, .editorial-gallery, .editorial-carousel) a:focus-visible::after { opacity: 1; }
.footer-navigation a { transition: transform var(--motion-normal) ease, color var(--motion-normal) ease; }
/* Tres vaivenes (4,2 s) y se para: por debajo de los 5 s del WCAG 2.2.2 (decisión del 23/09). */
[data-composition-key="quickcleats"] h2 a::after { animation: quickcleats-arrow 1.4s ease-in-out 3; }
/* Con JS, los vaivenes empiezan cuando la flecha se ve (motion.js), no al cargar la página. */
[data-navigation-ready] [data-composition-key="quickcleats"] h2 a:not([data-arrow-play])::after { animation: none; }
@keyframes quickcleats-arrow { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
.footer-navigation a:focus-visible { transform: translateX(5px); }
@media (hover: hover) and (pointer: fine) {
    /* Velo azul y lupa al pasar el ratón solo en la galería de la portada, como en ydins.es. En las fichas la
       original no oscurece las fotos (01-10-2026, corrección de los compañeros); con teclado, el foco sí las marca. */
    .home-gallery a:hover::before,
    .home-gallery a:hover::after { opacity: 1; }
    .footer-navigation a:hover { transform: translateX(5px); }
}
.primary-navigation[data-open] { animation: menu-enter 200ms ease both; }
.lightbox[open] { animation: backdrop-enter 200ms ease both; }
.lightbox[open]::backdrop { animation: backdrop-enter 200ms ease both; }
@keyframes menu-enter { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@media print {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    [data-reveal] { opacity: 1 !important; }
    .carousel-controls, .sector-arrow, .gallery-controls, .back-to-top { display: none !important; }
}
