
/* =========================================
   LIMRA HOLIDAYS - TOUR GALLERY
   Desktop grid + mobile slider
========================================= */

.limra-tour-gallery {
    width: 100%;
    margin: 0 0 28px;
    --limra-gap: 7px;
    --limra-radius: 11px;
    box-sizing: border-box;
}

.limra-tour-gallery *,
.limra-tour-gallery *::before,
.limra-tour-gallery *::after {
    box-sizing: border-box;
}

/* Main desktop layout */
.limra-tour-gallery .limra-tour-gallery-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--limra-gap);
    width: 100%;
    height: clamp(320px, 34vw, 430px);
    overflow: hidden;
    border-radius: var(--limra-radius);
}

/* Main image and thumbnails */
.limra-tour-gallery .limra-tour-gallery-main,
.limra-tour-gallery .limra-tour-gallery-thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0;
    background: #f2f2f2;
    box-shadow: none !important;
    cursor: pointer;
}

/* Images */
.limra-tour-gallery .limra-tour-gallery-main img,
.limra-tour-gallery .limra-tour-gallery-thumb img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center;
    transition: transform .3s ease;
}

.limra-tour-gallery .limra-tour-gallery-main {
    border-radius: var(--limra-radius) 0 0 var(--limra-radius);
}

.limra-tour-gallery .limra-tour-gallery-main:hover img,
.limra-tour-gallery .limra-tour-gallery-thumb:hover img {
    transform: scale(1.025);
}

/* Right-side desktop image grid */
.limra-tour-gallery .limra-tour-gallery-side {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--limra-gap);
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.limra-tour-gallery .limra-tour-gallery-thumb:nth-child(2) {
    border-radius: 0 var(--limra-radius) 0 0;
}

.limra-tour-gallery .limra-tour-gallery-thumb:nth-child(4) {
    border-radius: 0 0 0 0;
}

.limra-tour-gallery .limra-tour-gallery-thumb:nth-child(5) {
    border-radius: 0 0 var(--limra-radius) 0;
}

.limra-tour-gallery .limra-tour-gallery-empty {
    display: none !important;
}

/* View all photos */
.limra-tour-gallery .limra-tour-gallery-more {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: calc(100% - 20px);
    margin: 0;
    padding: 10px 13px;
    border: 1px solid rgba(20, 30, 45, .12);
    border-radius: 7px;
    background: #fff;
    color: #17243a;
    font: 600 12px/1.2 Arial, sans-serif;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .15);
    white-space: nowrap;
    cursor: pointer;
}

.limra-tour-gallery .limra-tour-gallery-more span {
    font-size: 15px;
}

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

.limra-tour-gallery .limra-tour-lightbox[hidden] {
    display: none !important;
}

.limra-tour-gallery .limra-tour-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 70px;
    background: rgba(12, 17, 27, .96);
}

.limra-tour-gallery .limra-tour-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.limra-tour-gallery .limra-tour-lightbox-image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(100% - 35px) !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 5px !important;
    object-fit: contain !important;
}

.limra-tour-gallery .limra-tour-lightbox-counter {
    margin-top: 14px;
    color: #fff;
    font: 13px/1.5 Arial, sans-serif;
}

/* Orange lightbox controls */
.limra-tour-gallery .limra-tour-lightbox-close,
.limra-tour-gallery .limra-tour-lightbox-prev,
.limra-tour-gallery .limra-tour-lightbox-next {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 50%;
    background: #F7941D !important;
    color: #fff !important;
    font-family: Arial, sans-serif !important;
    line-height: 1 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .22) !important;
    cursor: pointer;
}

.limra-tour-gallery .limra-tour-lightbox-close {
    top: 18px;
    right: 20px;
    font-size: 30px;
}

.limra-tour-gallery .limra-tour-lightbox-prev,
.limra-tour-gallery .limra-tour-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 27px;
}

.limra-tour-gallery .limra-tour-lightbox-prev {
    left: 20px;
}

.limra-tour-gallery .limra-tour-lightbox-next {
    right: 20px;
}

.limra-tour-gallery .limra-tour-lightbox-close:hover,
.limra-tour-gallery .limra-tour-lightbox-prev:hover,
.limra-tour-gallery .limra-tour-lightbox-next:hover {
    background: #e6810b !important;
    color: #fff !important;
}

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

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

