/*
 * Webtris Digital - Gallery Carousel Enhancer v2.0.0
 * Add "equal-height-carousel" to the Elementor Image Carousel widget.
 */

.elementor-widget-image-carousel.equal-height-carousel {
    --webtris-carousel-height: 275px;
    --webtris-carousel-gap: 20px;
    --webtris-carousel-left-inset: 8px;
    --webtris-carousel-left-fade: 52px;
    --webtris-carousel-right-fade: 90px;
    --webtris-carousel-fade-color: #0F1E35;
    --webtris-carousel-arrow-color: #FFFFFF;

    position: relative !important;
    width: 100%;
    overflow: hidden;
}

/* Hide Elementor/Swiper arrows after the Webtris controls take over. */
.elementor-widget-image-carousel.equal-height-carousel[data-webtris-gallery-ready="1"] .elementor-swiper-button,
.elementor-widget-image-carousel.equal-height-carousel[data-webtris-gallery-ready="1"] .swiper-button-prev,
.elementor-widget-image-carousel.equal-height-carousel[data-webtris-gallery-ready="1"] .swiper-button-next {
    display: none !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-viewport {
    width: 100% !important;
    height: var(--webtris-carousel-height) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    touch-action: pan-x pan-y;
    position: relative;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-viewport::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-track {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: max-content !important;
    min-width: 100% !important;
    height: var(--webtris-carousel-height) !important;
    gap: var(--webtris-carousel-gap) !important;
    column-gap: var(--webtris-carousel-gap) !important;
    row-gap: 0 !important;
    margin: 0 !important;
    padding: 0 0 0 var(--webtris-carousel-left-inset) !important;
    transform: none !important;
    transition: none !important;
    box-sizing: border-box !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide {
    display: block !important;
    width: var(--webtris-slide-width, var(--webtris-carousel-height)) !important;
    height: var(--webtris-carousel-height) !important;
    flex: 0 0 var(--webtris-slide-width, var(--webtris-carousel-height)) !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    box-sizing: border-box !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide.webtris-gallery-empty,
.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide.webtris-gallery-broken {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    flex: 0 0 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide .swiper-slide-inner,
.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide a,
.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide figure,
.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide picture {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-slide img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    border-radius: 10px !important;
}

/*
 * Fade overlays. They intentionally overlap the first/last visible images a
 * little, while matching the RMD section background.
 */
.elementor-widget-image-carousel.equal-height-carousel[data-webtris-gallery-ready="1"]:not(.webtris-gallery-no-images)::before,
.elementor-widget-image-carousel.equal-height-carousel[data-webtris-gallery-ready="1"]:not(.webtris-gallery-no-images)::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 30 !important;
    pointer-events: none !important;
}

.elementor-widget-image-carousel.equal-height-carousel[data-webtris-gallery-ready="1"]:not(.webtris-gallery-no-images)::before {
    left: 0 !important;
    width: var(--webtris-carousel-left-fade) !important;
    background: linear-gradient(
        to right,
        #0F1E35 0%,
        rgba(15, 30, 53, 0.82) 22%,
        rgba(15, 30, 53, 0.38) 58%,
        rgba(15, 30, 53, 0) 100%
    ) !important;
}

.elementor-widget-image-carousel.equal-height-carousel[data-webtris-gallery-ready="1"]:not(.webtris-gallery-no-images)::after {
    right: 0 !important;
    width: var(--webtris-carousel-right-fade) !important;
    background: linear-gradient(
        to right,
        rgba(15, 30, 53, 0) 0%,
        rgba(15, 30, 53, 0.38) 40%,
        rgba(15, 30, 53, 0.82) 74%,
        #0F1E35 100%
    ) !important;
}

/* Plugin-owned controls: independent per carousel, including second/later rows. */
.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    position: absolute !important;
    top: 50% !important;
    width: 44px !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: var(--webtris-carousel-arrow-color) !important;
    cursor: pointer !important;
    z-index: 50 !important;
    transform: translateY(-50%) !important;
    transition: opacity 0.2s ease !important;
    box-shadow: none !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control-prev {
    left: 6px !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control-next {
    right: 6px !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control-icon {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    overflow: visible !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 3.2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    transform: scale(1) !important;
    transform-origin: 50% 50% !important;
    transition: transform 0.22s ease !important;
    will-change: transform;
}

/* Only the SVG grows. The button itself never changes position or size. */
.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control:hover .webtris-gallery-control-icon,
.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control:focus-visible .webtris-gallery-control-icon {
    transform: scale(1.16) !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9) !important;
    outline-offset: 1px !important;
    border-radius: 6px !important;
}

.elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control:disabled,
.elementor-widget-image-carousel.equal-height-carousel.webtris-gallery-single-image .webtris-gallery-control,
.elementor-widget-image-carousel.equal-height-carousel.webtris-gallery-no-images .webtris-gallery-control {
    display: none !important;
}

/* If every configured image is missing/404, do not leave a 275px blank strip. */
.elementor-widget-image-carousel.equal-height-carousel.webtris-gallery-no-images .webtris-gallery-viewport {
    display: none !important;
    height: 0 !important;
}

@media (max-width: 1024px) {
    .elementor-widget-image-carousel.equal-height-carousel {
        --webtris-carousel-height: 235px;
        --webtris-carousel-gap: 16px;
        --webtris-carousel-left-inset: 7px;
        --webtris-carousel-left-fade: 42px;
        --webtris-carousel-right-fade: 70px;
    }

    .elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control {
        width: 40px !important;
        height: 52px !important;
    }

    .elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control-icon {
        width: 27px !important;
        height: 27px !important;
    }
}

@media (max-width: 767px) {
    .elementor-widget-image-carousel.equal-height-carousel {
        --webtris-carousel-height: 200px;
        --webtris-carousel-gap: 12px;
        --webtris-carousel-left-inset: 6px;
        --webtris-carousel-left-fade: 34px;
        --webtris-carousel-right-fade: 52px;
    }

    .elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control {
        width: 36px !important;
        height: 48px !important;
    }

    .elementor-widget-image-carousel.equal-height-carousel .webtris-gallery-control-icon {
        width: 24px !important;
        height: 24px !important;
    }
}
