/* ==========================================================================
   Edy London: Testimonials slider (template-parts/home/testimonials.php)
   Base look (fonts, spacing, colours) stays in edy.css (.el-quote*).
   This file adds the rotating featured quote, the list selection and the
   equal column heights.
   Script: assets/js/testimonials.js
   ========================================================================== */

/* ---------- Featured quote: all slides share one grid cell, so the height
   is set by the longest quote and the page does not jump on each change. */
.el-quote-stage {
    display: grid;
}

.el-quote-stage > .el-quote-main {
    grid-area: 1 / 1;
}

.el-quotes.is-ready .el-quote-stage > .el-quote-main {
    opacity: 0;
    visibility: hidden;
    transition: opacity .7s ease, visibility .7s ease;
}

.el-quotes.is-ready .el-quote-stage > .el-quote-main.is-active {
    opacity: 1;
    visibility: visible;
}

/* ---------- List: whole quote is clickable, featured one gets a thin
   sage marker on the left (outside the text, so nothing shifts). */
.el-quote-list .el-quote {
    position: relative;
}

.el-quote-list .el-quote::before {
    content: "";
    position: absolute;
    top: 26px;
    bottom: 26px;
    left: -18px;
    width: 2px;
    background: var(--el-sage);
    opacity: 0;
    transition: opacity .3s ease;
}

.el-quote-list .el-quote.is-active::before {
    opacity: 1;
}

.el-quote-list .el-quote blockquote {
    transition: color .2s ease;
}

.el-quote-list .el-quote:hover blockquote {
    color: var(--el-sage);
}

.el-quote__select {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.el-quote__select:focus-visible {
    outline: 2px solid var(--el-sage);
    outline-offset: 2px;
}

/* ---------- Desktop: the list of four is exactly as tall as the featured
   quote. Both columns stretch to the same height; the four quotes spread
   evenly over it and the featured quote sits in the vertical middle. */
@media (min-width: 901px) {
    .el-quotes {
        align-items: stretch;
    }

    .el-quote-stage {
        align-items: center;
    }

    .el-quote-list {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* ---------- Mobile: marker closer to the text */
@media (max-width: 767px) {
    .el-quote-list .el-quote::before {
        left: -12px;
    }
}

/* ---------- Reduced motion: instant change, no fade */
@media (prefers-reduced-motion: reduce) {
    .el-quotes.is-ready .el-quote-stage > .el-quote-main,
    .el-quote-list .el-quote::before {
        transition: none;
    }
}
