/* WILA Logo Slider — circular logo grid → mobile marquee
 *
 * Ported from a standalone reference build (.gl-affil / .gl-affil__*).
 * Classes are prefixed wila-accred (not the reference's bare
 * "gl-affil") to avoid colliding with theme or other plugin CSS.
 *
 * Sizing/color values that have Elementor Style controls are set via
 * CSS custom properties or direct selector overrides written inline
 * by the widget PHP (see class-logo-slider-widget.php); the values
 * below are the defaults those controls start from, matching the
 * reference 1:1. --wila-accred-duration is the one exception: it's
 * always set inline per-instance since the widget always has a value
 * for it.
 *
 * Unlike the reference, the section height is NOT hardcoded per
 * breakpoint (310 / 280 / 110 / 105px) — it's left to flow from the
 * item size + padding, so custom logo sizes set via the Style tab
 * never get clipped.
 */

.wila-accred {
    width: 100%;
    max-width: 1110px;

    margin: 34px auto 0;
    padding: 16px 0;

    background: #ffffff;

    overflow: hidden;

    --wila-accred-duration: 30s;
}

.wila-accred *,
.wila-accred *::before,
.wila-accred *::after {
    box-sizing: border-box;
}


/* ---------- Viewport ---------- */

.wila-accred__viewport {
    width: 100%;
    overflow: hidden;
}


/* ---------- Track ---------- */

.wila-accred__track {
    width: 100%;

    display: flex;
    flex-direction: column;

    align-items: center;
}


/* ---------- Group (desktop/tablet: grid) ---------- */

.wila-accred__group {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(6, 128px);

    justify-content: center;

    column-gap: 40px;
    row-gap: 30px;

    flex-shrink: 0;
}

/* Duplicate group hidden on desktop/tablet — only needed for the
   mobile marquee loop. */
.wila-accred__group:nth-child(2) {
    display: none;
}

/* Second row on desktop/tablet starts at column 2, matching the
   reference's 10-logo (6 + 4) layout. */
.wila-accred__group .wila-accred__item:nth-child(7) {
    grid-column: 2;
}
.wila-accred__group .wila-accred__item:nth-child(8) {
    grid-column: 3;
}
.wila-accred__group .wila-accred__item:nth-child(9) {
    grid-column: 4;
}
.wila-accred__group .wila-accred__item:nth-child(10) {
    grid-column: 5;
}


/* ---------- Logo item ---------- */

.wila-accred__item {
    width: 128px;
    height: 128px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    border-radius: 50%;

    background: #ffffff;

    border: 2px solid #e3e6ea;

    box-shadow:
        0 3px 7px rgba(0, 0, 0, 0.08),
        0 8px 18px rgba(0, 0, 0, 0.06);

    overflow: hidden;

    flex-shrink: 0;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.wila-accred__item img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 9px;

    border-radius: 50%;
}

.wila-accred__item:hover {
    transform: translateY(-3px);

    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.10),
        0 12px 24px rgba(0, 0, 0, 0.07);
}

/* Style tab → "Lift on Hover" = off */
.wila-accred--no-hover-lift .wila-accred__item:hover {
    transform: none;
}


/* =========================================
   TABLET
   ========================================= */

@media (max-width: 991px) {

    .wila-accred {
        padding: 15px;
    }

    .wila-accred__group {
        grid-template-columns: repeat(6, 105px);
        column-gap: 20px;
        row-gap: 25px;
    }

    .wila-accred__item {
        width: 105px;
        height: 105px;
    }

    .wila-accred__item img {
        padding: 7px;
    }
}


/* =========================================
   MOBILE — switches to a marquee
   ========================================= */

@media (max-width: 767px) {

    .wila-accred {
        max-width: none;
        margin: 20px 0 0;
        padding: 0;
        background: #ffffff;
    }

    .wila-accred__viewport {
        width: 100%;
    }

    .wila-accred__track {
        width: max-content;

        display: flex;
        flex-direction: row;
        align-items: center;

        animation: wilaAccredMarquee var(--wila-accred-duration, 30s) linear infinite;

        will-change: transform;
    }

    /* Style tab → Mobile Marquee → Direction = "Left to Right" */
    .wila-accred[data-marquee-direction="right"] .wila-accred__track {
        animation-direction: reverse;
    }

    .wila-accred__group {
        width: max-content;

        display: flex;
        flex-direction: row;
        align-items: center;

        gap: 22px;

        flex-shrink: 0;
    }

    /* Show duplicate on mobile so the loop is seamless */
    .wila-accred__group:nth-child(2) {
        display: flex;
    }

    .wila-accred__item {
        width: 88px;
        height: 88px;
        flex: 0 0 88px;

        border-width: 1.5px;

        box-shadow:
            0 3px 7px rgba(0, 0, 0, 0.08),
            0 6px 14px rgba(0, 0, 0, 0.05);
    }

    /* Remove desktop/tablet grid positioning */
    .wila-accred__group .wila-accred__item:nth-child(7),
    .wila-accred__group .wila-accred__item:nth-child(8),
    .wila-accred__group .wila-accred__item:nth-child(9),
    .wila-accred__group .wila-accred__item:nth-child(10) {
        grid-column: auto;
    }

    .wila-accred__item img {
        padding: 6px;
    }

    /* No hover movement on touch */
    .wila-accred__item:hover {
        transform: none;
    }
}


/* =========================================
   SMALL MOBILE
   ========================================= */

@media (max-width: 480px) {

    .wila-accred__group {
        gap: 18px;
    }

    .wila-accred__item {
        width: 82px;
        height: 82px;
        flex-basis: 82px;
    }

    .wila-accred__item img {
        padding: 5px;
    }
}


/* =========================================
   MOBILE MARQUEE ANIMATION
   ========================================= */

@keyframes wilaAccredMarquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}


/* =========================================
   REDUCE MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .wila-accred__track {
        animation: none;
    }
}
