/* =========================================================
   AAPICOS TESTIMONIALS
   ========================================================= */

.testimonialsPage {
    --testimonialOrange: var(--sxOrange, #f15b26);
    --testimonialOrangeDark: var(--sxOrangeDark, #dc4816);

    --testimonialCyan: var(--sxCyan, #4cc2c0);
    --testimonialCyanDark: var(--sxCyanDark, #2aa7a5);

    --testimonialGreen: var(--sxGreen, #3cb878);
    --testimonialGreenDark: var(--sxGreenDark, #24965d);

    --testimonialAmber: var(--sxAmber, #fcb03b);
    --testimonialAmberDark: var(--sxAmberDark, #e29a1d);

    --testimonialInk: var(--sxInk, #302c2a);
    --testimonialInkSoft: var(--sxInkSoft, #5e5a58);
    --testimonialMuted: var(--sxMuted, #77716e);

    --testimonialWhite: var(--sxWhite, #ffffff);
    --testimonialPaper: var(--sxPaper, #f7f9f9);

    --testimonialSoftOrange: var(--sxSoftOrange, #fff0e9);
    --testimonialSoftCyan: var(--sxSoftCyan, #e8f8f7);
    --testimonialSoftGreen: var(--sxSoftGreen, #e9f7ef);
    --testimonialSoftAmber: var(--sxSoftAmber, #fff5df);

    --testimonialLine: var(
        --sxLine,
        rgba(47, 44, 43, 0.14)
    );

    --testimonialTransition: var(
        --sxTransition,
        260ms cubic-bezier(.2, .75, .25, 1)
    );

    --testimonialTransitionSlow: var(
        --sxTransitionSlow,
        700ms cubic-bezier(.2, .75, .25, 1)
    );

    width: 100%;
    overflow: hidden;
    color: var(--testimonialInk);
    background: var(--testimonialWhite);
}


/* =========================================================
   BASE
   ========================================================= */

.testimonialsPage,
.testimonialsPage * {
    box-sizing: border-box;
}

.testimonialsContainer,
.testimonialCtaContainer {
    width: min(
        calc(100% - 64px),
        1700px
    );

    margin: 0 auto;
}


/* =========================================================
   SECTION 01
   ========================================================= */

.testimonialsSection {
    padding: 110px 0 100px;
    background: var(--testimonialWhite);
}


/* =========================================================
   HEADER
   ========================================================= */

.testimonialsHeader {
    margin-bottom: 58px;
}

.testimonialsHeaderMeta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 34px;
}

.testimonialsEyebrow,
.testimonialsHeaderMetaText {
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.testimonialsEyebrow {
    color: var(--testimonialOrange);
}

.testimonialsHeaderMetaText {
    color: var(--testimonialMuted);
}

.testimonialsHeaderRule {
    width: 70px;
    height: 1px;
    background: var(--testimonialLine);
}

.testimonialsHeaderContent {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(300px, .8fr);

    gap: 80px;
    align-items: end;
}

.testimonialsHeaderContent h1 {
    max-width: 900px;
    margin: 0;

    font-size: clamp(60px, 7vw, 112px);
    line-height: .88;
    letter-spacing: -.065em;
    font-weight: 900;
}

.testimonialsHeaderContent h1 span {
    display: block;
    color: var(--testimonialOrange);
}

.testimonialsHeaderContent p {
    max-width: 540px;
    margin: 0 0 5px;

    color: var(--testimonialInkSoft);
    font-size: 17px;
    line-height: 1.65;
}


/* =========================================================
   FILTERS
   ========================================================= */

.testimonialFilters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    padding: 16px 0;
    margin-bottom: 28px;

    border-top: 1px solid var(--testimonialLine);
    border-bottom: 1px solid var(--testimonialLine);
}

.testimonialFilter {
    appearance: none;

    padding: 11px 18px;

    border: 1px solid transparent;

    background: transparent;

    color: var(--testimonialMuted);

    font: inherit;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 900;

    letter-spacing: .1em;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        color var(--testimonialTransition),
        background var(--testimonialTransition),
        border-color var(--testimonialTransition),
        transform var(--testimonialTransition);
}

.testimonialFilter:hover {
    color: var(--testimonialInk);
    transform: translateY(-1px);
}

.testimonialFilter.isActive {
    color: var(--testimonialWhite);
    background: var(--testimonialInk);
}


/* =========================================================
   TESTIMONIAL GRID
   ========================================================= */

.testimonialsGrid {
    --testimonialGap: 18px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    grid-auto-rows: 1px;
    grid-auto-flow: dense;

    column-gap: var(--testimonialGap);
    row-gap: 0;

    align-items: start;
}


/* =========================================================
   MASONRY CARD POSITIONING
   ========================================================= */

.testimonialCard {
    position: relative;

    min-width: 0;

    /*
     * Height is controlled by the actual content.
     * JS converts that height into grid-row span.
     */
    grid-row-end: span 1;
}


/*
 * IMPORTANT:
 * Hidden testimonial cards must completely leave
 * the grid. This fixes the filter spacing issue.
 */
.testimonialCard[hidden] {
    display: none !important;
}


/* =========================================================
   TESTIMONIAL CARD
   ========================================================= */

.testimonialCard {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;

    padding: 15px;

    border: 1px solid var(--testimonialLine);

    background: var(--testimonialWhite);

    opacity: 0;
    transform: translateY(34px);

    transition:
        opacity var(--testimonialTransitionSlow),
        transform var(--testimonialTransitionSlow),
        box-shadow var(--testimonialTransition),
        border-color var(--testimonialTransition);
}

.testimonialCard.isVisible {
    opacity: 1;
    transform: translateY(0);
}

.testimonialCard:hover {
    border-color: rgba(47, 44, 43, .28);

    box-shadow:
        12px 14px 0 rgba(47, 44, 43, .045);
}


/* =========================================================
   VARIABLE CARD SIZES
   ========================================================= */

.testimonialCard--small {
    min-height: 320px;
    grid-column: span 1;
}

.testimonialCard--medium {
    min-height: 420px;
    grid-column: span 1;
}

.testimonialCard--large {
    min-height: 540px;
    grid-column: span 2;
}


/* =========================================================
   CARD TOP
   ========================================================= */

.testimonialCardTop {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding-bottom: 22px;

    border-bottom: 1px solid var(--testimonialLine);
}

.testimonialCardNumber {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 48px;
    height: 48px;

    border: 1px solid var(--testimonialLine);

    background: var(--testimonialPaper);

    font-size: 11px;
    font-weight: 900;
}

.testimonialCardCategory {
    text-align: right;

    font-size: 9px;
    line-height: 1.4;
    font-weight: 900;

    letter-spacing: .1em;
    text-transform: uppercase;
}


/* =========================================================
   COLOR TREATMENTS
   ========================================================= */

.testimonialCard--orange .testimonialCardNumber {
    color: var(--testimonialOrangeDark);
    background: var(--testimonialSoftOrange);
}

.testimonialCard--orange .testimonialCardCategory {
    color: var(--testimonialOrangeDark);
}


.testimonialCard--cyan .testimonialCardNumber {
    color: var(--testimonialCyanDark);
    background: var(--testimonialSoftCyan);
}

.testimonialCard--cyan .testimonialCardCategory {
    color: var(--testimonialCyanDark);
}


.testimonialCard--green .testimonialCardNumber {
    color: var(--testimonialGreenDark);
    background: var(--testimonialSoftGreen);
}

.testimonialCard--green .testimonialCardCategory {
    color: var(--testimonialGreenDark);
}


.testimonialCard--amber .testimonialCardNumber {
    color: var(--testimonialAmberDark);
    background: var(--testimonialSoftAmber);
}

.testimonialCard--amber .testimonialCardCategory {
    color: var(--testimonialAmberDark);
}


/* =========================================================
   QUOTE
   ========================================================= */

.testimonialQuoteMark {
    margin-top: 27px;

    color: var(--testimonialInk);

    font-size: 56px;
    line-height: .55;
    font-weight: 900;
}

.testimonialQuote {
    margin: 28px 0 42px;

    font-size: clamp(21px, 1.75vw, 29px);
    line-height: 1.3;
    color: var(--aap-ink);

    letter-spacing: -.025em;

    font-weight: 700;
}

.testimonialCard--large .testimonialQuote {
    max-width: 800px;

    font-size: clamp(25px, 2.35vw, 38px);
    line-height: 1.24;
}


/* =========================================================
   CARD FOOTER
   ========================================================= */

.testimonialCardFooter {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-top: auto;
    padding-top: 22px;

    border-top: 1px solid var(--testimonialLine);
}

.testimonialCardFooter div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.testimonialCardFooter strong {
    font-size: 13px;
    line-height: 1.3;
    font-weight: 900;
}

.testimonialCardFooter div span {
    color: var(--testimonialMuted);

    font-size: 10px;
    line-height: 1.5;
}

.testimonialCardArrow {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    border: 1px solid var(--testimonialLine);

    color: var(--testimonialInk);

    font-size: 15px !important;

    transition:
        transform var(--testimonialTransition),
        background var(--testimonialTransition),
        color var(--testimonialTransition);
}

.testimonialCard:hover .testimonialCardArrow {
    color: var(--testimonialWhite);
    background: var(--testimonialInk);

    transform: translate(
        2px,
        -2px
    );
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.testimonialsEmpty {
    grid-column: 1 / -1;

    min-height: 240px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 1px dashed var(--testimonialLine);

    color: var(--testimonialMuted);

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   GRID FOOTER
   ========================================================= */

.testimonialsGridFooter {
    display: flex;

    align-items: center;

    gap: 18px;

    margin-top: 28px;

    color: var(--testimonialMuted);

    font-size: 10px;
    line-height: 1;
    font-weight: 900;

    letter-spacing: .14em;
    text-transform: uppercase;
}

.testimonialsGridFooterLine {
    flex: 1;

    height: 1px;

    background: var(--testimonialLine);
}


/* =========================================================
   CTA
   ========================================================= */

.testimonialCtaSection {
    padding: 100px 0 110px;

    background: var(--testimonialPaper);

    border-top: 1px solid var(--testimonialLine);
}

.testimonialCtaMeta {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 42px;

    color: var(--testimonialMuted);

    font-size: 11px;
    font-weight: 900;

    letter-spacing: .15em;
    text-transform: uppercase;
}

.testimonialCtaMeta span:first-child {
    color: var(--testimonialOrange);
}

.testimonialCtaContent {
    max-width: 1080px;
}

.testimonialCtaContent h2 {
    margin: 0;

    font-size: clamp(
        2.6rem,
        5vw,
        5.3rem
    );
    line-height: .9;

    letter-spacing: -.065em;

    font-weight: 900;
}

.testimonialCtaContent h2 span {
    display: block;

    color: var(--testimonialOrange);
}

.testimonialCtaContent p {
    max-width: 580px;

    margin: 32px 0 30px;

    color: var(--testimonialInkSoft);

    font-size: 17px;
    line-height: 1.65;
}

.testimonialCtaButton {
    display: inline-flex;

    align-items: center;
    justify-content: space-between;

    gap: 38px;

    min-width: 220px;

    padding: 16px 18px 16px 21px;

    color: var(--testimonialWhite);

    background: var(--testimonialOrange);

    border: 1px solid var(--testimonialOrange);

    text-decoration: none;

    font-size: 11px;
    line-height: 1;
    font-weight: 900;

    letter-spacing: .08em;
    text-transform: uppercase;

    transition:
        background var(--testimonialTransition),
        border-color var(--testimonialTransition),
        transform var(--testimonialTransition);
}

.testimonialCtaButton:hover {
    background: var(--testimonialOrangeDark);
    border-color: var(--testimonialOrangeDark);

    transform: translateY(-2px);
}


/* =========================================================
   CTA JOURNEY
   ========================================================= */

.testimonialCtaJourney {
    display: flex;

    align-items: center;

    margin-top: 85px;
}

.testimonialCtaNode {
    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 160px;
}

.testimonialCtaNode span {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    background: var(--testimonialWhite);

    border: 1px solid var(--testimonialLine);

    font-size: 10px;
    font-weight: 900;
}

.testimonialCtaNode strong {
    font-size: 11px;
    line-height: 1;

    font-weight: 900;

    letter-spacing: .08em;
    text-transform: uppercase;
}

.testimonialCtaNode--orange {
    color: var(--testimonialOrangeDark);
}

.testimonialCtaNode--cyan {
    color: var(--testimonialCyanDark);
}

.testimonialCtaNode--green {
    color: var(--testimonialGreenDark);
}

.testimonialCtaConnector {
    flex: 1;

    width: 100%;
    max-width: 180px;

    height: 1px;

    margin: 0 15px;

    background: var(--testimonialLine);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1200px) {

    .testimonialsHeaderContent {
        gap: 50px;
    }

    .testimonialsGrid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .testimonialCard--large {
        grid-column: span 2;
    }

    .testimonialCard--medium,
    .testimonialCard--small {
        grid-column: span 1;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 720px) {

    .testimonialsContainer,
    .testimonialCtaContainer {
        width: min(
            calc(100% - 36px),
            1700px
        );
    }

    .testimonialsSection {
        padding: 72px 0 70px;
    }

    .testimonialsHeader {
        margin-bottom: 42px;
    }

    .testimonialsHeaderMeta {
        gap: 12px;
    }

    .testimonialsHeaderRule {
        width: 35px;
    }

    .testimonialsHeaderContent {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .testimonialsHeaderContent h1 {
        font-size: clamp(
            52px,
            15vw,
            78px
        );
    }

    .testimonialsHeaderContent p {
        font-size: 15px;
    }

    .testimonialFilters {
        gap: 4px;
    }

    .testimonialFilter {
        padding: 9px 12px;

        font-size: 8px;
        letter-spacing: .08em;
    }

    .testimonialsGrid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .testimonialCard--small,
    .testimonialCard--medium,
    .testimonialCard--large {
        grid-column: span 1;

        min-height: 360px;
    }

    .testimonialCard--large {
        min-height: 460px;
    }

    .testimonialCard {
        padding: 24px;
    }

    .testimonialCardCategory {
        max-width: 55%;

        font-size: 8px;
    }

    .testimonialQuote {
        font-size: 22px;
    }

    .testimonialCard--large .testimonialQuote {
        font-size: 27px;
    }

    .testimonialCardFooter strong {
        font-size: 12px;
    }

    .testimonialCardFooter div span {
        font-size: 9px;
    }

    .testimonialCtaSection {
        padding: 72px 0 78px;
    }

    .testimonialCtaContent h2 {
        font-size: clamp(
            50px,
            14vw,
            76px
        );
    }

    .testimonialCtaContent p {
        font-size: 15px;
    }

    .testimonialCtaJourney {
        align-items: flex-start;

        flex-direction: column;

        gap: 15px;

        margin-top: 60px;
    }

    .testimonialCtaConnector {
        flex: 0 0 auto;

        width: 1px;
        height: 32px;

        min-height: 32px;

        margin: 0 0 0 20px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .testimonialCard,
    .testimonialFilter,
    .testimonialCardArrow,
    .testimonialCtaButton {
        transition: none;
    }

    .testimonialCard {
        opacity: 1;
        transform: none;
    }

}