/*
 * FP Testimonials Carousel — frontend + editor styles.
 *
 * Ported from the Framer testimonial carousel on the live home page
 * (framer-AeOCf): a rounded dark card (radius 24, bg var(--wp--preset--color--overlay)) split into a
 * left quote panel and a right column of stacked Previous / Next controls.
 * Slides are stacked in the same grid cell and cross-fade via .is-active.
 *
 * Colors flow in via CSS vars set on the wrapper by render.php:
 *   --fpr-tc-bg      card background
 *   --fpr-tc-quote   quote text
 *   --fpr-tc-name    author name
 *   --fpr-tc-role    author role / counter / nav labels
 *   --fpr-tc-accent  nav hover color
 *
 * Mobile-first; the split layout kicks in at lg (≥1024px).
 */

.fpr-testimonials-carousel {
    --fpr-tc-bg: var(--wp--preset--color--overlay);
    --fpr-tc-quote: var(--wp--preset--color--background);
    --fpr-tc-name: var(--wp--preset--color--background);
    --fpr-tc-role: var(--wp--preset--color--muted);
    --fpr-tc-accent: var(--wp--preset--color--background);

    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    background: var(--fpr-tc-bg);
    border-radius: 24px;
    overflow: hidden;
}

.fpr-testimonials-carousel *,
.fpr-testimonials-carousel *::before,
.fpr-testimonials-carousel *::after {
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    .fpr-testimonials-carousel {
        grid-template-columns: 2fr 1fr;
        min-height: 426px;
    }
}

/* ── Left quote panel ───────────────────────────────────────────────────── */
.fpr-tc__panel {
    position: relative;
    overflow: hidden;
    padding: 24px;
}

@media (min-width: 1024px) {
    .fpr-tc__panel {
        padding: 40px;
    }
}

/* Soft radial glow in the top-left corner (Framer: white circle at 8%
   opacity with a heavy blur). */
.fpr-tc__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.1), transparent 55%);
}

/* Slides are stacked in the same grid cell so the panel sizes itself to the
   tallest slide, then cross-faded. */
.fpr-tc__slides {
    position: relative;
    display: grid;
    height: 100%;
}

.fpr-tc__slide {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin: 0;
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}

.fpr-tc__slide.is-active {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.45s ease 0.1s, transform 0.45s ease 0.1s, visibility 0s;
}

.fpr-tc__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.fpr-tc__avatar--placeholder {
    background: rgba(255, 255, 255, 0.12);
}

.fpr-tc__quote {
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--fpr-tc-quote);
    font-size: 20px;
    line-height: 1.55;
    font-weight: 400;
    letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
    .fpr-tc__quote {
        font-size: 26px;
        line-height: 40px;
    }
}

.fpr-tc__meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    margin-top: auto;
}

.fpr-tc__author-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.fpr-tc__name {
    color: var(--fpr-tc-name);
    font-size: 20px;
    line-height: 26px;
    font-weight: 400;
}

.fpr-tc__role {
    color: var(--fpr-tc-role);
    font-size: 16px;
    line-height: 24px;
}

.fpr-tc__counter {
    color: var(--fpr-tc-role);
    font-size: 16px;
    line-height: 24px;
    flex-shrink: 0;
}

/* ── Right controls column ──────────────────────────────────────────────── */
.fpr-tc__controls {
    display: flex;
    flex-direction: row;
}

@media (min-width: 1024px) {
    .fpr-tc__controls {
        flex-direction: column;
        justify-content: flex-end;
        /* Full-height hairline separating the quote panel from the controls
           column (matches the Framer original's soft vertical divider). */
        border-left: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.fpr-tc__nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 0;
    padding: 16px 24px;
    min-height: 68px;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: var(--fpr-tc-role);
    font-size: 18px;
    line-height: 1.3;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.fpr-tc__nav--prev {
    justify-content: flex-start;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.fpr-tc__nav--next {
    justify-content: flex-end;
}

@media (min-width: 1024px) {
    .fpr-tc__nav {
        flex: 0 0 auto;
    }
    .fpr-tc__nav--prev {
        border-right: 0;
    }
}

.fpr-tc__nav:hover,
.fpr-tc__nav:focus-visible {
    color: var(--fpr-tc-accent);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.fpr-tc__nav .fpr-icon {
    flex-shrink: 0;
}

/* ── Reduced motion: no cross-fade movement ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .fpr-tc__slide,
    .fpr-tc__slide.is-active {
        transition: none;
        transform: none;
    }
}

/* ══════════════════════════════════════════════════════════
 * Editor preview (single-slide editing UI)
 * ══════════════════════════════════════════════════════════ */
.fpr-testimonials-carousel-editor .fpr-tc-editor__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.fpr-tc-editor__tab {
    padding: 4px 12px;
    border: 1px solid rgba(95, 95, 113, 0.22);
    border-radius: 999px;
    background: var(--wp--preset--color--background);
    color: var(--wp--preset--color--secondary);
    font-size: 0.8rem;
    cursor: pointer;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fpr-tc-editor__tab.is-active {
    background: var(--wp--preset--color--overlay);
    border-color: var(--wp--preset--color--overlay);
    color: var(--wp--preset--color--background);
}

/* Dark card preview mirroring the frontend panel. */
.fpr-tc-editor__card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: var(--fpr-tc-bg, var(--wp--preset--color--overlay));
}

.fpr-tc-editor__card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.1), transparent 55%);
}

.fpr-tc-editor__quote {
    margin: 0;
    font-size: 22px;
    line-height: 1.55;
    letter-spacing: -0.02em;
    border: 0;
    padding: 0;
}

.fpr-tc-editor__author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.fpr-tc-editor__author-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fpr-tc-editor__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.fpr-tc-editor__avatar--placeholder {
    background: rgba(255, 255, 255, 0.12);
}

.fpr-tc-editor__author-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fpr-tc-editor__name {
    font-size: 20px;
    font-weight: 400;
}

.fpr-tc-editor__role {
    font-size: 16px;
}

.fpr-tc-editor__counter {
    font-size: 16px;
    flex-shrink: 0;
}

.fpr-tc-editor__remove {
    align-self: flex-start;
}
