/* ==========================================================
   Reviews: "pick a card". Each endorser is a card in a fanned
   hand (a royal flush of hearts); drawing one reveals their
   quote on the stage. Behaviour lives in assets/js/reviews.js.
   ========================================================== */

.voila-reviews-section {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Soft Voila-coloured glows behind the hand and the stage */
.voila-reviews-section::before,
.voila-reviews-section::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.voila-reviews-section::before {
    top: 32%;
    left: -120px;
    width: 560px;
    height: 460px;
    background: radial-gradient(closest-side, rgba(137, 240, 245, 0.38), transparent);
}

.voila-reviews-section::after {
    right: -140px;
    bottom: 4%;
    width: 620px;
    height: 480px;
    background: radial-gradient(closest-side, rgba(242, 203, 234, 0.5), transparent);
}

.voila-reviews-section .section-heading h2:after {
    background: transparent url(../img/2018/05/divider3_small.png) 0% 0%/auto repeat scroll;
}

.voila-reviews-section .section-heading p {
    max-width: 560px;
    margin: 0 auto;
    text-wrap: balance;
}

.voila-reviews {
    --vr-grad: linear-gradient(80deg, #89f0f5, #95c3f7, #f2cbea);
    --vr-suit: linear-gradient(160deg, #6fb2f2, #e27fc2);
    --vr-ink: #4c5462;
    --vr-muted: #8a93a3;
    --vr-focus: #95c3f7;
    --vr-shadow: rgba(79, 108, 176, 0.45);
    --vr-card-w: 150px;
    --vr-spread: 36px;
    --vr-tilt: 11deg;
    --vr-lift: 60px;
    --vr-duration: 7s;

    display: grid;
    grid-template-columns: 470px minmax(0, 1fr);
    gap: 56px;
    align-items: center;
    margin-top: 64px;
    text-align: left;
    color: var(--vr-ink);
}

/* ---------- The hand ---------- */

.voila-reviews__hand {
    position: relative;
    height: calc(var(--vr-card-w) * 1.4 + var(--vr-lift) + 48px);
}

.voila-reviews__card {
    position: absolute;
    bottom: 24px;
    left: 50%;
    z-index: 1;
    display: block;
    width: var(--vr-card-w);
    aspect-ratio: 5 / 7;
    margin-left: calc(var(--vr-card-w) / -2);
    padding: 9px 9px 30px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 0 0 1px rgba(76, 84, 98, 0.08),
        0 14px 28px -14px var(--vr-shadow);
    color: var(--vr-ink);
    cursor: pointer;
    /* Cards pivot around a point below the hand, like a fan held between the fingers */
    transform-origin: 50% 135%;
    transform: translateX(calc(var(--o) * var(--vr-spread))) rotate(calc(var(--o) * var(--vr-tilt)));
    transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15), box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.voila-reviews__photo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    filter: saturate(0.85);
    transition: filter 0.3s ease;
}

.voila-reviews__card-name {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    overflow: hidden;
    font: 700 11px/14px "Raleway", sans-serif;
    letter-spacing: 0.08em;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Corner indices, like a real card */
.voila-reviews__index {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 24px;
    padding: 4px 3px 3px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 10px -6px var(--vr-shadow);
    font: 700 13px/1 "Raleway", sans-serif;
}

.voila-reviews__index b,
.voila-reviews__chip {
    background: var(--vr-suit);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.voila-reviews__index b {
    font-size: 15px;
    letter-spacing: -0.04em;
}

.voila-reviews__index {
    color: #e27fc2;
}

.voila-reviews__index--flip {
    top: auto;
    right: 14px;
    bottom: 35px;
    left: auto;
    transform: rotate(180deg);
}

/* Holographic sweep across a freshly drawn card */
.voila-reviews__card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.75) 45%,
            rgba(242, 203, 234, 0.45) 52%, transparent 66%) no-repeat;
    background-size: 250% 100%;
    background-position: 150% 0;
    pointer-events: none;
}

.voila-reviews__card:hover {
    transform: translateX(calc(var(--o) * var(--vr-spread))) translateY(-12px) rotate(calc(var(--o) * var(--vr-tilt)));
}

.voila-reviews__card:hover .voila-reviews__photo {
    filter: none;
}

.voila-reviews__card:focus {
    outline: none;
}

.voila-reviews__card:focus-visible {
    box-shadow: 0 0 0 3px var(--vr-focus), 0 14px 28px -14px var(--vr-shadow);
}

/* The drawn card rises straight out of the hand, wrapped in the Voila gradient */
.voila-reviews__card.is-active {
    z-index: 10;
    background: linear-gradient(#fff, #fff) padding-box, var(--vr-grad) border-box;
    border: 3px solid transparent;
    padding: 6px 6px 27px;
    box-shadow: 0 26px 44px -18px var(--vr-shadow);
    transform: translateX(calc(var(--o) * var(--vr-spread))) translateY(calc(-1 * var(--vr-lift)))
        rotate(calc(var(--o) * var(--vr-tilt))) scale(1.04);
}

.voila-reviews__card.is-active .voila-reviews__photo {
    filter: none;
}

.voila-reviews__card.is-active .voila-reviews__index {
    top: 11px;
    left: 11px;
}

.voila-reviews__card.is-active .voila-reviews__index--flip {
    top: auto;
    right: 11px;
    bottom: 32px;
    left: auto;
}

.voila-reviews__card.is-active .voila-reviews__card-name {
    right: 5px;
    bottom: 5px;
    left: 5px;
}

.voila-reviews__card.is-active:focus-visible {
    box-shadow: 0 0 0 3px var(--vr-focus), 0 26px 44px -18px var(--vr-shadow);
}

.voila-reviews__card.is-drawn::after {
    animation: voila-reviews-sweep 1.1s ease-out 0.15s both;
}

@keyframes voila-reviews-sweep {
    from { background-position: 150% 0; }
    to { background-position: -60% 0; }
}

/* ---------- The stage ---------- */

.voila-reviews__stage {
    position: relative;
    padding: 56px 56px 36px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 60px -30px var(--vr-shadow), 0 0 0 1px rgba(149, 195, 247, 0.35);
}

.voila-reviews__mark {
    position: absolute;
    top: -22px;
    left: 48px;
    width: 64px;
    height: 48px;
    filter: drop-shadow(0 8px 14px rgba(149, 195, 247, 0.55));
}

/* All panels share one grid cell, so the stage keeps the tallest quote's height */
.voila-reviews__panels {
    display: grid;
}

.voila-reviews__panel {
    grid-area: 1 / 1;
    align-self: center;
    margin: 0;
}

.voila-reviews.is-ready .voila-reviews__panel:not(.is-active) {
    visibility: hidden;
}

.voila-reviews.is-ready .voila-reviews__panel.is-active .voila-reviews__author {
    animation: voila-reviews-rise 0.6s ease-out 0.25s both;
}

.voila-reviews:not(.is-ready) .voila-reviews__panel + .voila-reviews__panel {
    grid-area: auto;
    margin-top: 40px;
}

.voila-reviews__quote {
    margin: 0 0 32px;
    padding: 0;
    border: 0;
    background: none;
}

.voila-reviews__quote p {
    margin: 0;
    color: var(--vr-ink);
    font: 600 30px/1.4 "Raleway", sans-serif;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

/* Word-by-word reveal, added by reviews.js */
.voila-reviews__word {
    display: inline-block;
}

.voila-reviews__panel.is-revealing .voila-reviews__word {
    animation: voila-reviews-word 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--w) * 55ms);
}

@keyframes voila-reviews-word {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(0.35em);
    }
}

