/**
 * Reviews block.
 *
 * Values mirror the Tilda original (bebestschool.com, record rec536159497 and
 * the nine review blocks its Owl carousel pulls in): a #ffd72e band with a
 * 40 px heading and a 20 px paragraph, three reviews 10 px apart across the
 * 1200 px grid from 1000 px up and one below, 16 px names, 14 px coral
 * occupations, 15 px copy in #2e2e2e, and 30 px outlined arrows either side
 * of 9 px dots under the row.
 */

.bbs-reviews {
    --bbs-reviews-font: 'ApercuPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --bbs-reviews-container: 1200px;
    --bbs-reviews-gutter: 20px;
    --bbs-reviews-ink: #2e2e2e;
    --bbs-reviews-gap: 10px;
    --bbs-reviews-visible: 3;

    padding: 9px 0 53px;
    background: #ffd72e;
    color: var(--bbs-reviews-ink);
    font-family: var(--bbs-reviews-font);
}

.bbs-reviews *,
.bbs-reviews *::before,
.bbs-reviews *::after {
    box-sizing: border-box;
}

.bbs-reviews__inner {
    max-width: var(--bbs-reviews-container);
    margin: 0 auto;
    padding: 0 var(--bbs-reviews-gutter);
}

.bbs-reviews__title {
    margin: 0 0 24px;
    color: #000000;
    font-size: 40px;
    line-height: 1.55;
    font-weight: 700;
    text-align: center;
}

.bbs-reviews__title:has(+ .bbs-reviews__intro) {
    margin-bottom: 5px;
}

.bbs-reviews__intro {
    margin: 0 0 19px;
    color: #000000;
    font-size: 20px;
    line-height: 1.55;
    font-weight: 400;
}

