/* ============================================================
   Tour Gallery — Hero Grid Layout
   Main image left (large), up to 4 thumbnails right (2x2 grid)
   + lightbox overlay + thumbnail strip below
   ============================================================ */

.luxury-scroll-gallery {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

/* ── Hero Grid ─────────────────────────────────────────────── */
.gallery-hero-grid {
    display: table;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 4px;
    margin-bottom: 10px;
}

.gallery-hero-main {
    display: table-cell;
    width: 62%;
    vertical-align: top;
    position: relative;
}

.gallery-hero-main-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.4s ease;
    border-radius: 10px 0 0 10px;
}

.gallery-hero-main:hover .gallery-hero-main-img {
    transform: scale(1.02);
}

/* ── Right 2×2 grid ────────────────────────────────────────── */
.gallery-hero-side {
    display: table-cell;
    width: 38%;
    vertical-align: top;
}

.gallery-side-grid {
    display: table;
    width: 100%;
    height: 420px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 4px;
}

.gallery-side-row {
    display: table-row;
}

.gallery-side-cell {
    display: table-cell;
    width: 50%;
    height: 50%;
    position: relative;
    overflow: hidden;
    vertical-align: top;
}

.gallery-side-cell:first-child img {
    border-radius: 0;
}
.gallery-side-cell:last-child:nth-child(2) img {
    border-radius: 0 10px 0 0;
}
.gallery-side-row:last-child .gallery-side-cell:first-child img {
    border-radius: 0 0 0 0;
}
.gallery-side-row:last-child .gallery-side-cell:last-child img {
    border-radius: 0 0 10px 0;
}

.gallery-side-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.gallery-side-cell:hover img {
    transform: scale(1.06);
}

/* "View all X photos" overlay on last cell */
.gallery-view-all-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.52);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.gallery-view-all-overlay:hover {
    background: rgba(0,0,0,0.68);
}

.gallery-view-all-overlay span {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

.gallery-view-all-overlay small {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* ── Image counter badge ────────────────────────────────────── */
.luxury-image-counter {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    color: #fff;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
}

/* ── Lightbox ───────────────────────────────────────────────── */
.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.gallery-lightbox.open {
    display: flex;
}

.gallery-lightbox-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-img {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.2s ease;
    display: block;
}

.gallery-lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.gallery-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.gallery-lightbox-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.gallery-lightbox-arrow:hover {
    background: rgba(255,255,255,0.3);
}

.gallery-lightbox-prev { left: 16px; }
.gallery-lightbox-next { right: 16px; }

.gallery-lightbox-counter {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-top: 14px;
    font-weight: 500;
}

/* ── Thumbnail strip ────────────────────────────────────────── */
.gallery-thumb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f0f0f0;
}

.gallery-thumb-strip::-webkit-scrollbar { height: 5px; }
.gallery-thumb-strip::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.gallery-thumb-strip::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.gallery-thumb-item {
    flex-shrink: 0;
    width: 80px;
    height: 58px;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.gallery-thumb-item:hover {
    transform: translateY(-2px);
    border-color: #aaa;
}

.gallery-thumb-item.active {
    border-color: #3554D1;
}

.gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .gallery-hero-grid {
        display: block;
        border-spacing: 0;
    }

    .gallery-hero-main,
    .gallery-hero-side {
        display: block;
        width: 100%;
    }

    .gallery-hero-main-img {
        height: 260px;
        border-radius: 10px 10px 0 0;
    }

    .gallery-side-grid {
        height: 130px;
        display: flex;
        flex-direction: row;
        gap: 3px;
    }

    .gallery-side-row {
        display: contents;
    }

    .gallery-side-cell {
        display: block;
        flex: 1;
        height: 130px;
    }

    .gallery-side-cell img {
        border-radius: 0 !important;
    }

    .gallery-side-row:last-child .gallery-side-cell:last-child img {
        border-radius: 0 0 10px 0 !important;
    }

    .gallery-side-row:last-child .gallery-side-cell:first-child img {
        border-radius: 0 0 0 10px !important;
    }

    .gallery-lightbox-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .gallery-lightbox-prev { left: 8px; }
    .gallery-lightbox-next { right: 8px; }
}

/* ── Shimmer loading ────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.gallery-hero-main-img,
.gallery-side-cell img {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 400px 100%;
}
