/* ==========================================================
   Reviews: a single pull quote on stage, the magicians lined
   up beneath it. Pointing at a portrait peeks at that quote;
   clicking keeps it. The ring around the active portrait is
   the countdown to the next one.
   Behaviour lives in assets/js/reviews.js.
   ========================================================== */

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

/* Soft Voila-coloured glows behind the quote */
.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: 26%;
    left: -140px;
    width: 560px;
    height: 460px;
    background: radial-gradient(closest-side, rgba(137, 240, 245, 0.34), transparent);
}

.voila-reviews-section::after {
    right: -150px;
    bottom: 2%;
    width: 620px;
    height: 480px;
    background: radial-gradient(closest-side, rgba(242, 203, 234, 0.44), 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: 620px;
    margin: 0 auto;
    text-wrap: balance;
}

.voila-reviews {
    --vr-grad: linear-gradient(80deg, #89f0f5, #95c3f7, #f2cbea);
    --vr-ink: #4c5462;
    --vr-muted: #8a93a3;
    --vr-focus: #95c3f7;
    --vr-shadow: rgba(79, 108, 176, 0.45);
    --vr-portrait: 66px;
    --vr-live: 1.18;
    --vr-live-peak: 1.32;
    --vr-duration: 7s;

    max-width: 880px;
    margin: 60px auto 0;
    color: var(--vr-ink);
    text-align: center;
}

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

.voila-reviews__stage {
    position: relative;
    padding-top: 46px;
}

.voila-reviews__mark {
    position: absolute;
    top: 0;
    left: 50%;
    width: 52px;
    height: 39px;
    margin-left: -26px;
    filter: drop-shadow(0 10px 16px rgba(149, 195, 247, 0.5));
}

/* 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;
}

/* Without JavaScript every quote is simply listed */
.voila-reviews:not(.is-ready) .voila-reviews__panel + .voila-reviews__panel {
    grid-area: auto;
    margin-top: 44px;
}

.voila-reviews__quote {
    position: relative;
    max-width: 820px;
    margin: 0 auto 26px;
    padding: 0;
    border: 0;
    background: none;
}

.voila-reviews__quote p {
    max-width: 780px;
    margin: 0 auto;
    color: var(--vr-ink);
    font: 600 33px/1.42 "Raleway", sans-serif;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

/* A thread of light passes over the quote and leaves the words behind it */
.voila-reviews.is-ready .voila-reviews__panel.is-active .voila-reviews__quote p {
    animation: voila-reviews-reveal 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.voila-reviews.is-ready .voila-reviews__panel.is-active .voila-reviews__quote::after {
    content: "";
    position: absolute;
    top: -12px;
    bottom: -12px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(137, 240, 245, 0), #95c3f7 35%, #e6b9df 70%, rgba(242, 203, 234, 0));
    box-shadow: 0 0 20px 7px rgba(149, 195, 247, 0.35);
    filter: blur(1px);
    pointer-events: none;
    animation: voila-reviews-pass 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes voila-reviews-reveal {
    from {
        opacity: 0;
        clip-path: inset(-0.3em -0.1em -0.4em 100%);
    }
    to {
        opacity: 1;
        clip-path: inset(-0.3em -0.1em -0.4em -0.1em);
    }
}

@keyframes voila-reviews-pass {
    from { left: 0; opacity: 0; }
    12% { opacity: 1; }
    85% { opacity: 1; }
    to { left: 100%; opacity: 0; }
}

.voila-reviews__author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

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

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

.voila-reviews__name {
    color: var(--vr-ink);
    font: 700 15px/1.3 "Raleway", sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

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

/* ---------- The line-up ---------- */

.voila-reviews__rail {
    display: none;
    margin-top: 44px;
    padding-top: 34px;
    border-top: 1px solid rgba(149, 195, 247, 0.32);
}

.voila-reviews.is-ready .voila-reviews__rail {
    display: block;
}

.voila-reviews__picks {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding-bottom: 30px;
}

.voila-reviews__pick {
    position: relative;
    width: var(--vr-portrait);
    height: var(--vr-portrait);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.voila-reviews__disc {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.25, 1.1);
}

.voila-reviews__portrait {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(76, 84, 98, 0.08), 0 10px 22px -14px var(--vr-shadow);
    filter: grayscale(1) contrast(0.95);
    opacity: 0.62;
    transition: filter 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease;
}

/* The ring is the countdown: it closes over --vr-duration, then the next quote comes up */
.voila-reviews__ring {
    position: absolute;
    inset: -7px;
    opacity: 0;
    transform: rotate(-90deg);
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.voila-reviews__ring circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.voila-reviews__ring-track {
    stroke: rgba(149, 195, 247, 0.28);
}

.voila-reviews__ring-line {
    stroke: url(#voila-reviews-grad);
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.voila-reviews__ring-line.is-running {
    animation: voila-reviews-count var(--vr-duration) linear both;
}

@keyframes voila-reviews-count {
    to { stroke-dashoffset: 0; }
}

/* Reading a quote — hovering, peeking, tabbing through the line-up — holds the countdown.
   Keyboard focus only: a click leaves the portrait focused, and that must not stop the turn. */
.voila-reviews:hover .voila-reviews__ring-line,
.voila-reviews:has(:focus-visible) .voila-reviews__ring-line,
.voila-reviews.is-offscreen .voila-reviews__ring-line {
    animation-play-state: paused;
}

.voila-reviews__pick.is-active .voila-reviews__ring {
    opacity: 1;
}

.voila-reviews__pick.is-active .voila-reviews__portrait,
.voila-reviews__pick.is-peeking .voila-reviews__portrait {
    filter: none;
    opacity: 1;
}

.voila-reviews__pick:hover .voila-reviews__disc,
.voila-reviews__pick.is-peeking .voila-reviews__disc {
    transform: translateY(-5px);
}

/* The portrait of the magician on stage stays larger for the whole of its turn */
.voila-reviews__pick.is-active {
    z-index: 2;
}

.voila-reviews__pick.is-active .voila-reviews__disc {
    transform: scale(var(--vr-live));
}

.voila-reviews__pick.is-active:hover .voila-reviews__disc {
    transform: translateY(-5px) scale(var(--vr-live));
}

/* Going live: the portrait rises over the line-up, overshoots, and settles at its live size */
.voila-reviews__pick.is-entering {
    z-index: 3;
}

.voila-reviews__pick.is-entering .voila-reviews__disc {
    animation: voila-reviews-pop 0.7s cubic-bezier(0.22, 0.9, 0.3, 1.05) both;
}

@keyframes voila-reviews-pop {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-9px) scale(var(--vr-live-peak)); }
    100% { transform: translateY(0) scale(var(--vr-live)); }
}

/* The magician who just left the stage hands the size back… */
.voila-reviews__pick.is-leaving .voila-reviews__disc {
    animation: voila-reviews-stand-down 0.7s cubic-bezier(0.22, 0.9, 0.3, 1.05) both;
}

@keyframes voila-reviews-stand-down {
    0% { transform: scale(var(--vr-live)); }
    40% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* …while the rest of the line-up draws back to make room */
.voila-reviews__picks.is-popping .voila-reviews__pick:not(.is-entering):not(.is-leaving) .voila-reviews__disc {
    animation: voila-reviews-make-room 0.7s cubic-bezier(0.22, 0.9, 0.3, 1.05) both;
}

@keyframes voila-reviews-make-room {
    0% { transform: scale(1); }
    40% { transform: scale(0.84); }
    100% { transform: scale(1); }
}

.voila-reviews__pick:hover .voila-reviews__portrait,
.voila-reviews__pick.is-peeking .voila-reviews__portrait {
    box-shadow: 0 0 0 1px rgba(76, 84, 98, 0.08), 0 16px 26px -14px var(--vr-shadow);
}

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

.voila-reviews__pick:focus-visible .voila-reviews__portrait {
    box-shadow: 0 0 0 3px var(--vr-focus), 0 16px 26px -14px var(--vr-shadow);
}

/* The name waits under the portrait until someone points at it */
.voila-reviews__tip {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    max-width: 140px;
    color: var(--vr-muted);
    font: 700 11px/1.3 "Raleway", sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.voila-reviews__pick:hover .voila-reviews__tip,
.voila-reviews__pick:focus-visible .voila-reviews__tip,
.voila-reviews__pick.is-active .voila-reviews__tip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.voila-reviews__pick.is-active .voila-reviews__tip {
    color: var(--vr-ink);
}

/* While someone peeks, only the name under the pointer is spelled out */
.voila-reviews__picks:hover .voila-reviews__pick.is-active:not(:hover) .voila-reviews__tip {
    opacity: 0;
    transform: translate(-50%, -4px);
}

/* ---------- Smaller screens ---------- */

@media (max-width: 991px) {
    .voila-reviews {
        --vr-portrait: 60px;

        margin-top: 48px;
    }

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

    .voila-reviews__picks {
        gap: 14px;
    }
}

@media (max-width: 575px) {
    .voila-reviews {
        --vr-portrait: 52px;
        --vr-live: 1.12;
        --vr-live-peak: 1.24;

        margin-top: 36px;
    }

    .voila-reviews__stage {
        padding-top: 38px;
    }

    .voila-reviews__mark {
        width: 42px;
        height: 32px;
        margin-left: -21px;
    }

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

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

    .voila-reviews__role {
        font-size: 14px;
    }

    .voila-reviews__rail {
        margin-top: 34px;
        padding-top: 26px;
    }

    .voila-reviews__picks {
        gap: 10px;
        padding-bottom: 24px;
    }

    .voila-reviews__tip {
        font-size: 10px;
        letter-spacing: 0.06em;
    }
}

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

    .voila-reviews.is-ready .voila-reviews__panel.is-active .voila-reviews__quote::after {
        display: none;
    }
}
