/* Homepage Testimonials section (NewViews/Widgets/TwVite/HomeTestimonials.php), the winner of Mida
   Test 44: the tested variant CSS (scripts/testimonials-mida/base.css + dark.css). Figma tokens: warm
   neutral base #F9F9F8 / #21201C, blue only for the CTA and links, Rubik. Theme classes: .aa-tm-dark =
   always dark, .aa-tm-auto = dark only while the visitor's system is in dark mode. Loaded only on the
   homepage of the languages where the section is live (Modules\Index\Services\HomeTestimonials). */

/* Single-device languages keep the carousel on the other devices: the device check in
   Index/TwVite/Index.php sets aa-tm-on when it shows the section (languages live everywhere do
   not render the carousel at all). */
html.aa-tm-on [data-aa-embed="reviews-carousel"] {
    display: none !important;
}

/* Stories modal (TwVite_HomeStories): a language with few videos (FR has 4) centres the cards
   instead of leaving the right half empty. Auto margins on the first and last card absorb the
   free space and collapse to 0 once the row overflows, so long lists still scroll from the start
   (first-of-type: the Alpine x-for template is the first child). */
@media (min-width: 768px) {
    [role="dialog"] ul[x-ref="track"] > li:first-of-type {
        margin-left: auto;
    }
    [role="dialog"] ul[x-ref="track"] > li:last-of-type {
        margin-right: auto;
    }
}

.aa-tm {
    background: #f9f9f8;
    padding: 64px 16px;
    font-family: 'Rubik', sans-serif;
    color: #21201c;
}
.aa-tm *,
.aa-tm *:before,
.aa-tm *:after {
    box-sizing: border-box;
}
.aa-tm-in {
    max-width: 1280px;
    margin: 0 auto;
}
.aa-tm p,
.aa-tm h2 {
    margin: 0;
}

/* Header */
.aa-tm-head {
    margin-bottom: 32px;
}
.aa-tm-eyebrow {
    font-size: 16px;
    line-height: 24px;
    color: rgba(8, 8, 0, 0.63);
    margin-bottom: 16px;
}
.aa-tm-h2 {
    font-size: 28px;
    line-height: 36px;
    font-weight: 500;
    letter-spacing: -0.0043em;
    color: #21201c;
}
.aa-tm-actions {
    margin-top: 24px;
    text-align: center;
}
.aa-tm-cta {
    display: block;
    height: 40px;
    line-height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    background: #2f80ed;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}
.aa-tm-cta:hover,
.aa-tm-cta:active {
    background: #1341ba;
    color: #fff;
    text-decoration: none;
}
.aa-tm-cta:focus-visible,
.aa-tm-link:focus-visible,
.aa-tm-logo:focus-visible {
    outline: 2px solid #2f80ed;
    outline-offset: 2px;
}
.aa-tm-note {
    display: block;
    margin-top: 12px;
    font-size: 16px;
    line-height: 24px;
    color: rgba(8, 8, 0, 0.63);
    white-space: nowrap;
}

/* Video card */
.aa-tm-video {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 16px;
}
.aa-tm-stage {
    position: relative;
    height: 380px;
    background-color: #0a0f1a;
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
}
.aa-tm-player {
    display: none;
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: auto;
    max-width: 100%;
    transform: translateX(-50%);
    background: #0a0f1a;
}
.aa-tm-started .aa-tm-player {
    display: block;
}
.aa-tm-started .aa-tm-stage {
    background-image: none !important;
}
.aa-tm-shade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 240px;
    background: linear-gradient(180deg, rgba(10, 15, 26, 0) 0%, rgba(10, 15, 26, 0.5) 50%, rgba(10, 15, 26, 0.88) 100%);
    pointer-events: none;
}
.aa-tm-playing .aa-tm-shade,
.aa-tm-playing .aa-tm-cap-d {
    display: none;
}
.aa-tm-playbtn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.aa-tm-playbtn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}
.aa-tm-failed .aa-tm-playbtn {
    display: none;
}
.aa-tm-disc {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin: -40px 0 0 -40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, opacity 0.2s, background-color 0.2s;
}
.aa-tm-playbtn:hover .aa-tm-disc {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.4);
}
.aa-tm-playing .aa-tm-disc {
    opacity: 0;
}
.aa-tm-playing .aa-tm-playbtn:hover .aa-tm-disc,
.aa-tm-playing .aa-tm-playbtn:focus-visible .aa-tm-disc {
    opacity: 1;
}
.aa-tm-ic {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
}
.aa-tm-ic svg {
    display: block;
}
.aa-tm-ic-play {
    display: block;
    margin-left: -12px;
}
.aa-tm-loading .aa-tm-ic-play,
.aa-tm-playing .aa-tm-ic-play {
    display: none;
}
.aa-tm-loading .aa-tm-ic-spin {
    display: block;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: aa-tm-spin 0.8s linear infinite;
}
.aa-tm-playing .aa-tm-ic-pause {
    display: block;
}
.aa-tm-loading .aa-tm-ic-pause {
    display: none;
}
@keyframes aa-tm-spin {
    to { transform: rotate(360deg); }
}
.aa-tm-cap-d {
    display: none;
}
.aa-tm-cap-m {
    padding: 24px 24px 24px;
}
.aa-tm-quote {
    font-size: 20px;
    line-height: 28px;
    letter-spacing: -0.005em;
}
.aa-tm-author {
    margin-top: 12px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
}
.aa-tm-dur {
    margin-left: 4px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    color: rgba(8, 8, 0, 0.63);
}
.aa-tm-dots {
    font-size: 0;
    line-height: 0;
    text-align: center;
}
.aa-tm-dots-m {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
}
.aa-tm-dot {
    display: inline-block;
    vertical-align: middle;
    width: 6px;
    height: 6px;
    margin: 0 4px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(255, 251, 237, 0.24);
    cursor: pointer;
    transition: width 0.2s, background-color 0.2s;
}
.aa-tm-dot.is-on {
    width: 24px;
    background: #fff;
}
.aa-tm-dot:hover {
    background: rgba(255, 251, 237, 0.5);
}
.aa-tm-dot.is-on:hover {
    background: #fff;
}

