/* =========================================================
   TOUR GALLERY
   ========================================================= */

.tour-gallery {

    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(180px, 0.9fr);

    gap: 4px;

    overflow: hidden;

    border-radius: var(--radius-md);

}


/* =========================================================
   MAIN PHOTO
   ========================================================= */

.gallery-main {

    width: 100%;

    height: 430px;

    overflow: hidden;

    border-radius:
        var(--radius-md)
        0
        0
        var(--radius-md);

}


.gallery-main img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

}


/* =========================================================
   SECONDARY
   ========================================================= */

.gallery-secondary {

    display: grid;

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

    grid-template-rows:
        repeat(2, minmax(0, 1fr));

    gap: 4px;

    min-width: 0;

}


.gallery-secondary img {

    display: block;

    width: 100%;

    height: 100%;

    min-width: 0;

    min-height: 0;

    object-fit: cover;

}


/* =========================================================
   CORNERS
   ========================================================= */

.gallery-secondary img:nth-child(2) {

    border-radius:
        0
        var(--radius-md)
        0
        0;

}


.gallery-secondary img:nth-child(4) {

    border-radius:
        0
        0
        var(--radius-md)
        0;

}


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

@media (max-width: 900px) {

    .gallery-main {

        height: 360px;

    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .tour-gallery {

        display: grid;

        grid-template-columns: 1fr;

        gap: 4px;

        width: 100%;

        border-radius: var(--radius-md);

    }


    /* -----------------------------------------------------
       MAIN PHOTO
       ----------------------------------------------------- */

    .gallery-main {

        width: 100%;

        height: 260px;

        border-radius: var(--radius-md);

    }


    .gallery-main img {

        width: 100%;

        height: 100%;

        object-fit: cover;

    }


    /* -----------------------------------------------------
       SECONDARY PHOTOS
       ----------------------------------------------------- */

    .gallery-secondary {

        display: grid;

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

        grid-template-rows: 64px;

        gap: 4px;

        width: 100%;

        min-width: 0;

    }


    .gallery-secondary img {

        width: 100%;

        height: 64px;

        min-width: 0;

        min-height: 0;

        object-fit: cover;

        border-radius: 6px;

    }


    /* Remove desktop corner treatment */

    .gallery-secondary img:nth-child(2),
    .gallery-secondary img:nth-child(4) {

        border-radius: 6px;

    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .gallery-main {

        height: 230px;

    }


    .gallery-secondary {

        grid-template-rows: 58px;

    }


    .gallery-secondary img {

        height: 58px;

        border-radius: 5px;

    }


    .gallery-secondary img:nth-child(2),
    .gallery-secondary img:nth-child(4) {

        border-radius: 5px;

    }

}
/* =========================================================
   GALLERY PHOTO BUTTON
   ========================================================= */

.gallery-photo {
    display: block;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    border: 0;

    background: transparent;

    cursor: zoom-in;

    overflow: hidden;

    position: relative;
}


/* =========================================================
   GALLERY IMAGE
   ========================================================= */

.gallery-photo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform var(--transition-normal),
        filter var(--transition-normal);
}


/* =========================================================
   HOVER
   ========================================================= */

.gallery-photo:hover img {
    transform: scale(1.035);
}


.gallery-photo:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}


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

.gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity var(--transition-normal),
        visibility var(--transition-normal);
}


.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.gallery-lightbox-overlay {
    position: absolute;

    inset: 0;

    background: rgba(0, 0, 0, 0.88);

    cursor: zoom-out;
}


/* =========================================================
   CONTENT
   ========================================================= */

.gallery-lightbox-content {
    position: relative;

    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    pointer-events: none;
}


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

.gallery-lightbox-image {
    display: block;

    max-width: min(90vw, 1200px);
    max-height: 86vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 8px;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35);

    pointer-events: auto;

    user-select: none;

    transform: scale(0.96);

    transition:
        transform var(--transition-normal);
}


.gallery-lightbox.is-open
.gallery-lightbox-image {
    transform: scale(1);
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;

    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.45);
    color: #fff;

    font-size: 18px;

    cursor: pointer;

    pointer-events: auto;

    transition:
        background-color var(--transition-fast),
        transform var(--transition-fast);
}


/* =========================================================
   CLOSE
   ========================================================= */

.gallery-lightbox-close {
    top: 20px;
    right: 20px;
}


.gallery-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);

    transform: scale(1.05);
}


/* =========================================================
   PREVIOUS
   ========================================================= */

.gallery-lightbox-prev {
    left: 20px;
    top: 50%;

    transform: translateY(-50%);
}


.gallery-lightbox-prev:hover {
    background: rgba(255, 255, 255, 0.18);

    transform:
        translateY(-50%)
        scale(1.05);
}


/* =========================================================
   NEXT
   ========================================================= */

.gallery-lightbox-next {
    right: 20px;
    top: 50%;

    transform: translateY(-50%);
}


.gallery-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.18);

    transform:
        translateY(-50%)
        scale(1.05);
}


/* =========================================================
   COUNTER
   ========================================================= */

.gallery-lightbox-counter {
    position: absolute;

    bottom: 18px;
    left: 50%;

    transform: translateX(-50%);

    z-index: 3;

    padding: 6px 11px;

    color: #fff;

    background: rgba(0, 0, 0, 0.45);

    border-radius: 20px;

    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;

    pointer-events: none;
}


/* =========================================================
   BODY LOCK
   ========================================================= */

body.gallery-lightbox-open {
    overflow: hidden;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .gallery-lightbox {
        padding: 15px;
    }


    .gallery-lightbox-image {
        max-width: 94vw;
        max-height: 78vh;

        border-radius: 6px;
    }


    .gallery-lightbox-close,
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        width: 40px;
        height: 40px;

        font-size: 16px;
    }


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


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


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


    .gallery-lightbox-counter {
        bottom: 12px;

        font-size: 11px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .gallery-lightbox-image {
        max-width: 95vw;
        max-height: 75vh;
    }


    .gallery-lightbox-close,
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        width: 36px;
        height: 36px;

        font-size: 14px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .gallery-photo img,
    .gallery-lightbox,
    .gallery-lightbox-image,
    .gallery-lightbox-close,
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        transition: none;
    }
}
/* =========================================================
   GALLERY TOTAL
   ========================================================= */

.gallery-main {
    position: relative;
}


/* =========================================================
   TOTAL PHOTO BADGE
   ========================================================= */

.gallery-total {
    position: absolute;

    right: 14px;
    bottom: 14px;

    z-index: 5;

    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 7px 11px;

    color: var(--color-white);

    background: rgba(0, 0, 0, 0.58);

    border: 1px solid rgba(255, 255, 255, 0.18);

    border-radius: 8px;

    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    pointer-events: none;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}


.gallery-total i {
    font-size: 14px;
    line-height: 1;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .gallery-total {
        right: 8px;
        bottom: 8px;

        padding: 6px 9px;

        border-radius: 7px;

        font-size: 11px;
    }


    .gallery-total i {
        font-size: 13px;
    }
}
/* =========================================================
   LIGHTBOX ALT / PHOTO CAPTION
   ========================================================= */

.gallery-lightbox-alt {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 0 20px;

    color: var(--color-white);

    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;

    text-align: center;
}