@media (min-width: 768px) and (max-width: 1024px) {
    .limra-tour-gallery .limra-tour-gallery-grid {
        height: clamp(280px, 42vw, 380px);
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    }

    .limra-tour-gallery {
        --limra-gap: 6px;
    }
}

/* =========================================
   MOBILE - ONE IMAGE AT A TIME
========================================= */

@media (max-width: 767px) {
    .limra-tour-gallery {
        margin-bottom: 20px;
        --limra-radius: 9px;
    }

    /* Replace desktop grid with a single slider */
    .limra-tour-gallery .limra-tour-gallery-grid {
        display: block !important;
        width: 100%;
        height: auto !important;
        overflow: hidden !important;
        border-radius: var(--limra-radius);
    }

    /* Main desktop image is hidden on mobile */
    .limra-tour-gallery .limra-tour-gallery-main {
        display: none !important;
    }

    /* Horizontal slider */
    .limra-tour-gallery .limra-tour-gallery-side {
        position: relative !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch;
        gap: 0 !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4 / 3;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        border-radius: var(--limra-radius);
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
    }

    .limra-tour-gallery .limra-tour-gallery-side::-webkit-scrollbar {
        display: none !important;
    }

    /* Each slide occupies the full width */
    .limra-tour-gallery .limra-tour-gallery-thumb {
        position: relative !important;
        display: block !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        align-self: stretch;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        overflow: hidden;
        border-radius: var(--limra-radius) !important;
    }

    .limra-tour-gallery .limra-tour-gallery-thumb img {
        display: block;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Keep View all photos on the fifth image */
    .limra-tour-gallery .limra-tour-gallery-more {
        right: 10px !important;
        bottom: 10px !important;
        z-index: 6;
        padding: 9px 11px !important;
        font-size: 11px !important;
    }

    /* Mobile slider arrows */
    .limra-tour-gallery .limra-mobile-arrow {
        position: absolute !important;
        top: 50% !important;
        z-index: 10 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px !important;
        height: 30px !important;
        margin: 0 !important;
        padding: 0 0 2px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #F7941D !important;
        color: #fff !important;
        font: 24px/1 Arial, sans-serif !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .25) !important;
        transform: translateY(-50%);
        cursor: pointer;
    }

    .limra-tour-gallery .limra-mobile-arrow-prev {
        left: 8px !important;
    }

    .limra-tour-gallery .limra-mobile-arrow-next {
        right: 8px !important;
    }

    /* Respect JS visibility state */
    .limra-tour-gallery .limra-mobile-arrow[hidden] {
        display: none !important;
    }

    .limra-tour-gallery .limra-tour-lightbox {
        padding: 55px 12px;
    }

    .limra-tour-gallery .limra-tour-lightbox-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .limra-tour-gallery .limra-tour-lightbox-prev,
    .limra-tour-gallery .limra-tour-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 25px;
    }

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

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

/* Small phones */
@media (max-width: 380px) {
    .limra-tour-gallery .limra-tour-gallery-side {
        aspect-ratio: 1 / 1;
    }

    .limra-tour-gallery .limra-mobile-arrow {
        width: 27px !important;
        height: 27px !important;
        font-size: 22px !important;
    }

    .limra-tour-gallery .limra-tour-gallery-more {
        right: 7px !important;
        bottom: 7px !important;
        padding: 8px 9px !important;
        font-size: 10px !important;
    }
}

/* Desktop: never show mobile arrows */
@media (min-width: 768px) {
    .limra-tour-gallery .limra-mobile-arrow {
        display: none !important;
    }
}



/* Fix mobile arrows so they stay fixed over the slider */
@media (max-width: 767px) {
    .limra-tour-gallery .limra-tour-gallery-grid {
        position: relative !important;
        overflow: hidden !important;
    }

    .limra-tour-gallery .limra-tour-gallery-side {
        position: relative !important;
    }

    .limra-tour-gallery .limra-mobile-arrow {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 999 !important;
        pointer-events: auto !important;
    }

    .limra-tour-gallery .limra-mobile-arrow-prev {
        left: 8px !important;
    }

    .limra-tour-gallery .limra-mobile-arrow-next {
        right: 8px !important;
    }
}