/* Review cards */
.aa-tm-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}
.aa-tm-card:last-child {
    margin-bottom: 0;
}
.aa-tm-stars {
    font-size: 0;
    line-height: 0;
}
.aa-tm-stars svg {
    display: inline-block;
    vertical-align: top;
    margin-right: 2px;
}
.aa-tm-text {
    margin-top: 16px;
    font-size: 16px;
    line-height: 24px;
    color: #21201c;
}
.aa-tm-who {
    display: flex;
    align-items: center;
    margin-top: 24px;
}
.aa-tm-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 50%;
    background: rgba(32, 16, 0, 0.06);
    font-size: 16px;
    font-weight: 500;
    color: rgba(8, 8, 0, 0.63);
    flex-shrink: 0;
}
.aa-tm-who-name {
    display: block;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: #21201c;
}
.aa-tm-verified {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 12px;
    line-height: 20px;
    color: rgba(8, 8, 0, 0.63);
}
.aa-tm-verified img {
    height: 20px;
    width: auto;
    margin-left: 8px;
}
.aa-tm-logo-dark {
    display: none;
}

/* Footer: rating line + link */
.aa-tm-foot {
    margin-top: 32px;
    text-align: center;
}
.aa-tm-rating .aa-tm-stars {
    margin-bottom: 8px;
}
.aa-tm-rating-text {
    font-size: 16px;
    line-height: 24px;
    color: rgba(8, 8, 0, 0.63);
}
.aa-tm-rd {
    display: none;
}
.aa-tm-logo {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    transition: opacity 0.2s;
}
.aa-tm-logo:hover {
    opacity: 0.8;
}
.aa-tm-logo img {
    display: block;
    height: 16px;
    width: auto;
}
.aa-tm-logo .aa-tm-logo-dark {
    display: none;
}
.aa-tm-link {
    display: inline-block;
    margin-top: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    color: #0058dd;
    text-decoration: none;
    cursor: pointer;
}
.aa-tm-link:hover {
    color: #0058dd;
    text-decoration: underline;
}

/* From 992px: header on one row, rating line and link side by side */
@media (min-width: 992px) {
    .aa-tm {
        padding: 64px 40px;
    }
    .aa-tm-head {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
    }
    .aa-tm-title {
        max-width: 737px;
    }
    .aa-tm-h2 {
        font-size: 35px;
        line-height: 40px;
        letter-spacing: -0.0046em;
    }
    .aa-tm-actions {
        display: flex;
        align-items: center;
        margin: 0 0 0 32px;
        flex-shrink: 0;
    }
    .aa-tm-cta {
        display: inline-block;
        width: auto;
    }
    .aa-tm-note {
        order: -1;
        margin: 0 16px 0 0;
    }
    .aa-tm-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 32px;
        text-align: left;
    }
    .aa-tm-rating {
        display: flex;
        align-items: center;
    }
    .aa-tm-rating .aa-tm-stars {
        margin: 0 12px 0 0;
    }
    .aa-tm-rd {
        display: inline;
    }
    .aa-tm-rm {
        display: none;
    }
    .aa-tm-link {
        margin-top: 0;
    }
}

