/* Make all images fit inside their slides */
.calmhaven-gallery-basic img,
.calmhaven-gallery-carousel img,
.calmhaven-gallery-justified img {
    width: 100%;
    height: auto;
    display: block;
    
    object-fit: cover; /* ensures no stretching */
}






/* Carousel wrapper full width */
.calmhaven-gallery-carousel-wrapper {
    width: 100%;
    overflow: hidden;
}

/* Swiper slides should shrink and grow */
.calmhaven-gallery-carousel .swiper-slide {
    flex: 0 0 auto; /* keep this */
    width: auto; /* allow Swiper JS to calculate proper width */
    max-width: 100%; /* prevent overflow */
}   

/* Image inside swiper-slide */
.calmhaven-gallery-carousel .swiper-slide img {
    width: 100%;
    height: auto;
   display: block;
}







.calmhaven-gallery-masonry {
    column-width: 250px;
    column-gap: 16px;
}
.calmhaven-gallery-masonry .calmhaven-masonry-item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 16px;
}

/* Images inside masonry items */
.calmhaven-gallery-masonry .calmhaven-masonry-item img {
    width: 100%;
    height: auto;
    display: block;
   
}







/* Lightbox overlay */
#calmhaven-gallery-lightbox {
    display: none; /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    
    justify-content: center; /* horizontal center */
    align-items: center;     /* vertical center */
}

/* Lightbox image */
#calmhaven-gallery-lightbox img#calmhaven-gallery-preview {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Close button */
#calmhaven-gallery-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
}

