/* ===============================================
    Home page: Testimonials
    A text panel on the left (heading, controls, page dots) and a row of quote cards that
    slides out to the right edge of the screen. The sliding, dots, autoplay and pause rules are
    the shared slider in public/js/home-sliders.js; this file is only the look.
    Markup: views/index.hbs (#review)
------------------------*/

.mp-quotes {
    position: relative;
    padding: var(--sec-y) 0;
    overflow: hidden;
    background: var(--brand-peach);
}

/* two warm glows, so the flat peach has some depth */
.mp-quotes:before,
.mp-quotes:after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.mp-quotes:before {
    top: -200px;
    left: -160px;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(var(--brand-yellow-rgb), .42), transparent 68%);
}

.mp-quotes:after {
    right: -180px;
    bottom: -220px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(var(--brand-orange-rgb), .22), transparent 66%);
}

.mp-quotes .container {
    position: relative;
    z-index: 1;
}

.mp-tq {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 48px;
    align-items: center;
}


/* Left panel
------------------------*/

.mp-tq__side {
    position: relative;
}

.mp-quotes .mp-title {
    margin-bottom: 16px;
}

.mp-tq__lead {
    margin: 0 0 28px;
    color: var(--mp-muted);
    font-size: 17px;
    line-height: 1.7;
}

.mp-tq__side > .mp-arrows {
    margin-bottom: 16px;
}

/* dots under the buttons, lined up with their left edge */
.mp-tq .mp-slider__dots {
    justify-content: flex-start;
    margin: 0 0 0 -5px;
}


/* Cards
------------------------*/

/* the track scrolls, so it clips whatever sticks out of it: extra padding (cancelled by an equal
   negative margin, so the layout does not move) leaves room for the card shadows */
.mp-tq__track {
    min-width: 0;
    margin-top: -8px;
    margin-bottom: -24px;
    margin-left: calc(-1 * var(--bleed-l) - 24px);
    padding-top: 16px;
    padding-bottom: 48px;
    padding-left: calc(var(--bleed-l) + 24px);
    scroll-padding-left: calc(var(--bleed-l) + 24px);
}

.mp-tcard {
    display: flex;
    flex: 0 0 clamp(300px, 28vw, 400px);
    min-width: 0;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
}

.mp-tcard__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 28px;
    border: 1px solid var(--mp-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 50px -36px rgba(var(--brand-navy-rgb), .5);
}

.mp-tcard__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.mp-tcard__mark {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-orange), var(--brand-yellow));
    box-shadow: 0 12px 20px -12px rgba(var(--brand-orange-rgb), .9);
    color: var(--brand-navy);
}

.mp-tcard__mark svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.mp-tcard__stars {
    display: flex;
    gap: 3px;
}

.mp-tcard__stars svg {
    width: 18px;
    height: 18px;
    fill: var(--brand-orange);
}

/* the quote is centred in the spare height: every card ends with its author on the same line,
   and a short quote sits in the middle of its card, not stranded at the top */
.mp-tcard__text {
    flex: 0 1 auto;
    margin: auto 0;
    padding: 2px 0 24px;
    border: 0;
    color: var(--mp-ink);
    font-size: 16.5px;
    line-height: 1.75;
    quotes: none;
}

.mp-tcard__text p {
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre-line;
}

.mp-tcard__who {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--mp-line);
}

.mp-tcard__avatar {
    position: relative;
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mp-green), var(--mp-navy));
    color: #fff;
}

/* no photo, or a photo that fails to load: the first letter of the name */
.mp-tcard__initial {
    font-size: 0;
    font-weight: 600;
}

.mp-tcard__initial::first-letter {
    font-size: 22px;
    text-transform: uppercase;
}

.mp-tcard__avatar img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

.mp-tcard__avatar.is-broken img {
    display: none;
}

.mp-tcard__id {
    display: block;
    min-width: 0;
}

.mp-tcard__name {
    display: block;
    color: var(--mp-ink);
    font-family: Poppins, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.mp-tcard__role {
    display: block;
    margin-top: 2px;
    color: var(--mp-muted);
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}


/* One or two testimonials: they fill the space, nothing slides (the slider hides its own controls)
------------------------*/

.mp-tq__track[data-count="1"],
.mp-tq__track[data-count="2"] {
    margin-right: 0;
    padding-right: 0;
}

.mp-tq__track[data-count="1"] {
    justify-content: center;
}

.mp-tq__track[data-count="1"] .mp-tcard {
    flex-basis: min(100%, 560px);
}

.mp-tq__track[data-count="2"] .mp-tcard {
    flex-basis: calc((100% - 24px) / 2);
}


/* Responsive
------------------------*/

@media (max-width: 991.98px) {

    /* the panel moves above the cards, which then slide out past both screen edges */
    .mp-tq {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .mp-tq__lead {
        margin-bottom: 20px;
    }

    .mp-tcard {
        flex-basis: calc((100% - 24px) / 2);
    }
}

@media (max-width: 575.98px) {

    .mp-tcard {
        flex-basis: 84%;
    }

    .mp-tcard__card {
        padding: 22px;
        border-radius: 20px;
    }

    .mp-tcard__text {
        padding-bottom: 20px;
        font-size: 16px;
    }

    .mp-tcard__who {
        padding-top: 16px;
    }
}
