/* Tour Gallery Styling */

.custom-masonry-gallery-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
}

/* Default hidden on desktop */
.gallery-nav {
    display: none;
}

/* Desktop Grid Layout */
.custom-masonry-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, 240px);
    gap: 10px;
    border-radius: 12px;
    overflow: hidden;
}

.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

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

.gallery-item-1 {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.gallery-item-2 {
    grid-column: 2;
    grid-row: 1;
}

.gallery-item-3 {
    grid-column: 3;
    grid-row: 1;
}

.gallery-item-4 {
    grid-column: 2;
    grid-row: 2;
}

.gallery-item-5 {
    grid-column: 3;
    grid-row: 2;
}

/* Hide items beyond 5 on desktop to preserve grid */
.custom-masonry-gallery .gallery-item:nth-child(n+6) {
    display: none;
}

/* Show All Button - Desktop Overlay */
.gallery-show-all {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.show-all-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #1a1a1a;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.show-all-button:hover {
    background: #f8f8f8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    color: #000;
}

.show-all-button i {
    font-size: 18px;
}

/* Gallery Dots (Hidden on Desktop) */
.gallery-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.gallery-dot.active {
    background: #1d4ed8;
    transform: scale(1.2);
    border-color: #1d4ed8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .custom-masonry-gallery-wrapper {
        margin-bottom: 0;
    }

    .custom-masonry-gallery {
        display: block !important;
        white-space: nowrap !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        grid-template-columns: none;
        grid-template-rows: none;
        border-radius: 0;
        aspect-ratio: 16/9;
        height: auto;
        font-size: 0;
    }

    /* Hide scrollbar */
    .custom-masonry-gallery::-webkit-scrollbar {
        display: none;
    }

    .custom-masonry-gallery {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .gallery-item {
        display: inline-block !important;
        width: 100% !important;
        min-width: 100% !important;
        white-space: normal;
        vertical-align: top;
        scroll-snap-align: start;
        height: 100%;
        margin: 0;
    }



    /* Show all items on mobile */
    .custom-masonry-gallery .gallery-item:nth-child(n+6) {
        display: inline-block !important;
    }

    .gallery-item img {
        border-radius: 0;
    }

    /* Show All Button - Mobile Position */
    .gallery-show-all {
        top: 15px;
        right: 15px;
        bottom: auto;
    }

    .show-all-button {
        padding: 6px 12px !important;
        font-size: 12px !important;
        background: rgba(255, 255, 255, 0.38) !important;
        backdrop-filter: blur(4px);
    }

    /* Navigation Arrows */
    .gallery-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(4px);
        border-radius: 50%;
        font-size: 20px;
        color: #333;
        z-index: 20;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        margin-top: 0;
        /* Offset for dots/margin */
    }

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

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

    /* Show Gallery Dots on Mobile */
    .gallery-dots {
        display: flex;
        position: relative;
        z-index: 10;
        padding: 0 16px;
        margin-top: 16px;
        margin-bottom: 0;
    }

    .gallery-dot {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .gallery-dot.active {
        background: #1d4ed8;
        border-color: #1d4ed8;
    }
}