/* ==========================================================================
   BLOCK, WIDGET & ELEMENTOR: GALERÍA DE IMÁGENES (EXF - CAJÓN DESASTRE)
   ========================================================================== */

.exf-course-gallery-block {
    font-family: inherit;
    box-sizing: border-box;
    background: transparent;
    padding: 0;
    border: none;
    margin: 20px 0;
}

/* Header del bloque */
.exf-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}


/* Botones de navegación del slider (Prev / Next) */
.exf-slider-nav-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exf-slider-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.exf-slider-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #e74c3c;
    transform: translateY(-1px);
}

.exf-slider-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Grid carrusel horizontal */
.exf-gallery-container {
    position: relative;
    overflow: hidden;
}

.exf-gallery-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch; /* Desplazamiento inercial suave en teléfonos táctiles iOS/Android */
    cursor: grab;
    user-select: none;
}

.exf-gallery-grid.is-dragging {
    cursor: grabbing !important;
    scroll-behavior: auto !important;
}

.exf-gallery-grid::-webkit-scrollbar {
    display: none;
}

.exf-gallery-item {
    flex-shrink: 0;
    width: var(--wpcd-thumb-width, 220px);
    aspect-ratio: 16 / 10;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    border: 2px solid transparent;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    display: block;
    cursor: pointer;
}

.exf-gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.exf-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none; /* Previene que la etiqueta <img> capture o interrumpa el evento mousedown/mousemove */
}

.exf-gallery-item {
    user-select: none;
    -webkit-user-drag: none;
}

/* ==========================================================================
   LIGHTBOX MODAL TOTALMENTE AISLADO (WPCD)
   ========================================================================== */
#wpcd-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    user-select: none;
}

#wpcd-lightbox-modal.is-open {
    display: flex !important;
}

.wpcd-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.wpcd-lightbox-content {
    position: relative;
    z-index: 10;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wpcd-lightbox-img {
    max-width: 85vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    display: block;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Cabecera superior con Título de la imagen */
.wpcd-lightbox-top-header {
    position: absolute;
    top: 20px;
    left: 30px;
    right: 30px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpcd-lightbox-top-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

.wpcd-lightbox-close {
    color: #ffffff;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    transition: color 0.2s ease;
}

.wpcd-lightbox-close:hover {
    color: #e74c3c;
}

/* Leyenda justo debajo de la imagen */
.wpcd-lightbox-content {
    position: relative;
    z-index: 10;
    max-width: 85vw;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wpcd-lightbox-caption {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
    text-align: center;
    background: rgba(15, 23, 42, 0.7);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    max-width: 80%;
}

/* Descripción detallada en la parte inferior de la ventana */
.wpcd-lightbox-bottom-footer {
    position: absolute;
    bottom: 20px;
    left: 30px;
    right: 30px;
    z-index: 30;
    display: flex;
    justify-content: center;
    text-align: center;
}

.wpcd-lightbox-desc {
    font-size: 13.5px;
    color: #94a3b8;
    max-width: 750px;
    line-height: 1.5;
    background: rgba(15, 23, 42, 0.75);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Botones de navegación Anterior / Siguiente en Lightbox Modal */
.wpcd-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    padding: 0;
    backdrop-filter: blur(4px);
}

.wpcd-lightbox-nav:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.wpcd-lightbox-nav .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    line-height: 24px;
}

.wpcd-lightbox-prev {
    left: 25px;
}

.wpcd-lightbox-next {
    right: 25px;
}

@media (max-width: 600px) {
    .wpcd-lightbox-prev {
        left: 10px;
    }
    .wpcd-lightbox-next {
        right: 10px;
    }
    .wpcd-lightbox-nav {
        width: 40px;
        height: 40px;
    }
}
