
/* ==========================================
   KARAM AL BALAD - FLOATING GUEST REVIEWS
========================================== */

/* Natural-height review section */

.reviews-section {
    position: relative;
    overflow: hidden;

    padding-bottom: 65px;
}

/* Full-width sliding window */

.reviews-marquee {
    width: 100%;
    position: relative;
    overflow: hidden;

    padding: 25px 0 40px;

    /* Fade the left and right edges */

    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 7%,
        black 93%,
        transparent 100%
    );

    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 7%,
        black 93%,
        transparent 100%
    );
}

/* Continuously moving track */

.reviews-marquee .reviews-track {
    display: flex;
    align-items: center;
    gap: 24px;

    width: max-content;
    max-width: none;

    animation: kh-review-slide 35s linear infinite;

    will-change: transform;
}

/* Groups of six cards */

.reviews-marquee .reviews-group {
    display: flex;
    align-items: center;

    flex: 0 0 auto;
    gap: 24px;
}

/* Individual review cards */

.reviews-marquee .review-photo {
    position: relative;
    inset: auto;

    display: block;

    flex: 0 0 clamp(310px, 42vw, 600px);
    width: clamp(310px, 42vw, 600px);

    height: auto;
    aspect-ratio: 2.1 / 1;

    object-fit: contain;

    background: transparent;
    padding: 0;

    border: 1px solid rgba(181, 155, 106, 0.45);
    border-radius: 16px;

    opacity: 1;
    transform: none;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.30);

    transition: none;

    pointer-events: auto;
}

/* Seamless motion:
   move exactly one group plus the track gap */

@keyframes kh-review-slide {

    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(
            calc(-50% - 12px),
            0,
            0
        );
    }
}

/* Never pause on hover */

.reviews-marquee:hover .reviews-track {
    animation-play-state: running;
}

/* Tablet */

@media (max-width: 900px) {

    .reviews-marquee .review-photo {
        flex-basis: min(65vw, 500px);
        width: min(65vw, 500px);
    }

    .reviews-marquee .reviews-track,
    .reviews-marquee .reviews-group {
        gap: 24px;
    }
}

/* Mobile */

@media (max-width: 600px) {

    .reviews-section {
        padding-bottom: 45px;
    }

    .reviews-marquee {
        padding: 20px 0 30px;
    }

    .reviews-marquee .review-photo {
        flex-basis: 82vw;
        width: 82vw;

        border-radius: 12px;
    }

    .reviews-marquee .reviews-track {
        animation-duration: 65s;
    }
}

/* Respect device accessibility settings */

@media (prefers-reduced-motion: reduce) {
    .reviews-marquee .reviews-track {
        animation: none;
        will-change: auto;
    }
}
