/* ===================================================================
   Infinite Dual-Row Testimonials Carousel
   Smooth Draggable & Interactive Marquee with Smooth Hover Slowdown
   =================================================================== */

.testim-modern {
    position: relative;
}

/* Marquee Container with edge fade masks & gap control */
.testimonials-marquee-wrapper {
    --testim-gap-x: 24px;
    --testim-gap-y: 34px;
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: var(--testim-gap-y);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
    touch-action: pan-y;
}

/* Row has overflow: visible; padding & margin 0 so vertical gap is strictly --testim-gap */
.marquee-row {
    display: flex;
    overflow: visible;
    width: 100%;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    cursor: -webkit-grab;
    touch-action: pan-y;
}

.marquee-row.is-dragging {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.marquee-row:last-child {
    margin-bottom: 0;
}

.marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
    align-items: stretch;
}

.marquee-group {
    display: flex;
    align-items: stretch;
    gap: var(--testim-gap-x);
    padding-right: var(--testim-gap-x);
    flex-shrink: 0;
}

/* Testimonial Card Styling */
.testim-card {
    width: 420px;
    min-width: 420px;
    max-width: 420px;
    background: linear-gradient(145deg, rgba(24, 24, 24, 0.95) 0%, rgba(16, 16, 16, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 28px 28px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s ease,
                background 0.35s ease;
    box-sizing: border-box;
    height: 100%;
}

.testim-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.22);
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.98) 0%, rgba(20, 20, 20, 1) 100%);
    box-shadow: none;
}

.marquee-row.is-dragging .testim-card {
    pointer-events: none;
    transform: none !important;
}

.testim-card img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.testim-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.testim-card-top .testim-stars {
    display: inline-flex;
    gap: 4px;
    color: #ffb703;
    font-size: 13px;
}

.testim-card-top .testim-quote-icon {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.2);
    transition: color 0.3s ease, opacity 0.3s ease;
}

.testim-card:hover .testim-card-top .testim-quote-icon {
    color: #ffb703;
    opacity: 0.6;
}

.testim-card-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.testim-card-body p {
    font-size: 15px;
    line-height: 1.65;
    color: #d1d5db;
    font-weight: 300;
    margin: 0;
}

.testim-card-author {
    display: flex;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: auto;
}

.testim-card-author .author-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    margin-right: 14px;
    background: #202020;
}

.testim-card-author .author-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.testim-card-author .author-info {
    overflow: hidden;
}

.testim-card-author .author-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 3px 0;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.testim-card-author .author-role {
    font-size: 13px;
    color: #9ca3af;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments */
@media screen and (max-width: 991px) {
    .testimonials-marquee-wrapper {
        --testim-gap-x: 18px;
        --testim-gap-y: 28px;
        padding: 20px 0;
    }

    .testim-card {
        width: 360px;
        min-width: 360px;
        max-width: 360px;
        padding: 24px 22px 22px;
    }

    .testim-card-body p {
        font-size: 14px;
        line-height: 1.6;
    }
}

@media screen and (max-width: 600px) {
    .testimonials-marquee-wrapper {
        --testim-gap-x: 14px;
        --testim-gap-y: 24px;
        padding: 16px 0;
    }

    .testim-card {
        width: 300px;
        min-width: 300px;
        max-width: 300px;
        padding: 20px 18px 18px;
    }

    .testim-card-author .author-img {
        width: 42px;
        height: 42px;
        margin-right: 12px;
    }

    .testim-card-author .author-name {
        font-size: 15px;
    }

    .testim-card-author .author-role {
        font-size: 12px;
    }

    .testim-card-body p {
        font-size: 13.5px;
    }

    .testimonials-marquee-wrapper {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
    }
}
