/* Carousel wrapper */
.elcwg-carousel-wrapper {
    position: relative;
    width: 100vw;
    margin: 0;
    overflow: hidden;
    background-color: white;
}

/* Remove background from cover elements */
.wp-block-cover__background,
.has-accent-6-background-color,
.has-background-dim {
    background-color: transparent !important;
}

/* Gallery base styles */
.wp-block-gallery.elcwg_carousel_active {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
    background-color: white;
}

/* Inner wrapper */
.elcwg-carousel-inner {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    background-color: white;
}

/* Slide styles */
.elcwg-carousel-inner .gallery-item {
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
}

/* Image styles */
.elcwg-carousel-inner .gallery-item img {
    width: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Caption styles */
.elcwg-carousel-inner .gallery-caption {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    font-size: 0.9em;
    border-radius: 4px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Non-carousel galleries */
.wp-block-gallery:not(.elcwg_carousel_active) {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .elcwg-carousel-inner .gallery-item img {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .elcwg-carousel-inner .gallery-item img {
        min-height: 120px;
    }
}