/* Logo Marquee widget
   Seamless, CSS-only infinite scroll. The logo set is rendered twice inside
   .rw-marquee__track; the track animates to translateX(-50%), which lands
   exactly on the second (duplicate) copy for a gapless loop. */

.rw-marquee {
    /* Overridable via Elementor controls (see marquee.php selectors). */
    --rw-marquee-logo-height: 3rem;
    --rw-marquee-gap: 4rem;
    --rw-marquee-fade-color: #ffffff;
    --rw-marquee-fade-width: 120px;
    /* How many logos fit across the visible area (equal-width slots). */
    --rw-marquee-visible: 9;
    /* Fixed, restful default speed. Tweak here if needed. */
    --rw-marquee-duration: 40s;

    position: relative;
    overflow: hidden;
    width: 100%;
    /* Establishes the reference width for the cqw slot calculation below. */
    container-type: inline-size;
}

/* Fade-out gradients at both ends, in the chosen colour. */
.rw-marquee::before,
.rw-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--rw-marquee-fade-width);
    z-index: 2;
    pointer-events: none;
}

.rw-marquee::before {
    left: 0;
    background: linear-gradient(to right, var(--rw-marquee-fade-color), transparent);
}

.rw-marquee::after {
    right: 0;
    background: linear-gradient(to left, var(--rw-marquee-fade-color), transparent);
}

.rw-marquee__track {
    display: flex;
    width: max-content;
    animation: rw-marquee-scroll var(--rw-marquee-duration) linear infinite;
    will-change: transform;
}

/* Pause on hover so visitors can read a logo. */
.rw-marquee:hover .rw-marquee__track {
    animation-play-state: paused;
}

.rw-marquee__group {
    display: flex;
    align-items: center;
    gap: var(--rw-marquee-gap);
    /* Trailing gap so the seam between the two copies keeps even spacing. */
    padding-right: var(--rw-marquee-gap);
    margin: 0;
    padding-left: 0;
    list-style: none;
    flex: 0 0 auto;
}

.rw-marquee__item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--rw-marquee-logo-height);
    /* Equal-width slots so exactly --rw-marquee-visible logos fit across.
       Each slot + its gap = 100cqw / visible, so `visible` cells span the
       full container width. */
    width: calc(100cqw / var(--rw-marquee-visible) - var(--rw-marquee-gap));
}

.rw-marquee__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

@keyframes rw-marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Respect users who prefer reduced motion: stop the animation and let the
   logos sit still (scrollable if they overflow). */
@media (prefers-reduced-motion: reduce) {
    .rw-marquee__track {
        animation: none;
        width: 100%;
        overflow-x: auto;
    }

    /* The duplicate copy is redundant when static; hide it. */
    .rw-marquee__group[aria-hidden="true"] {
        display: none;
    }
}
