/*---*\
Testimonials Slider
Quote cards from the testimonial post type, with a rating summary and collage.

KEY FEATURES:
- Charcoal background (bg-charcoal). Card fill is the red gradient
- Collage is hidden below 1200px. At 1200px it fills the 360x456 portrait box and stays in the DOM
- Below 1200px one card is centered and neighbors peek. At 1200px two cards show and a third peeks
- View All sits under the cards below 1200px and beside the heading from 1200px
- Slanted bottom uses .section-slanted in global.css. Horizontal overflow is clipped so the slider does not widen the page, and vertical overflow stays visible so the wedge can hang below

IMPLEMENTATION NOTES:
- Quote scrolls inside the card when it is taller than 6 rows on mobile and desktop, or 5 rows from 768px until 1200px. The bar sits in the card padding, 8px from the text, matching Figma 23167:5734
- Depends on fx_slick. Arrow and quote focus outlines use !important because plugins/slick.css sets outline:none !important on .slick-arrow and focused slides
- Grid at 1200px places the button on the heading row while it stays under the cards below that
\*---*/

.testimonials {
    --testimonials-gutter: 21px;
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
}

.testimonials__layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.testimonials__intro,
.testimonials__stage {
    align-self: stretch;
    width: 100%;
    min-width: 0;
}

.testimonials__intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding-left: var(--testimonials-gutter);
    padding-right: var(--testimonials-gutter);
}

.testimonials__intro > * {
    margin-top: 0;
    margin-bottom: 0;
}

.testimonials__summary,
.testimonials__card-rating {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.testimonials__summary {
    color: var(--color-primary-contrast);
    font-size: 16px;
    font-weight: var(--font-weight-subheading);
    line-height: 20px;
}

.testimonials__stars {
    display: inline-flex;
    gap: 4px;
}

.testimonials__star {
    display: block;
    width: 24px;
    height: 24px;
    fill: var(--color-secondary);
    opacity: 0.35;
}

.testimonials__star--on {
    opacity: 1;
}

.testimonials__stage {
    min-width: 0;
}

.testimonials__portrait {
    display: none;
}

.testimonials__collage-back,
.testimonials__collage-front {
    position: absolute;
}

.testimonials__collage-back {
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.testimonials__collage-front {
    bottom: 0;
    left: 19.18%;
    z-index: 1;
    width: 291px;
    height: 442px;
}

.testimonials__collage-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonials__track {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.testimonials .slick-track {
    display: flex;
    align-items: stretch;
}

.testimonials .slick-slide {
    display: flex;
    height: auto;
}

.testimonials__slide {
    width: 332px;
    height: auto;
    margin-right: 15px;
}

.testimonials__card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    height: 100%;
    padding: 32px;
    border-radius: var(--radius-card);
    background-image: var(--gradient-red);
    color: var(--color-primary-contrast);
}

.testimonials__mark {
    display: block;
    width: 70px;
    height: 54px;
    fill: currentColor;
}

.testimonials__card .testimonials__star {
    width: 32px;
    height: 32px;
}

.testimonials__quote-wrap {
    position: relative;
    width: 100%;
}

.testimonials__quote {
    box-sizing: border-box;
    width: 100%;
    max-height: 163px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--color-primary-contrast);
    font-size: 18px;
    line-height: 1.5;
    overflow-wrap: break-word;
    quotes: none;
    border: none;
    background: transparent;
    scrollbar-width: none;
}

.testimonials__quote p {
    margin: 0;
}

.testimonials__quote::before {
    display: none;
}

.testimonials__quote:focus-visible {
    outline: 2px solid var(--color-secondary) !important;
    outline-offset: 2px;
}

.testimonials__quote::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.testimonials__scroll {
    position: absolute;
    top: 0;
    right: -12px;
    width: 4px;
    height: 100%;
    border-radius: 20px;
    background-color: var(--color-white);
    cursor: pointer;
    touch-action: none;
}

.testimonials__scroll[hidden] {
    display: none;
}

.testimonials__scroll-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    border-radius: 20px;
    background-color: var(--color-tertiary-dark);
}

