/* =========================================================
   NEXUS — GALERÍA
   Solo estilos propios de la galería
   ========================================================= */


/* =========================================================
   FILTROS
   ========================================================= */

.gallery-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}


.filter-btn {
    appearance: none;

    border: 1px solid var(--line, rgba(255,255,255,.12));

    background: #0b0e13;

    color: #dce1e9;

    padding: 8px 13px;

    border-radius: 999px;

    cursor: pointer;

    font-size: .85rem;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease;
}


.filter-btn:hover {
    background: rgba(215,173,88,.12);

    color: var(--gold2, #d7ad58);

    border-color:
        rgba(215,173,88,.35);

    transform:
        translateY(-1px);
}


.filter-btn.active {
    background:
        rgba(215,173,88,.14);

    color:
        var(--gold2, #d7ad58);

    border-color:
        rgba(215,173,88,.45);
}



/* =========================================================
   SLIDER
   ========================================================= */

.gallery-slider {
    position: relative;

    width: 100%;

    min-height: 430px;

    border:
        1px solid rgba(255,255,255,.08);

    border-radius: 12px;

    overflow: hidden;

    background: #07090d;

    display: grid;

    place-items: center;

    box-shadow:
        0 12px 35px rgba(0,0,0,.25);
}


.gallery-slide {
    display: none;

    width: 100%;

    height: 430px;

    position: relative;
}


.gallery-slide.active {
    display: block;
}


.gallery-slide img {
    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    cursor: zoom-in;
}



/* =========================================================
   TEXTO DEL SLIDER
   ========================================================= */

.gallery-caption {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    padding:
        60px
        24px
        20px;

    background:
        linear-gradient(
            transparent,
            rgba(0,0,0,.92)
        );

    pointer-events: none;
}


.gallery-caption strong {
    display: block;

    color:
        var(--gold2, #d7ad58);

    font-family: Cinzel, serif;

    font-size: 1.2rem;
}


.gallery-caption span {
    display: block;

    margin-top: 5px;

    color: #dce1e9;

    font-size: .84rem;
}



/* =========================================================
   FLECHAS DEL SLIDER
   ========================================================= */

.slider-arrow {
    position: absolute;

    top: 50%;

    transform:
        translateY(-50%);

    z-index: 10;

    width: 44px;

    height: 44px;

    padding: 0;

    border:
        1px solid rgba(255,255,255,.15);

    border-radius: 50%;

    background:
        rgba(7,9,13,.82);

    color:
        var(--gold2, #d7ad58);

    font-size: 1.5rem;

    line-height: 1;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;
}


.slider-arrow:hover {
    background:
        rgba(215,173,88,.16);

    border-color:
        rgba(215,173,88,.5);
}


.slider-arrow.prev {
    left: 14px;
}


.slider-arrow.next {
    right: 14px;
}



/* =========================================================
   DOTS
   ========================================================= */

.gallery-dots {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 8px;

    margin: 14px 0;
}


.gallery-dot {
    width: 8px;

    height: 8px;

    padding: 0;

    border: 0;

    border-radius: 50%;

    background: #59606b;

    cursor: pointer;
}


.gallery-dot.active {
    background:
        var(--gold2, #d7ad58);

    transform:
        scale(1.3);
}



/* =========================================================
   MINIATURAS
   ========================================================= */

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-top: 22px;
}


.gallery-thumb {
    appearance: none;

    display: block;

    width: 100%;

    height: 115px;

    padding: 0;

    border:
        1px solid rgba(255,255,255,.08);

    border-radius: 8px;

    overflow: hidden;

    background: #10141b;

    cursor: pointer;

    position: relative;
}


.gallery-thumb:hover {
    border-color:
        rgba(215,173,88,.45);

    box-shadow:
        0 8px 20px rgba(0,0,0,.3);
}


.gallery-thumb img {
    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    transition:
        transform .3s ease;
}


.gallery-thumb:hover img {
    transform:
        scale(1.05);
}



/* =========================================================
   AYUDA
   ========================================================= */

.gallery-help {
    color:
        var(--muted, #89909c);

    font-size: .8rem;

    line-height: 1.5;

    margin-top: 10px;
}



/* =========================================================
   LIGHTBOX
   ========================================================= */

.gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: none;

    width: 100vw;

    height: 100vh;

    box-sizing: border-box;

    background:
        rgba(0,0,0,.95);

    align-items: center;

    justify-content: center;

    padding: 50px;

    overflow: hidden;
}


.gallery-lightbox.is-open {
    display: flex;
}



/* =========================================================
   CONTENEDOR DE LA IMAGEN AMPLIADA
   ========================================================= */

.gallery-lightbox-inner {
    position: relative;

    width: 100%;

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    pointer-events: none;
}


.gallery-lightbox-inner img {
    display: block;

    width: auto;

    height: auto;

    max-width: 88vw;

    max-height: 82vh;

    object-fit: contain;

    border-radius: 8px;

    box-shadow:
        0 20px 80px rgba(0,0,0,.85);

    pointer-events: auto;
}



/* =========================================================
   TEXTO DEL LIGHTBOX
   ========================================================= */

.gallery-lightbox-caption {
    position: absolute;

    left: 50%;

    bottom: 0;

    transform:
        translateX(-50%);

    width: min(900px, 80vw);

    padding:
        55px
        20px
        15px;

    text-align: center;

    background:
        linear-gradient(
            transparent,
            rgba(0,0,0,.9)
        );

    pointer-events: none;
}


.gallery-lightbox-caption strong {
    display: block;

    color:
        var(--gold2, #d7ad58);

    font-family: Cinzel, serif;

    font-size: 1.2rem;
}


.gallery-lightbox-caption span {
    display: block;

    margin-top: 5px;

    color: #dce1e9;

    font-size: .85rem;
}



/* =========================================================
   CERRAR
   ========================================================= */

.gallery-lightbox-close {
    position: fixed;

    top: 20px;

    right: 25px;

    z-index: 100003;

    width: 48px;

    height: 48px;

    padding: 0;

    border:
        1px solid rgba(255,255,255,.2);

    border-radius: 50%;

    background:
        rgba(10,12,16,.9);

    color: white;

    font-size: 1.5rem;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;
}


.gallery-lightbox-close:hover {
    background:
        rgba(215,173,88,.18);

    border-color:
        rgba(215,173,88,.6);
}



/* =========================================================
   FLECHAS DEL LIGHTBOX
   ========================================================= */

.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: fixed;

    top: 50%;

    z-index: 100003;

    transform:
        translateY(-50%);

    width: 54px;

    height: 54px;

    padding: 0;

    border:
        1px solid rgba(255,255,255,.2);

    border-radius: 50%;

    background:
        rgba(10,12,16,.9);

    color:
        var(--gold2, #d7ad58);

    font-size: 1.9rem;

    line-height: 1;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;
}


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


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


.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    background:
        rgba(215,173,88,.18);

    border-color:
        rgba(215,173,88,.6);
}



/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .gallery-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}



/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 650px) {

    .gallery-slider {
        min-height: 330px;
    }


    .gallery-slide {
        height: 330px;
    }


    .gallery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 9px;
    }


    .gallery-thumb {
        height: 100px;
    }


    .gallery-lightbox {
        padding: 20px;
    }


    .gallery-lightbox-inner img {
        max-width: 92vw;

        max-height: 76vh;
    }


    .gallery-lightbox-close {
        top: 12px;

        right: 12px;

        width: 42px;

        height: 42px;
    }


    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        width: 42px;

        height: 42px;

        font-size: 1.4rem;
    }


    .gallery-lightbox-prev {
        left: 8px;
    }


    .gallery-lightbox-next {
        right: 8px;
    }

}