/* ── Track: a scroll-snapping row, so swiping works with or without the script ── */
.bbs-reviews__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--bbs-reviews-gap) * (var(--bbs-reviews-visible) - 1)) / var(--bbs-reviews-visible));
    gap: var(--bbs-reviews-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.bbs-reviews__track::-webkit-scrollbar {
    display: none;
}

/* ── Review ── */
.bbs-reviews__item {
    --bbs-reviews-accent: #f66746;

    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 10px 10px 0;
    scroll-snap-align: start;
    text-align: center;
}

.bbs-reviews__item--purple { --bbs-reviews-accent: #4b23da; }
.bbs-reviews__item--pink   { --bbs-reviews-accent: #f16698; }
.bbs-reviews__item--green  { --bbs-reviews-accent: #1cb65a; }

.bbs-reviews__item > * {
    max-width: 370px;
    margin: 0;
}

.bbs-reviews__name {
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
}

.bbs-reviews__role {
    color: var(--bbs-reviews-accent);
    font-size: 14px;
    line-height: 1.4;
}

.bbs-reviews__program {
    max-width: 310px;
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.4;
}

.bbs-reviews__text {
    margin-top: 5px;
    font-size: 15px;
    line-height: 1.4;
}

.bbs-reviews__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    line-height: 1.4;
}

.bbs-reviews__text + .bbs-reviews__meta {
    margin-top: 10px;
}

.bbs-reviews__meta + .bbs-reviews__meta {
    margin-top: 5px;
}

.bbs-reviews__item strong {
    font-weight: 700;
}

.bbs-reviews__stars {
    display: inline-flex;
    gap: 1px;
}

.bbs-reviews__stars svg {
    display: block;
    width: 17px;
    height: 17px;
    /* Dark, as the original's: yellow ones would vanish on the yellow band. */
    fill: #2e2e2e;
    stroke: #2e2e2e;
    stroke-width: 1.2;
    stroke-linejoin: round;
}

/* ── Arrows and dots ── */
.bbs-reviews__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 83px;
    margin-top: 20px;
}

.bbs-reviews__nav[hidden] {
    display: none;
}

.bbs-reviews__arrow {
    display: block;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: none;
    color: #000000;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.bbs-reviews__arrow svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bbs-reviews__arrow:hover {
    transform: scale(1.1);
}

.bbs-reviews__arrow:focus-visible {
    outline: 2px solid #1cb65a;
    outline-offset: 2px;
    border-radius: 50%;
}

.bbs-reviews__dots {
    display: flex;
    gap: 17px;
}

.bbs-reviews__dot {
    position: relative;
    display: block;
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(51, 51, 51, 0.6);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* A larger hit area than the 9 px dot. */
.bbs-reviews__dot::after {
    content: '';
    position: absolute;
    inset: -7px;
}

.bbs-reviews__dot:hover {
    background: #333333;
}

.bbs-reviews__dot.is-active {
    background: #1cb65a;
    transform: scale(1.25);
}

.bbs-reviews__dot:focus-visible {
    outline: 2px solid #1cb65a;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .bbs-reviews__track {
        scroll-behavior: auto;
    }

    .bbs-reviews__arrow,
    .bbs-reviews__dot {
        transition: none;
    }

    .bbs-reviews__arrow:hover {
        transform: none;
    }
}

/* ── 999 and below: one review at a time, as the original's carousel ── */
@media (max-width: 999px) {
    .bbs-reviews {
        --bbs-reviews-visible: 1;

        padding-bottom: 53px;
    }

    .bbs-reviews__item > * {
        max-width: 450px;
    }

    .bbs-reviews__nav {
        gap: 40px;
    }
}

@media (max-width: 639px) {
    .bbs-reviews {
        --bbs-reviews-gutter: 16px;

        padding: 21px 0 50px;
    }

    .bbs-reviews__title {
        font-size: 30px;
        line-height: 1.3;
    }

    .bbs-reviews__title:has(+ .bbs-reviews__intro) {
        margin-bottom: 12px;
    }

    .bbs-reviews__nav {
        gap: 24px;
    }
}

/* On a course page (bebestschool.com/spanish-course, rec551243249): 50 px
   more air above the heading and 60 px more under the arrows. */
.bbs-reviews.bbs-reviews--course {
    padding-top: 59px;
    padding-bottom: 130px;
}

.bbs-reviews--course .bbs-reviews__title {
    margin-bottom: 44px;
}

/*
 * On a course page (bebestschool.com/italiano-course/italiano-beginner,
 * rec724834806): a 657 px band; the heading 40 / 62 px 60 px down; the
 * reviews in a 380 px window 35 px under it — name 16 / 22 px, role
 * 14 / 20 px, the programme 227 px wide, all 15 / 21 px — and the arrows
 * 18 px under the window.
 */
.bbs-reviews.bbs-reviews--course {
    padding: 60px 0 0;
    height: 657px;
    box-sizing: border-box;
}

.bbs-reviews--course .bbs-reviews__title {
    margin-bottom: 35px;
    line-height: 62px;
}

.bbs-reviews--course .bbs-reviews__track {
    height: 380px;
    align-items: start;
    overflow-y: hidden;
}

.bbs-reviews--course .bbs-reviews__item {
    padding-top: 0;
}

.bbs-reviews--course .bbs-reviews__name { line-height: 22px; }
.bbs-reviews--course .bbs-reviews__role { line-height: 20px; }

.bbs-reviews--course :is(.bbs-reviews__program, .bbs-reviews__text, .bbs-reviews__meta) {
    line-height: 21px;
}

.bbs-reviews--course .bbs-reviews__program {
    max-width: 227px;
}

.bbs-reviews--course .bbs-reviews__text + .bbs-reviews__meta {
    margin-top: 1px;
}

.bbs-reviews--course .bbs-reviews__nav {
    margin-top: 18px;
}

@media (max-width: 1199px) {
    .bbs-reviews.bbs-reviews--course {
        height: auto;
        padding-bottom: 60px;
    }

    .bbs-reviews--course .bbs-reviews__track {
        height: auto;
    }
}

@media (min-width: 1200px) {
    .bbs-reviews--course .bbs-reviews__track {
        height: 380px;
    }
}
