@charset "UTF-8";
/* ═══════════════════════════════════════════════════════════════════════════
   assets/css/lightbox.css — v2.0  hx 06/05/2026
   Lightbox con autoplay para la web pública.
   Transiciones, Ken Burns, barra de progreso, play/pausa.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Bloquear scroll del body cuando el lightbox está abierto */
body.cra-lightbox-open {
    overflow: hidden;
}

/* ───────── Contenedor fullscreen ───────── */
.cra-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(12, 14, 10, 0.94);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: zoom-out;

    /* Variables que rellena el JS por instancia */
    --cra-lightbox-duracion:  600ms;
    --cra-lightbox-intervalo: 5000ms;
    --cra-lightbox-kb-zoom:   1.06;
}
.cra-lightbox.is-open {
    opacity: 1;
}

/* ───────── Stage (zona de la foto) ───────── */
.cra-lightbox__stage {
    position: relative;
    width: 94vw;
    height: 92vh;
    max-width: 94vw;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cra-lightbox__pista {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ───────── Slides (A y B se alternan) ─────────
   Por defecto los slides están ocultos. La clase --activa los muestra.
   Cada transición decide cómo entran y cómo sale el saliente. */
.cra-lightbox__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    will-change: opacity, transform;
}
.cra-lightbox__slide img {
    max-width: 94vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: default;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    will-change: transform;
}

/* ──────────────────────────────────────────────────────────────────
   Transición FADE (cross-fade entre slides)
   ────────────────────────────────────────────────────────────────── */
.cra-lightbox--fade .cra-lightbox__slide {
    transition: opacity var(--cra-lightbox-duracion) ease;
}
.cra-lightbox--fade .cra-lightbox__slide--activa {
    opacity: 1;
}
.cra-lightbox--fade .cra-lightbox__slide--saliendo {
    opacity: 0;
}

/* ──────────────────────────────────────────────────────────────────
   Transición SLIDE (deslizamiento horizontal direccional)
   ────────────────────────────────────────────────────────────────── */
.cra-lightbox--slide .cra-lightbox__slide {
    transition: transform var(--cra-lightbox-duracion) ease,
                opacity   var(--cra-lightbox-duracion) ease;
    transform: translateX(0);
    opacity: 1;
}
.cra-lightbox--slide .cra-lightbox__slide:not(.cra-lightbox__slide--activa):not(.cra-lightbox__slide--saliendo) {
    opacity: 0;
}
.cra-lightbox--slide.cra-lightbox--dir-next .cra-lightbox__slide--activa {
    animation: cra-lb-slide-in-r var(--cra-lightbox-duracion) ease both;
}
.cra-lightbox--slide.cra-lightbox--dir-next .cra-lightbox__slide--saliendo {
    animation: cra-lb-slide-out-l var(--cra-lightbox-duracion) ease both;
}
.cra-lightbox--slide.cra-lightbox--dir-prev .cra-lightbox__slide--activa {
    animation: cra-lb-slide-in-l var(--cra-lightbox-duracion) ease both;
}
.cra-lightbox--slide.cra-lightbox--dir-prev .cra-lightbox__slide--saliendo {
    animation: cra-lb-slide-out-r var(--cra-lightbox-duracion) ease both;
}
@keyframes cra-lb-slide-in-r  { from { transform: translateX( 100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes cra-lb-slide-in-l  { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes cra-lb-slide-out-l { from { transform: translateX(0); opacity: 1; }     to { transform: translateX(-100%); opacity: 0; } }
@keyframes cra-lb-slide-out-r { from { transform: translateX(0); opacity: 1; }     to { transform: translateX( 100%); opacity: 0; } }

/* ──────────────────────────────────────────────────────────────────
   Transición ZOOM (entrada con escala)
   ────────────────────────────────────────────────────────────────── */
.cra-lightbox--zoom .cra-lightbox__slide {
    transition: opacity var(--cra-lightbox-duracion) ease,
                transform var(--cra-lightbox-duracion) ease;
    opacity: 0;
    transform: scale(0.92);
}
.cra-lightbox--zoom .cra-lightbox__slide--activa {
    opacity: 1;
    transform: scale(1);
}
.cra-lightbox--zoom .cra-lightbox__slide--saliendo {
    opacity: 0;
    transform: scale(1.08);
}

/* ──────────────────────────────────────────────────────────────────
   Transición NINGUNA (cambio brusco)
   ────────────────────────────────────────────────────────────────── */
.cra-lightbox--ninguna .cra-lightbox__slide {
    transition: none;
}
.cra-lightbox--ninguna .cra-lightbox__slide--activa { opacity: 1; }

/* ──────────────────────────────────────────────────────────────────
   Ken Burns (zoom + pan suave dentro del slide activo).
   Ortogonal a la transición. Se reactiva al cambiar de foto porque
   el JS hace reflow tras añadir la clase --activa.
   ────────────────────────────────────────────────────────────────── */
.cra-lightbox--kenburns .cra-lightbox__slide--activa img {
    animation: cra-lb-kenburns var(--cra-lightbox-intervalo) ease-out both;
}
@keyframes cra-lb-kenburns {
    from { transform: scale(1)               translate( 0%,  0%); }
    to   { transform: scale(var(--cra-lightbox-kb-zoom)) translate(-2%, -2%); }
}

/* ───────── Botón cerrar ───────── */
.cra-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.cra-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ───────── Botón play/pausa ───────── */
.cra-lightbox__playpause {
    position: absolute;
    top: 16px;
    right: 72px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.cra-lightbox__playpause:hover {
    background: rgba(255, 255, 255, 0.22);
}
.cra-lightbox__icono-play,
.cra-lightbox__icono-pausa {
    display: none;
}
.cra-lightbox__playpause[data-estado="play"]  .cra-lightbox__icono-pausa { display: inline; }
.cra-lightbox__playpause[data-estado="pausa"] .cra-lightbox__icono-play  { display: inline; }

/* ───────── Flechas ‹ › ───────── */
.cra-lightbox__prev,
.cra-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    z-index: 3;
}
.cra-lightbox__prev { left: 20px; }
.cra-lightbox__next { right: 20px; }
.cra-lightbox__prev:hover,
.cra-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ───────── Contador ───────── */
.cra-lightbox__contador {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-family: system-ui, sans-serif;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 14px;
    border-radius: 20px;
    z-index: 3;
}

/* ───────── Puntos indicadores ───────── */
.cra-lightbox__puntos {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    max-width: 90vw;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 3;
}
.cra-lightbox__punto {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.cra-lightbox__punto:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.3);
}
.cra-lightbox__punto.is-active {
    background: #fff;
    transform: scale(1.25);
}

/* ───────── Barra de progreso ───────── */
.cra-lightbox__progreso {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 3;
}
.cra-lightbox__progreso-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* En modo edición el cursor vuelve a normal (allí prefiere editar) */
html.cra-admin-mode [data-cra-slot] img {
    cursor: inherit;
}
html:not(.cra-admin-mode) [data-cra-slot] img {
    cursor: zoom-in;
}

/* ───────── Móvil ───────── */
@media (max-width: 700px) {
    .cra-lightbox__prev,
    .cra-lightbox__next {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    .cra-lightbox__prev { left: 8px; }
    .cra-lightbox__next { right: 8px; }
    .cra-lightbox__close {
        top: 12px;
        right: 12px;
    }
    .cra-lightbox__playpause {
        top: 12px;
        right: 64px;
    }
}

/* ───────── Reducir movimiento ───────── */
@media (prefers-reduced-motion: reduce) {
    .cra-lightbox__slide,
    .cra-lightbox__slide img,
    .cra-lightbox__progreso-bar {
        animation: none !important;
        transition: none !important;
    }
    .cra-lightbox--kenburns .cra-lightbox__slide--activa img {
        animation: none !important;
        transform: none !important;
    }
}
