/* ==========================================================================
   Testimonials — two marquee rows drifting in opposite directions inside a
   rounded, blue-framed panel.
   ========================================================================== */

.testimonial-wrapper {
    --tst-frame: #3B4FE4;
    padding: 60px 0;
    background: none;
}

.testimonial-panel {
    position: relative;
    overflow: hidden;
    padding: 48px 0 52px;
    background-color: #fff;
    border: 1px solid var(--tst-frame);
    border-radius: 24px;
}

.testimonial-heading {
    padding: 0 24px;
    margin-bottom: 38px;
    text-align: center;
}

.testimonial-heading h2 {
    max-width: 720px;
    margin: 0 auto;
    color: #0b1020;
    font-family: 'Manrope', 'Work Sans', sans-serif;
    font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.5px;
}

.testimonial-heading p {
    max-width: 640px;
    margin: 12px auto 0;
    color: #667085;
    font-size: 15px;
}


/* Marquee rows ----------------------------------------------------------- */

.testimonial-row {
    overflow: hidden;
    /* the rows run wider than the panel and fade out at both edges */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.testimonial-row + .testimonial-row {
    margin-top: 18px;
}

/* offset so the two rows never line up */
.testimonial-row.reverse .testimonial-track {
    margin-left: -130px;
}

.testimonial-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 18px;
    width: max-content;
    animation: testimonialScroll 40s linear infinite;
}

.testimonial-row.reverse .testimonial-track {
    animation-name: testimonialScrollReverse;
}

.testimonial-panel:hover .testimonial-track {
    animation-play-state: paused;
}

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

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


/* Card ------------------------------------------------------------------- */

.testimonial-card {
    flex: 0 0 270px;
    width: 270px;
    margin: 0;
    padding: 18px 18px 16px;
    background-color: #f7f8fa;
    border: 1px solid #e8eaee;
    border-radius: 12px;
}

.testimonial-quote {
    display: block;
    margin-bottom: 2px;
    color: var(--tst-frame);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 44px;
    font-weight: 700;
    line-height: .8;
}

.testimonial-card blockquote {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    color: #1c2333;
    font-size: 14px;
    line-height: 1.55;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.testimonial-author img {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-author-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.testimonial-author-name {
    color: #1c2333;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.testimonial-author-role {
    color: #8b93a5;
    font-size: 11px;
    line-height: 1.3;
}

/* From xl up the panel shows exactly four cards per row. The widths follow the
   container ladder in layout.css: (container - 3 * 18px gap) / 4. */
@media (min-width: 1200px) {
    .testimonial-card {
        flex-basis: 276px;
        width: 276px;
    }
    .testimonial-row.reverse .testimonial-track {
        margin-left: -148px;
    }
}

@media (min-width: 1400px) {
    .testimonial-card {
        flex-basis: 326px;
        width: 326px;
    }
    .testimonial-row.reverse .testimonial-track {
        margin-left: -172px;
    }
}

@media (min-width: 1600px) {
    .testimonial-card {
        flex-basis: 376px;
        width: 376px;
    }
    .testimonial-row.reverse .testimonial-track {
        margin-left: -197px;
    }
}

@media (min-width: 1760px) {
    .testimonial-card {
        flex-basis: 416px;
        width: 416px;
    }
    .testimonial-row.reverse .testimonial-track {
        margin-left: -217px;
    }
}

@media (max-width: 575.98px) {
    .testimonial-panel {
        padding: 34px 0 38px;
        border-radius: 18px;
    }
    .testimonial-heading {
        margin-bottom: 26px;
    }
    .testimonial-card {
        flex-basis: 230px;
        width: 230px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .testimonial-track {
        animation: none;
        transform: none;
    }
    .testimonial-row {
        overflow-x: auto;
    }
    .testimonial-row.reverse .testimonial-track {
        margin-left: 0;
    }
}