/* From 1201px: two columns, video 672 / reviews 592, caption inside the video */
@media (min-width: 1201px) {
    .aa-tm {
        padding: 120px 80px;
    }
    .aa-tm-head {
        margin-bottom: 64px;
    }
    .aa-tm-grid {
        display: flex;
        align-items: stretch;
    }
    .aa-tm-video {
        width: 53%;
        margin: 0 16px 0 0;
        background: #0a0f1a;
        flex-shrink: 0;
    }
    .aa-tm-stage {
        height: 635px;
    }
    .aa-tm-shade {
        height: 300px;
    }
    .aa-tm-cap-m,
    .aa-tm-dots-m {
        display: none;
    }
    .aa-tm-cap-d {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 40px;
        color: #fff;
        pointer-events: none;
    }
    .aa-tm-cap-d .aa-tm-quote {
        font-weight: 500;
    }
    .aa-tm-cap-d .aa-tm-author {
        margin-top: 16px;
    }
    .aa-tm-cap-d .aa-tm-dur {
        color: rgba(255, 252, 244, 0.69);
    }
    .aa-tm-dots-d {
        margin-top: 24px;
        text-align: left;
        pointer-events: auto;
    }
    .aa-tm-dots-d .aa-tm-dot {
        margin: 0 8px 0 0;
    }
    .aa-tm-reviews {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        min-width: 0;
    }
    .aa-tm-card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex-grow: 1;
        padding: 40px;
    }
    .aa-tm-text {
        font-size: 18px;
        line-height: 26px;
        letter-spacing: -0.005em;
    }
    .aa-tm-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    .aa-tm-who-name {
        font-size: 16px;
        line-height: 24px;
    }
    .aa-tm-verified {
        font-size: 14px;
    }
    .aa-tm-foot {
        margin-top: 64px;
    }
}

/* Always dark */
.aa-tm-dark {
    background: #191918;
    color: #fff;
}
.aa-tm-dark .aa-tm-h2,
.aa-tm-dark .aa-tm-quote,
.aa-tm-dark .aa-tm-author,
.aa-tm-dark .aa-tm-text,
.aa-tm-dark .aa-tm-who-name {
    color: #fff;
}
.aa-tm-dark .aa-tm-eyebrow,
.aa-tm-dark .aa-tm-note,
.aa-tm-dark .aa-tm-dur,
.aa-tm-dark .aa-tm-rating-text,
.aa-tm-dark .aa-tm-verified,
.aa-tm-dark .aa-tm-avatar {
    color: rgba(255, 252, 244, 0.69);
}
.aa-tm-dark .aa-tm-video,
.aa-tm-dark .aa-tm-card {
    background: #222221;
}
.aa-tm-dark .aa-tm-avatar {
    background: rgba(246, 246, 245, 0.07);
}
.aa-tm-dark .aa-tm-link,
.aa-tm-dark .aa-tm-link:hover {
    color: #7fb6ff;
}
.aa-tm-dark .aa-tm-link:focus-visible,
.aa-tm-dark .aa-tm-logo:focus-visible {
    outline-color: #7fb6ff;
}
.aa-tm-dark .aa-tm-logo-light {
    display: none;
}
.aa-tm-dark .aa-tm-logo-dark {
    display: inline;
}
.aa-tm-dark .aa-tm-logo .aa-tm-logo-dark {
    display: block;
}

/* Auto: dark only while the visitor's system is in dark mode */
@media (prefers-color-scheme: dark) {
    .aa-tm-auto {
        background: #191918;
        color: #fff;
    }
    .aa-tm-auto .aa-tm-h2,
    .aa-tm-auto .aa-tm-quote,
    .aa-tm-auto .aa-tm-author,
    .aa-tm-auto .aa-tm-text,
    .aa-tm-auto .aa-tm-who-name {
        color: #fff;
    }
    .aa-tm-auto .aa-tm-eyebrow,
    .aa-tm-auto .aa-tm-note,
    .aa-tm-auto .aa-tm-dur,
    .aa-tm-auto .aa-tm-rating-text,
    .aa-tm-auto .aa-tm-verified,
    .aa-tm-auto .aa-tm-avatar {
        color: rgba(255, 252, 244, 0.69);
    }
    .aa-tm-auto .aa-tm-video,
    .aa-tm-auto .aa-tm-card {
        background: #222221;
    }
    .aa-tm-auto .aa-tm-avatar {
        background: rgba(246, 246, 245, 0.07);
    }
    .aa-tm-auto .aa-tm-link,
    .aa-tm-auto .aa-tm-link:hover {
        color: #7fb6ff;
    }
    .aa-tm-auto .aa-tm-link:focus-visible,
    .aa-tm-auto .aa-tm-logo:focus-visible {
        outline-color: #7fb6ff;
    }
    .aa-tm-auto .aa-tm-logo-light {
        display: none;
    }
    .aa-tm-auto .aa-tm-logo-dark {
        display: inline;
    }
    .aa-tm-auto .aa-tm-logo .aa-tm-logo-dark {
        display: block;
    }
}
