/* ==========================================================================
   GALERÍA DEL TOUR - EUROFREETOUR
   ========================================================================== */

.eft-tour-gallery {
    position: relative;

    padding:
        clamp(84px, 9vw, 144px)
        0;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #f6f7fb
        );
}


/* ==========================================================================
   CABECERA
   ========================================================================== */

.eft-tour-gallery__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;

    margin-bottom:
        clamp(42px, 6vw, 72px);
}

.eft-tour-gallery__header h2 {
    max-width: 820px;

    margin: 0;

    color: #111827;

    font-family: "Poppins", sans-serif;
    font-size:
        clamp(
            2.3rem,
            4.4vw,
            4.25rem
        );

    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.eft-tour-gallery__counter {
    flex: 0 0 auto;

    min-width: 116px;
    min-height: 82px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    padding:
        14px
        20px;

    border:
        1px solid rgba(225, 228, 236, 0.94);
    border-radius: 22px;

    background: #ffffff;

    box-shadow:
        0 14px 34px rgba(17, 24, 39, 0.06);
}

.eft-tour-gallery__counter strong {
    color: #f4254f;

    font-family: "Poppins", sans-serif;
    font-size: 1.8rem;
    line-height: 1;
}

.eft-tour-gallery__counter span {
    margin-top: 6px;

    color: #8991a2;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


/* ==========================================================================
   GRID
   ========================================================================== */

.eft-tour-gallery__grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(280px, 0.75fr);

    grid-template-rows:
        repeat(
            2,
            minmax(230px, 1fr)
        );

    gap: 18px;

    min-height: 620px;
}

.eft-tour-gallery__grid.has-single-image {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.eft-tour-gallery__item {
    min-width: 0;
    min-height: 0;

    margin: 0;

    overflow: hidden;

    border-radius: 28px;

    background: #e8ebf1;

    box-shadow:
        0 18px 46px rgba(17, 24, 39, 0.08);
}

.eft-tour-gallery__item.is-featured {
    grid-row:
        1
        / 3;
}

.eft-tour-gallery__item:nth-child(n + 4) {
    display: none;
}


/* ==========================================================================
   BOTÓN E IMAGEN
   ========================================================================== */

.eft-tour-gallery__button {
    position: relative;

    width: 100%;
    height: 100%;

    display: block;

    padding: 0;

    overflow: hidden;

    border: 0;

    background: transparent;

    cursor: pointer;
}

.eft-tour-gallery__button img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
    object-position: center;

    transition:
        transform 0.65s ease;
}

.eft-tour-gallery__button:hover img,
.eft-tour-gallery__button:focus-visible img {
    transform: scale(1.055);
}

.eft-tour-gallery__overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            180deg,
            rgba(9, 15, 28, 0.04),
            rgba(9, 15, 28, 0.38)
        );

    opacity: 0.55;

    transition:
        opacity 0.35s ease;
}

.eft-tour-gallery__button:hover
.eft-tour-gallery__overlay {
    opacity: 0.82;
}


/* ==========================================================================
   ZOOM
   ========================================================================== */

.eft-tour-gallery__zoom {
    position: absolute;
    top: 20px;
    right: 20px;

    width: 48px;
    height: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;

    background:
        rgba(17, 24, 39, 0.44);

    color: #ffffff;

    backdrop-filter: blur(14px);

    transform: translateY(-6px);

    opacity: 0;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.eft-tour-gallery__button:hover
.eft-tour-gallery__zoom,
.eft-tour-gallery__button:focus-visible
.eft-tour-gallery__zoom {
    transform: translateY(0);

    opacity: 1;
}

.eft-tour-gallery__zoom svg {
    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================================
   MÁS IMÁGENES
   ========================================================================== */

.eft-tour-gallery__more {
    position: absolute;
    right: 20px;
    bottom: 18px;

    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding:
        0
        16px;

    border:
        1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;

    background:
        rgba(17, 24, 39, 0.64);

    color: #ffffff;

    font-size: 0.78rem;
    font-weight: 700;

    backdrop-filter: blur(14px);
}


/* ==========================================================================
   MODAL
   ========================================================================== */

.eft-tour-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        28px;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.eft-tour-gallery-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.eft-tour-gallery-modal[hidden] {
    display: none;
}

.eft-tour-gallery-modal__backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(6, 10, 20, 0.92);

    backdrop-filter: blur(14px);
}

.eft-tour-gallery-modal__dialog {
    position: relative;
    z-index: 2;

    width:
        min(
            1240px,
            100%
        );

    height:
        min(
            84vh,
            820px
        );

    display: grid;
    grid-template-columns:
        64px
        minmax(0, 1fr)
        64px;

    align-items: center;
    gap: 16px;
}

.eft-tour-gallery-modal__figure {
    min-width: 0;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    margin: 0;
}

.eft-tour-gallery-modal__figure img {
    width: 100%;
    height:
        calc(
            100%
            - 42px
        );

    display: block;

    object-fit: contain;
}

.eft-tour-gallery-modal__figure figcaption {
    margin-top: 14px;

    color:
        rgba(255, 255, 255, 0.72);

    font-size: 0.86rem;
    text-align: center;
}

.eft-tour-gallery-modal__nav,
.eft-tour-gallery-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(255, 255, 255, 0.16);

    background:
        rgba(255, 255, 255, 0.08);

    color: #ffffff;

    cursor: pointer;

    backdrop-filter: blur(12px);
}

.eft-tour-gallery-modal__nav {
    width: 58px;
    height: 58px;

    border-radius: 50%;
}

.eft-tour-gallery-modal__close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 4;

    width: 48px;
    height: 48px;

    border-radius: 16px;
}

.eft-tour-gallery-modal__nav svg,
.eft-tour-gallery-modal__close svg {
    width: 24px;
    height: 24px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {

    .eft-tour-gallery__grid {
        min-height: 560px;

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        grid-template-rows:
            340px
            220px;
    }

    .eft-tour-gallery__item.is-featured {
        grid-column:
            1
            / 3;

        grid-row: auto;
    }
}


@media (max-width: 680px) {

    .eft-tour-gallery {
        padding:
            76px
            0;
    }

    .eft-tour-gallery__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .eft-tour-gallery__grid {
        display: flex;
        gap: 14px;

        min-height: auto;

        overflow-x: auto;

        padding-bottom: 10px;

        scroll-snap-type: x mandatory;
    }

    .eft-tour-gallery__item,
    .eft-tour-gallery__item.is-featured {
        width:
            min(
                86vw,
                390px
            );
        height: 420px;

        flex:
            0
            0
            min(
                86vw,
                390px
            );

        display: block;

        border-radius: 24px;

        scroll-snap-align: start;
    }

    .eft-tour-gallery__item:nth-child(n + 4) {
        display: block;
    }

    .eft-tour-gallery-modal {
        padding:
            18px;
    }

    .eft-tour-gallery-modal__dialog {
        height: 88vh;

        grid-template-columns:
            48px
            minmax(0, 1fr)
            48px;

        gap: 8px;
    }

    .eft-tour-gallery-modal__nav {
        width: 44px;
        height: 44px;
    }
}

body.eft-tour-gallery-open {
    overflow: hidden;
}