/*
 * Testimonial Slider Block — view.css  v1.2
 * Montserrat assumed loaded by theme.
 * Tweak --ts-accent to match your brand colour.
 */

/* ── Design tokens ──────────────────────────────────────────────────── */
.testimonial-block {
    --ts-accent:        #5a8a6a;
    --ts-text:          #2c2c2c;
    --ts-card-bg:       rgba(255, 255, 255, 0.96);
    --ts-nav-bg:        rgba(255, 255, 255, 0.72);
    --ts-nav-hover-bg:  rgba(255, 255, 255, 0.96);
    --ts-dot-inactive:  rgba(255, 255, 255, 0.50);
    --ts-dot-active:    #ffffff;
    --ts-font-serif:    'Bodoni Moda', serif;
    --ts-font-sans:     'Montserrat', Arial, Helvetica, sans-serif;
    --ts-min-height:    520px;
    --ts-card-maxw:     580px;
    --ts-overlay:       rgba(255, 255, 255, 0);
}

/* ── Outer wrapper ──────────────────────────────────────────────────── */
.testimonial-block {
    position: relative;
    min-height: var(--ts-min-height);
    background-color: #444;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 48px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Dark scrim over background image */
.testimonial-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ts-overlay);
    pointer-events: none;
}

/* ── Inner row: [prev] [slides] [next] ──────────────────────────────── */
.testimonial-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 940px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* ── Slides wrapper ─────────────────────────────────────────────────── */
.testimonial-slides-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
 * Grid overlap: every slide sits in the same grid cell.
 * The wrapper stays as tall as the tallest card — no layout jump.
 * Opacity + visibility crossfade completely eliminates flicker;
 * there is no display:none anywhere in the transition path.
 */
.testimonial-slides-grid {
    display: grid;
    width: 100%;
    max-width: var(--ts-card-maxw);
    align-items: center;  /* vertically centres shorter cards within the tallest card's height */
}

/* ── Individual slide ───────────────────────────────────────────────── */
.testimonial-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    /* delay visibility change until after opacity fades out */
    transition: opacity 0.45s ease,
                visibility 0s linear 0.45s;
    pointer-events: none;
    width: 100%;
}

.testimonial-slide.active {
    opacity: 1;
    visibility: visible;
    /* make visible immediately when fading in */
    transition: opacity 0.45s ease,
                visibility 0s linear 0s;
    pointer-events: auto;
}

/* ── White card ─────────────────────────────────────────────────────── */
.testimonial-card {
    background: var(--ts-card-bg);
    padding: 40px 52px 36px;
    text-align: center;
    box-shadow: 0 10px 48px rgba(0, 0, 0, 0.20);
}

/* ── Decorative opening quote mark ─────────────────────────────────── */
.testimonial-quote-mark {
    display: block;
    font-family: 'Times New Roman', serif;
    font-size: 100px;
    line-height: 0.55;
    color: var(--ts-accent);
    user-select: none;
    pointer-events: none;
}

/* ── Quote body (serif italic) ──────────────────────────────────────── */
.testimonial-quote-text {
    font-family: var(--ts-font-serif);
    font-style: italic;
    font-size: 1.3rem;
    letter-spacing: 0.3px;
    line-height: 1.4;
    color: var(--ts-text);
    margin: 0 0 22px;
}

/* ── Source / attribution (sans) ────────────────────────────────────── */
.testimonial-quote-source {
    font-family: var(--ts-font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    color: var(--ts-accent);
    margin: 0;
}

/* ── Navigation buttons ─────────────────────────────────────────────── */
.testimonial-nav {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ts-nav-bg);
    border: none;
    cursor: pointer;
    color: var(--ts-accent);
    /*
     * Flexbox centres the FA icon on both axes perfectly.
     * Do NOT use line-height or font-size on the button itself —
     * size the icon via the <i> element below.
     */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, transform 0.15s ease;
}

.testimonial-nav i.fas {
    font-size: 1.8rem;
    /*
     * FA5 chevrons have a very slight optical high bias in their em-box.
     * A 1px downward nudge brings the visual centre to the geometric centre.
     */
    position: relative;
    top: 1px;
    display: block;        /* removes inline baseline gap */
    line-height: 1;
    pointer-events: none;
}

i.fas.fa-chevron-right {
    padding-left: 4px;
}

i.fas.fa-chevron-left {
    padding-right: 4px;
}


.testimonial-nav:hover,
.testimonial-nav:focus {
    background: var(--ts-nav-hover-bg);
    transform: scale(1.08);
    outline: none;
}

.testimonial-nav:focus-visible {
    outline: 2px solid var(--ts-accent);
    outline-offset: 2px;
}

/* ── Dot indicators ─────────────────────────────────────────────────── */
.testimonial-dots {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}

.testimonial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ts-dot-inactive);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.testimonial-dot.active,
.testimonial-dot:hover {
    background: var(--ts-dot-active);
    transform: scale(1.25);
}

/* ── Edit-mode placeholder ──────────────────────────────────────────── */
.testimonial-block .ccm-edit-mode-block-message {
    position: relative;
    z-index: 1;
    color: #fff;
    font-family: var(--ts-font-sans);
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ── Tablet ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .testimonial-block {
        padding: 40px 12px 36px;
        min-height: 420px;
    }

    .testimonial-inner {
        gap: 10px;
    }

    .testimonial-nav {
        width: 44px;
        height: 44px;
    }

    .testimonial-nav i.fas {
        font-size: 1.05rem;
    }

    .testimonial-card {
        padding: 30px 26px 26px;
    }

    .testimonial-quote-mark {
        font-size: 64px;
    }

    .testimonial-quote-text {
        font-size: 1rem;
    }
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .testimonial-inner {
        gap: 6px;
    }

    .testimonial-nav {
        width: 38px;
        height: 38px;
    }

    .testimonial-nav i.fas {
        font-size: 0.9rem;
    }

    .testimonial-card {
        padding: 22px 16px 20px;
    }

    .testimonial-quote-mark {
        font-size: 52px;
    }

    .testimonial-quote-text {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .testimonial-quote-source {
        font-size: 0.8rem;
    }
}
