/**
 * Infinite Logo Carousel Stylesheet
 * Hardware-accelerated pure CSS marquee animation
 */

:root {
    --ilc-duration: 30s;
    --ilc-gap: 50px;
    --ilc-logo-height: 36px;
    --ilc-logo-max-width: 130px;
    --ilc-opacity: 0.7;
    --ilc-transition: 0.3s;
    --ilc-fade-width: 80px;
}

/* ==========================================================================
   Outer Carousel Wrapper
   ========================================================================== */
.ilc-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    background-color: transparent;
    padding: 10px 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ==========================================================================
   Edge Fade Gradient Mask
   Works seamlessly over light, dark, image, or transparent backgrounds
   ========================================================================== */
.ilc-carousel-wrapper.ilc-has-edge-fade {
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 1) var(--ilc-fade-width, 80px),
        rgba(0, 0, 0, 1) calc(100% - var(--ilc-fade-width, 80px)),
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 1) var(--ilc-fade-width, 80px),
        rgba(0, 0, 0, 1) calc(100% - var(--ilc-fade-width, 80px)),
        rgba(0, 0, 0, 0) 100%
    );
}

/* ==========================================================================
   Continuous Scrolling Track
   ========================================================================== */
.ilc-carousel-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: max-content;
    will-change: transform;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: var(--ilc-duration, 30s);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

/* Left Direction Animation */
.ilc-direction-left .ilc-carousel-track {
    animation-name: ilc-scroll-left;
}

/* Right Direction Animation */
.ilc-direction-right .ilc-carousel-track {
    animation-name: ilc-scroll-right;
}

/* Pause on Hover */
.ilc-pause-on-hover:hover .ilc-carousel-track {
    animation-play-state: paused;
}

/* ==========================================================================
   Logo Groups (Identical copies for seamless 50% translation loop)
   ========================================================================== */
.ilc-logo-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
    gap: var(--ilc-gap, 50px);
    padding-right: var(--ilc-gap, 50px);
    box-sizing: border-box;
}

/* ==========================================================================
   Individual Logo Item & Image
   High specificity to override ANY theme stylesheet (Astra, Hello, OceanWP, etc.)
   ========================================================================== */
.ilc-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    line-height: 0;
}

.ilc-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    outline: none;
    border: none;
    cursor: pointer;
    line-height: 0;
}

/* Heavy specificity rule so themes cannot blow up logo dimensions */
.ilc-carousel-wrapper .ilc-logo-item img.ilc-logo-img,
.elementor-widget-ilc_logo_carousel img.ilc-logo-img,
img.ilc-logo-img {
    display: block !important;
    height: var(--ilc-logo-height, 36px) !important;
    max-height: var(--ilc-logo-height, 36px) !important;
    width: auto !important;
    max-width: var(--ilc-logo-max-width, 130px) !important;
    object-fit: contain !important;
    opacity: var(--ilc-opacity, 0.7);
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    transition: filter var(--ilc-transition, 0.3s) cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity var(--ilc-transition, 0.3s) cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform var(--ilc-transition, 0.3s) cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: auto;
    -webkit-user-drag: none;
}

/* ==========================================================================
   Optical Balance (Harmonized Wide Logos)
   ========================================================================== */
.ilc-has-optical-balance .ilc-ratio-ultrawide img.ilc-logo-img {
    height: calc(var(--ilc-logo-height, 36px) * 0.72) !important;
    max-height: calc(var(--ilc-logo-height, 36px) * 0.72) !important;
}

.ilc-has-optical-balance .ilc-ratio-wide img.ilc-logo-img {
    height: calc(var(--ilc-logo-height, 36px) * 0.84) !important;
    max-height: calc(var(--ilc-logo-height, 36px) * 0.84) !important;
}

.ilc-has-optical-balance .ilc-ratio-square img.ilc-logo-img {
    height: var(--ilc-logo-height, 36px) !important;
    max-height: var(--ilc-logo-height, 36px) !important;
}

.ilc-has-optical-balance .ilc-ratio-tall img.ilc-logo-img {
    height: var(--ilc-logo-height, 36px) !important;
    max-height: var(--ilc-logo-height, 36px) !important;
    max-width: calc(var(--ilc-logo-max-width, 130px) * 0.8) !important;
}

/* ==========================================================================
   Color & Hover Effects
   ========================================================================== */

/* Grayscale state (Monochrome flat gray) */
.ilc-grayscale img.ilc-logo-img {
    filter: grayscale(100%) !important;
}

/* Hover: Full Color */
.ilc-hover-color .ilc-logo-item:hover img.ilc-logo-img {
    filter: grayscale(0%) !important;
    opacity: 1 !important;
}

/* Hover: Scale Up */
.ilc-hover-scale .ilc-logo-item:hover img.ilc-logo-img {
    transform: scale(1.1) !important;
    opacity: 1 !important;
}

/* Hover: Both (Full Color + Scale Up) */
.ilc-hover-both .ilc-logo-item:hover img.ilc-logo-img {
    filter: grayscale(0%) !important;
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

/* ==========================================================================
   Keyframe Animations
   Translate from 0 to -50% for 100% smooth, seamless wrapping
   ========================================================================== */
@keyframes ilc-scroll-left {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes ilc-scroll-right {
    0% {
        transform: translate3d(-50%, 0, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ilc-carousel-track {
        animation-play-state: paused !important;
    }
}