/* =========================================================
   MÓVIL PEQUEÑO
   ========================================================= */

@media (max-width: 420px) {

    .gallery-filter {
        width: 100%;
    }


    .filter-btn {
        padding: 7px 10px;

        font-size: .78rem;
    }


    .gallery-slider {
        min-height: 280px;
    }


    .gallery-slide {
        height: 280px;
    }


    .gallery-thumb {
        height: 85px;
    }

}



/* =========================================================
   VÍDEOS — MINIATURA 16:9 SIN RECORTES FEOS
   ========================================================= */

.gallery-slide-video {
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 560px;
}

.gallery-slide-video .gallery-media > img {
    object-fit: cover;
    object-position: center center;
}

.gallery-slide-video .gallery-play {
    width: 76px;
    height: 76px;
    font-size: 1.65rem;
    background: rgba(215,173,88,.94);
    border: 2px solid rgba(255,255,255,.72);
}

@media (max-width: 900px) {
    .gallery-slide-video {
        max-height: none;
    }
}

@media (max-width: 650px) {
    .gallery-slide-video .gallery-play {
        width: 58px;
        height: 58px;
        font-size: 1.25rem;
    }
}

/* =========================================================
   VÍDEOS DE YOUTUBE
   ========================================================= */

.gallery-media {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

.gallery-media > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    background: rgba(215,173,88,.92);
    color: #07090d;
    font-size: 1.55rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.5);
    pointer-events: none;
}

.gallery-thumb {
    position: relative;
}

.gallery-thumb .gallery-thumb-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.lightbox-youtube {
    display: block;
    width: min(1100px, 86vw);
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0,0,0,.85);
    pointer-events: auto;
}

@media (max-width: 650px) {
    .gallery-play {
        width: 54px;
        height: 54px;
        font-size: 1.25rem;
    }

    .lightbox-youtube {
        width: 92vw;
    }
}
