/* ===== Testimonials — uses global tokens from :root ===== */

.testimonials {
    padding: var(--space-48) 0;
}

.testimonials .testimonials-header {
    margin-bottom: var(--space-32);
}

.testimonials .testimonials-header h2,
.testimonials .testimonials-header h1 {
    font-size: clamp(1.75rem, 2.1vw, 2rem);
    font-weight: var(--weight-semibold);
    line-height: var(--lh-snug);
    margin-bottom: var(--space-12);
    color: var(--ink);
}

.testimonials .testimonials-header p {
    max-width: 60ch;
}

/* Grid */
.testimonials .testimonials-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-24);
    margin-bottom: var(--space-32);
}

@media (max-width: 1024px) {
    .testimonials .testimonials-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .testimonials .testimonials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .testimonials .testimonials-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--space-16);
        padding-bottom: var(--space-16);
        margin-inline-end: -20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--ring) transparent;
    }

    .testimonials .testimonials-grid::-webkit-scrollbar { height: 8px; }
    .testimonials .testimonials-grid::-webkit-scrollbar-track { background: transparent; }
    .testimonials .testimonials-grid::-webkit-scrollbar-thumb { background: var(--ring); border-radius: 100px; }
    .testimonials .testimonials-grid::-webkit-scrollbar-thumb:hover { background: var(--gray-ink); }

    .testimonials .testimonial-card {
        flex: 0 0 85%;
        scroll-snap-align: start;
    }
}

/* Card */
.testimonials .testimonial-card {
    background: var(--surface);
    border: 1px solid var(--ring);
    border-radius: var(--radius-16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.testimonials .testimonial-card.hidden { display: none; }

/* Quote area */
.testimonials .testimonial-text,
.testimonials .testimonial-video-wrapper {
    padding: var(--space-24);
    padding-bottom: 20px;
}

.testimonials .testimonial-text blockquote {
    border-left: 0;
    padding: 0;
    margin: 0;
    font-style: normal;
}

.testimonials .testimonial-quote {
    font-size: var(--fs-16);
    line-height: var(--lh-normal);
    color: var(--ink);
    position: relative;
}

.testimonials .testimonial-quote::before {
    content: "";
    display: block;
    line-height: 1;
    margin-bottom: var(--space-8);
    width: 36px;
    height: 36px;
    background-image: url("/wp-content/themes/generatepress/assets/images/student-testimonial.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: rotate(15deg);
}

/* Author bar */
.testimonials .testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    padding: 14px 16px;
    background: var(--background-gray);
    border-top: 1px solid var(--ring);
    margin-top: auto;
}

.testimonials .author-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.testimonials .author-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.testimonials .author-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.testimonials .author-info .author-name {
    font-size: var(--fs-14);
    font-weight: var(--weight-medium);
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.testimonials .author-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.testimonials .level-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: var(--fs-14);
    font-weight: var(--weight-regular);
    white-space: nowrap;
}

.testimonials .level-badge.beginner    { background: #e5f6f1; color: #047857; }
.testimonials .level-badge.intermediate { background: #e0f2fe; color: #0369a1; }
.testimonials .level-badge.advanced    { background: #fee2e2; color: #b91c1c; }

/* Country flags */
.testimonials .author-info span.country-flag {
    display: inline-block;
    width: 25px;
    height: 25px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.testimonials .author-info span.country-flag.australia  { background-image: url("/wp-content/themes/generatepress/assets/images/flags/flag-australia.svg"); }
.testimonials .author-info span.country-flag.france     { background-image: url("/wp-content/themes/generatepress/assets/images/flags/flag-france.svg"); }
.testimonials .author-info span.country-flag.qatar      { background-image: url("/wp-content/themes/generatepress/assets/images/flags/flag-qatar.svg"); }
.testimonials .author-info span.country-flag.usa        { background-image: url("/wp-content/themes/generatepress/assets/images/flags/flag-usa.svg"); }
.testimonials .author-info span.country-flag.uk         { background-image: url("/wp-content/themes/generatepress/assets/images/flags/flag-uk.svg"); }
.testimonials .author-info span.country-flag.germany    { background-image: url("/wp-content/themes/generatepress/assets/images/flags/flag-germany.svg"); }
.testimonials .author-info span.country-flag.netherlands { background-image: url("/wp-content/themes/generatepress/assets/images/flags/flag-netherlands.svg"); }

/* Video card */
.testimonials .testimonial-video {
    position: relative;
    width: 100%;
    padding-bottom: 133%;
    border-radius: var(--radius-12);
    overflow: hidden;
    background: var(--background-gray);
    cursor: pointer;
}

.testimonials .video-content {
    position: absolute;
    inset: 0;
}

.testimonials .video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonials .video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .3);
    transition: background .2s ease;
}

.testimonials .testimonial-card:hover .video-overlay { background: rgba(0, 0, 0, .5); }

.testimonials .play-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}

.testimonials .testimonial-card:hover .play-button { transform: scale(1.06); }

.testimonials .play-button svg {
    width: 20px;
    height: 20px;
    fill: #141414;
    margin-left: 3px;
}

.testimonials .video-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, .7);
    color: white;
    padding: 4px 8px;
    border-radius: 100px;
    font-size: var(--fs-14);
    font-weight: var(--weight-semibold);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
}

.testimonials .video-badge svg {
    width: 12px;
    height: 12px;
    fill: white;
}

/* CTA card */
.testimonials .testimonial-card.cta-card {
    background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 85%, #ffffff 15%) 100%);
    border: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-32);
    gap: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}

.testimonials .testimonial-card.cta-card:hover {
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
    transform: translateY(-3px);
}

.testimonials .cta-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.testimonials .cta-title {
    font-size: var(--fs-18);
    font-weight: var(--weight-bold);
    color: #141414;
    line-height: var(--lh-snug);
}

.testimonials .cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 260px;
}

.testimonials .cta-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: var(--weight-regular);
    text-decoration: none;
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    transition: transform .15s ease, box-shadow .15s ease;
    font-size: var(--fs-14);
    white-space: nowrap;
}

.testimonials .cta-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 23, 42, .18); }
.testimonials .cta-btn.primary   { background: #141414; color: var(--brand); }
.testimonials .cta-btn.secondary { background: #ffffff; color: #141414; border: 1px solid #141414; }

@media (max-width: 600px) {
    .testimonials .testimonial-card.cta-card { display: none; }
}

/* Load more button */
.testimonials .load-more-container {
    display: flex;
    justify-content: center;
    margin-top: var(--space-24);
}

/* Video popup modal */
.video-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, .8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn .3s ease;
}

.video-popup-overlay.active { display: flex; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.video-popup-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-16);
    overflow: hidden;
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.video-popup-close {
    position: absolute;
    top: -40px; right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: transform .2s ease;
}

.video-popup-close:hover { transform: scale(1.1); }

.video-popup-iframe { width: 100%; height: 100%; border: none; }

@media (max-width: 600px) {
    .video-popup-content { width: 95%; }
    .video-popup-close { top: -36px; font-size: 28px; }
}