@keyframes voila-reviews-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.voila-reviews__author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.voila-reviews__chip {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(#fff, #fff) padding-box, var(--vr-grad) border-box;
    border: 2px solid transparent;
    box-shadow: 0 8px 16px -10px var(--vr-shadow);
    color: #d86fb6;
    font: 700 15px/1 "Raleway", sans-serif;
    letter-spacing: -0.02em;
}

.voila-reviews__who {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.voila-reviews__who strong {
    color: var(--vr-ink);
    font: 700 16px/1.25 "Raleway", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.voila-reviews__who span {
    color: var(--vr-muted);
    font-size: 15px;
    line-height: 1.4;
}

/* ---------- Controls ---------- */

.voila-reviews__controls {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid rgba(149, 195, 247, 0.3);
}

.voila-reviews.is-ready .voila-reviews__controls {
    display: flex;
}

.voila-reviews__progress {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-right: 8px;
}

.voila-reviews__count {
    flex: 0 0 auto;
    color: var(--vr-muted);
    font: 700 13px/1 "Raleway", sans-serif;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}

.voila-reviews__count b {
    color: var(--vr-ink);
}

.voila-reviews__track {
    position: relative;
    flex: 1;
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: #edf1f8;
}

.voila-reviews__bar {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--vr-grad);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* The bar is the timer: when its animation ends, reviews.js deals the next card. */
.voila-reviews__bar.is-running {
    animation: voila-reviews-progress var(--vr-duration) linear both;
}

.voila-reviews:hover .voila-reviews__bar,
.voila-reviews:has(:focus-visible) .voila-reviews__bar,
.voila-reviews.is-offscreen .voila-reviews__bar {
    animation-play-state: paused;
}

@keyframes voila-reviews-progress {
    to { transform: scaleX(1); }
}

.voila-reviews__btn {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(149, 195, 247, 0.45);
    border-radius: 50%;
    background: #fff;
    color: var(--vr-ink);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.voila-reviews__btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.voila-reviews__icon-play {
    fill: currentColor !important;
    stroke-width: 1.5 !important;
}

.voila-reviews__btn:hover {
    border-color: transparent;
    background: var(--vr-grad);
    color: #fff;
    transform: translateY(-1px);
}

.voila-reviews__btn:focus {
    outline: none;
}

.voila-reviews__btn:focus-visible {
    box-shadow: 0 0 0 3px var(--vr-focus);
}

.voila-reviews__icon-play,
.voila-reviews.is-paused .voila-reviews__icon-pause {
    display: none;
}

.voila-reviews.is-paused .voila-reviews__icon-play {
    display: block;
}

/* ---------- Tablet: hand above the stage ---------- */

@media (max-width: 1199px) {
    .voila-reviews {
        --vr-card-w: 128px;
        --vr-spread: 30px;

        grid-template-columns: 400px minmax(0, 1fr);
        gap: 32px;
    }

    .voila-reviews__quote p {
        font-size: 26px;
    }
}

@media (max-width: 991px) {
    .voila-reviews {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        max-width: 640px;
        margin: 48px auto 0;
    }

    .voila-reviews__stage {
        padding: 48px 40px 30px;
    }
}

/* ---------- Phones: a tighter hand ---------- */

@media (max-width: 575px) {
    .voila-reviews {
        --vr-card-w: 100px;
        --vr-spread: 24px;
        --vr-tilt: 10deg;
        --vr-lift: 40px;

        margin-top: 36px;
    }

    .voila-reviews__card {
        padding: 6px 6px 24px;
        border-radius: 10px;
    }

    .voila-reviews__card.is-active {
        padding: 3px 3px 21px;
        border-width: 3px;
    }

    .voila-reviews__photo {
        border-radius: 6px;
    }

    .voila-reviews__card-name {
        bottom: 6px;
        font-size: 8px;
        line-height: 12px;
        letter-spacing: 0;
    }

    .voila-reviews__card.is-active .voila-reviews__card-name {
        bottom: 3px;
    }

    .voila-reviews__index,
    .voila-reviews__card.is-active .voila-reviews__index {
        top: 9px;
        left: 9px;
        min-width: 18px;
        padding: 3px 2px 2px;
        border-radius: 5px;
        font-size: 10px;
    }

    .voila-reviews__index b {
        font-size: 11px;
    }

    .voila-reviews__index--flip,
    .voila-reviews__card.is-active .voila-reviews__index--flip {
        display: none;
    }

    .voila-reviews__stage {
        padding: 40px 22px 22px;
        border-radius: 22px;
    }

    .voila-reviews__mark {
        top: -18px;
        left: 22px;
        width: 50px;
        height: 38px;
    }

    .voila-reviews__quote {
        margin-bottom: 24px;
    }

    .voila-reviews__quote p {
        font-size: 21px;
    }

    .voila-reviews__controls {
        margin-top: 24px;
        padding-top: 18px;
    }

    .voila-reviews__btn {
        width: 40px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .voila-reviews *,
    .voila-reviews *::before,
    .voila-reviews *::after {
        transition: none !important;
        animation: none !important;
    }
}