.testimonials__name {
    margin: 0;
    margin-top: auto;
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--font-size-h5);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-heading);
}

.testimonials__nav {
    display: flex;
    order: 3;
    gap: 32px;
}

.testimonials__cta {
    order: 4;
}

.testimonials__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border: 0;
    border-radius: var(--radius-small);
    background-color: var(--color-surface-off-white);
    color: var(--color-tertiary-dark);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.testimonials__arrow i {
    font-size: 34px;
}

.testimonials__arrow:hover,
.testimonials__arrow:focus-visible {
    background-color: var(--color-primary);
    color: var(--color-primary-contrast);
}

.testimonials__arrow:focus-visible {
    outline: 2px solid var(--color-secondary) !important;
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .testimonials {
        --testimonials-gutter: 52px;
    }

    .testimonials__layout {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 52px;
        column-gap: 52px;
        padding-left: 0;
        padding-right: 0;        
    }

    .testimonials__stage {
        flex: 1 1 100%;
        order: 0;
    }

    .testimonials__intro {
        flex: 1 1 100%;
        order: 0;        
    }

    .testimonials__cta,
    .testimonials__nav {
        order: 0;
    }

    .testimonials__slide {
        width: 432px;
        margin-right: 35px;
    }

    .testimonials__quote {
        max-height: 136px;
    }
}

@media (min-width: 1025px) {
    .testimonials {
        --testimonials-gutter: 63px;
    }
}

@media (min-width: 1200px) {
    .testimonials__layout {
        display: grid;
        grid-template-columns: minmax(var(--testimonials-gutter), 1fr) minmax(0, 832px) 32px minmax(0, 400px) minmax(var(--testimonials-gutter), 1fr);
        grid-template-areas:
            ". intro . cta ."
            ". stage stage stage stage"
            ". nav nav nav .";
        align-items: end;
        justify-items: stretch;
        column-gap: 0;
        row-gap: 52px;
        padding-right: 0;
        padding-left: 0;
    }

    .testimonials--no-cta .testimonials__layout {
        grid-template-areas:
            ". intro intro intro ."
            ". stage stage stage stage"
            ". nav nav nav .";
    }

    .testimonials:not(.testimonials--has-intro) .testimonials__layout {
        grid-template-areas:
            ". cta cta cta ."
            ". stage stage stage stage"
            ". nav nav nav .";
    }

    .testimonials:not(.testimonials--has-intro).testimonials--no-cta .testimonials__layout {
        grid-template-areas:
            ". stage stage stage stage"
            ". nav nav nav .";
    }

    .testimonials__intro {
        grid-area: intro;
        align-self: start;
        max-width: 832px;
        order: 0;
    }

    .testimonials__stage {
        display: flex;
        align-items: center;
        grid-area: stage;
        gap: 35px;
        order: 0;
        width: auto;
        margin-right: 0;
    }

    .testimonials__cta {
        grid-area: cta;
        justify-self: end;
        align-self: end;
        order: 0;
    }

    .testimonials:not(.testimonials--has-intro) .testimonials__cta {
        justify-self: end;
    }

    .testimonials__nav {
        grid-area: nav;
        justify-self: end;
        order: 0;
    }

    .testimonials__portrait {
        display: block;
        position: relative;
        flex: 0 0 608px;
        width: 608px;
        height: 457px;
        margin-left: -162px;
        overflow: hidden;
    }

    .testimonials__portrait .accent-logo {
        width: 262px;
        height: 197px;        
        position: absolute;
        top: 0;
        left: 174px;
    }

    .testimonials__track {
        flex: 1 1 auto;
    }

    .testimonials__slide {
        width: 398px;
        margin-right: 35px;
    }

    .testimonials__quote {
        max-height: 163px;
    }
}

@media (min-width: 1367px) {
    .testimonials {
        --testimonials-gutter: 0px;
    }
}
