/* File: wp-content/plugins/bm-core-customizations/assets/css/bm-lightbox.css */

/* 1. Hide all images except the first one */
.wp-block-gallery.is-style-bm-lightbox figure.wp-block-image:nth-child(n+2) {
    display: none !important;
}

/* 2. Format the first image container to hold our new button */
.wp-block-gallery.is-style-bm-lightbox figure.wp-block-image:first-child {
    position: relative;
    cursor: pointer;
    width: 100% !important;
    margin: 0 !important;
}

/* 3. Force the 4:3 Aspect Ratio */
.wp-block-gallery.is-style-bm-lightbox figure.wp-block-image:first-child img {
    aspect-ratio: 4 / 3;
    object-fit: cover; 
    width: 100%;
    display: block;
    border-radius: 4px; 
}

/* 4. The "Photo Count" Pseudo-button */
.wp-block-gallery.is-style-bm-lightbox figure.wp-block-image:first-child::after {
    content: attr(data-photo-count); 
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(26, 44, 66, 0.7); /* bm Dark Blue */
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px; 
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
}

/* 5. The Fullscreen Modal Overlay */
.bm-lightbox-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.9); /* Updated to transparent black */
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bm-lightbox-modal.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* 6. The Content Wrapper (Stacks Image and Caption) */
.bm-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 7. The Image Inside the Modal */
.bm-lightbox-content img {
    max-width: 90vw;
    max-height: 75vh; /* Reduced slightly to leave room for the caption */
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 8. The Caption Text */
.bm-lightbox-caption {
    color: #ffffff;
    font-size: 1.1rem;
    margin-top: 15px;
    text-align: center;
    max-width: 80vw;
    font-weight: 400;
}

/* 9. The Navigation Buttons */
.bm-lightbox-btn {
    position: absolute;
    background: transparent;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 100001;
    transition: color 0.2s;
}
.bm-lightbox-close { top: 20px; right: 30px; font-size: 2.5rem; }
.bm-lightbox-prev { top: 50%; left: 20px; transform: translateY(-50%); }
.bm-lightbox-next { top: 50%; right: 20px; transform: translateY(-50%); }

/* 10. The Thumbnail Strip Container */
.bm-lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 90vw;
    overflow-x: auto; /* Keeps the scrolling functionality */
    padding-bottom: 10px;
    z-index: 100002;
    
    /* NEW: Hide the scrollbar across different browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and older Edge */
}

/* Hide scrollbar for Chrome, Safari, and newer Edge */
.bm-lightbox-thumbnails::-webkit-scrollbar {
    display: none !important;
}

/* 11. Individual Thumbnails */
.bm-lightbox-thumb {
    /* NEW: Increased size by exactly 30% */
    height: 78px;
    width: 104px;
    object-fit: cover;
    cursor: pointer;
    opacity: 1;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevents them from getting squished */
}

/* 12. Active and Hover States */
.bm-lightbox-thumb:hover {
    opacity: 0.8;
}

.bm-lightbox-thumb.active {
    opacity: 0.4;
    transform: scale(1.05); /* Pops it out slightly */
}

/* Ensure the main image shrinks slightly so it doesn't overlap the new thumbnails */
@media screen and (max-height: 800px) {
    .bm-lightbox-content img {
        max-height: 65vh; 
    }
}