/* ============================================================
   Frontend Testimonials  [cf_testimonials]
   Add to public/css/testimonials.css  (or append to shortcodes.css)
   ============================================================ */

/* ── Grid ────────────────────────────────────────────────────── */

.cf-testimonials {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
    gap: 20px;
}

/* ── Card ────────────────────────────────────────────────────── */

.cf-testimonial {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Quote ───────────────────────────────────────────────────── */

.cf-testimonial__quote {
    margin: 0;
    padding: 0;
    font-size: 0.92rem;
    line-height: 1.65;
    color: #333;
    position: relative;
}

/* Opening quotation mark */
.cf-testimonial__quote::before {
    content: '\201C';
    font-size: 2.5rem;
    line-height: 0;
    vertical-align: -0.5rem;
    color: #d0d0d0;
    margin-right: 2px;
}

/* ── Footer ──────────────────────────────────────────────────── */

.cf-testimonial__footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* ── Avatar initial circle ───────────────────────────────────── */

.cf-testimonial__avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Meta ────────────────────────────────────────────────────── */

.cf-testimonial__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cf-testimonial__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-testimonial__product {
    font-size: 0.775rem;
    color: #2d7a4f;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-testimonial__date {
    font-size: 0.75rem;
    color: #aaa;
}

/* ── Pledge amount badge ─────────────────────────────────────── */

.cf-testimonial__amount {
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
    background: #2d7a4f;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media ( max-width: 600px ) {
    .cf-testimonials {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Carousel variant  [cf_testimonials carousel="1"]
   ============================================================ */

.cf-testimonials-carousel {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    scroll-margin-top: 90px;
}

.cf-testimonials {
    scroll-margin-top: 90px;
}

.cf-testimonials--carousel {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 4px;
    flex: 1 1 auto;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cf-testimonials--carousel::-webkit-scrollbar {
    display: none;
}

.cf-testimonials--carousel .cf-testimonial {
    scroll-snap-align: start;
    flex: 0 0 320px;
    max-width: 320px;
}

.cf-testimonials-carousel__nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #1a1a1a;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.cf-testimonials-carousel__nav:hover {
    background: #f4f4f4;
}

.cf-testimonials-carousel__nav[disabled] {
    opacity: 0.35;
    cursor: default;
}

/* ── Pager dots ──────────────────────────────────────────────── */

.cf-testimonials-carousel__pager {
    flex: 1 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.cf-testimonials-carousel__pager:empty {
    display: none;
}

.cf-testimonials-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d0d0d0;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.cf-testimonials-carousel__dot:hover {
    background: #aaa;
}

.cf-testimonials-carousel__dot--active {
    background: #2d7a4f;
    transform: scale( 1.3 );
}

@media ( max-width: 600px ) {
    .cf-testimonials--carousel {
        grid-template-columns: none;
    }
    .cf-testimonials--carousel .cf-testimonial {
        flex-basis: 82vw;
        max-width: 82vw;
    }
    .cf-testimonials-carousel__nav {
        display: none;
    }
}