/**
 * Numbered steps block.
 *
 * Values mirror the Tilda original (bebestschool.com, record rec500941890, a
 * Zero block): a 40 px bold #f66746 heading on the left, a coral 260 × 45
 * button rounded 20 px on the right, a 20 px paragraph across the full width,
 * then four steps from 24 px into the grid, 294 px apart — a 98 px bold coral
 * number and, 133 px under its top, 18 px #2e2e2e text 219 px wide.
 * Tablets: two to a row, centred, the button under them. Phones: one to a
 * row, the number beside the text.
 */

.bbs-nsteps {
    --bbs-nsteps-coral: #f66746;
    --bbs-nsteps-coral-hover: #e4502e;

    padding: 28px 0 68px;
    background: #ffffff;
    color: #2e2e2e;
    font-family: 'ApercuPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

.bbs-nsteps__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.bbs-nsteps__title {
    grid-column: 1;
    grid-row: 1;
    max-width: 829px;
    margin: 0;
    color: var(--bbs-nsteps-coral);
    font-size: 40px;
    line-height: 1.25;
    font-weight: 700;
}

/* Arial, as the original's button — the one piece not set in ApercuPro. */
.bbs-nsteps__btn {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 260px;
    min-height: 45px;
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--bbs-nsteps-coral);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.bbs-nsteps__btn:visited {
    color: #ffffff;
}

.bbs-nsteps__btn:hover,
.bbs-nsteps__btn:focus-visible {
    background: var(--bbs-nsteps-coral-hover);
    color: #ffffff;
    text-decoration: none;
}

.bbs-nsteps__btn:focus-visible {
    outline: 2px solid var(--bbs-nsteps-coral);
    outline-offset: 3px;
}

.bbs-nsteps__intro {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: #000000;
    font-size: 20px;
    line-height: 1.55;
    font-weight: 400;
}

.bbs-nsteps__list {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 219px);
    column-gap: 75px;
    margin: 32px 0 0;
    padding: 0 0 0 24px;
    list-style: none;
}

/* The numbers' tall line boxes rise into the paragraph's space, as in the
   original, where they start 38 px above its last line's foot. */
.bbs-nsteps__intro + .bbs-nsteps__list,
.bbs-nsteps__intro + .bbs-nsteps__btn + .bbs-nsteps__list {
    margin-top: -38px;
}

.bbs-nsteps__item {
    margin: 0;
}

.bbs-nsteps__number {
    display: block;
    color: var(--bbs-nsteps-coral);
    font-size: 98px;
    line-height: 152px;
    font-weight: 700;
}

.bbs-nsteps__text {
    margin: -19px 0 0;
    font-size: 18px;
    line-height: 1.55;
    font-weight: 400;
}

/* Five or more steps share the row. */
@media (min-width: 960px) {
    .bbs-nsteps__list--many {
        grid-template-columns: repeat(var(--bbs-nsteps-count), minmax(0, 1fr));
        column-gap: 28px;
        padding-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bbs-nsteps__btn {
        transition: none;
    }
}

/* ── 1199 and below: the 960 px grid ── */
@media (max-width: 1199px) {
    .bbs-nsteps {
        padding: 18px 0 40px;
    }

    .bbs-nsteps__inner {
        max-width: 960px;
    }

    .bbs-nsteps__title {
        max-width: 662px;
    }

    .bbs-nsteps__intro {
        margin-top: 21px;
    }

    .bbs-nsteps__list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 50px;
        padding-left: 0;
    }

    .bbs-nsteps__intro + .bbs-nsteps__list,
    .bbs-nsteps__intro + .bbs-nsteps__btn + .bbs-nsteps__list {
        margin-top: 11px;
    }

    .bbs-nsteps__text {
        margin-top: -25px;
    }
}

/* ── 959 and below: two to a row, centred, the button under them ── */
@media (max-width: 959px) {
    .bbs-nsteps {
        padding: 14px 0 31px;
    }

    .bbs-nsteps__inner {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        max-width: 660px;
    }

    .bbs-nsteps__title {
        max-width: 592px;
        font-size: 37px;
        text-align: center;
    }

    .bbs-nsteps__intro {
        justify-self: stretch;
        margin-top: 10px;
    }

    .bbs-nsteps__title,
    .bbs-nsteps__btn,
    .bbs-nsteps__intro,
    .bbs-nsteps__list {
        grid-column: 1;
        grid-row: auto;
    }

    .bbs-nsteps__btn {
        order: 1;
        margin-top: 35px;
    }

    .bbs-nsteps__list,
    .bbs-nsteps__list--many {
        grid-template-columns: repeat(2, minmax(0, 260px));
        justify-content: center;
        column-gap: 70px;
        row-gap: 0;
        text-align: center;
    }

    .bbs-nsteps__intro + .bbs-nsteps__list,
    .bbs-nsteps__intro + .bbs-nsteps__btn + .bbs-nsteps__list {
        margin-top: -8px;
    }

    .bbs-nsteps__text {
        margin-top: -9px;
    }
}

/* ── 639 and below: the 480 px grid ── */
@media (max-width: 639px) {
    .bbs-nsteps {
        padding: 27px 0 22px;
    }

    .bbs-nsteps__inner {
        max-width: 500px;
        padding: 0 10px;
    }

    .bbs-nsteps__title {
        font-size: 34px;
    }

    .bbs-nsteps__list,
    .bbs-nsteps__list--many {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 25px;
    }

    .bbs-nsteps__text {
        margin-top: -14px;
    }
}

/* ── 479 and below: one to a row, the number beside the text ── */
@media (max-width: 479px) {
    .bbs-nsteps {
        padding: 19px 0 29px;
    }

    .bbs-nsteps__title {
        font-size: 25px;
    }

    .bbs-nsteps__intro {
        margin-top: 14px;
    }

    .bbs-nsteps__btn {
        margin-top: 30px;
    }

    .bbs-nsteps__list,
    .bbs-nsteps__list--many {
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        row-gap: 14px;
        padding-left: 2px;
        text-align: left;
    }

    .bbs-nsteps__intro + .bbs-nsteps__list,
    .bbs-nsteps__intro + .bbs-nsteps__btn + .bbs-nsteps__list {
        margin-top: 7px;
    }

    .bbs-nsteps__item {
        display: grid;
        grid-template-columns: 49px minmax(0, 1fr);
        align-items: start;
    }

    .bbs-nsteps__number {
        font-size: 68px;
        line-height: 105px;
    }

    .bbs-nsteps__text {
        margin-top: 21px;
        font-size: 17px;
    }
}

/*
 * On a course page (bebestschool.com/italiano-course/italiano-beginner,
 * rec871640134): a 460 px band; the heading 40 / 50 px 49 px down; the
 * numbers 31 px under it, at 44, 335, 636 and 927 px on the grid; the texts
 * 208, 218, 208 and 228 px wide.
 */
.bbs-nsteps.bbs-nsteps--course {
    padding: 49px 0 58px;
}

@media (min-width: 960px) {
    .bbs-nsteps--course .bbs-nsteps__title {
        line-height: 50px;
    }
}

.bbs-nsteps--course .bbs-nsteps__list {
    grid-template-columns: 291px 301px 291px 228px;
    column-gap: 0;
    margin-top: 31px;
}

.bbs-nsteps--course .bbs-nsteps__item:nth-child(1) .bbs-nsteps__text,
.bbs-nsteps--course .bbs-nsteps__item:nth-child(3) .bbs-nsteps__text {
    max-width: 208px;
}

.bbs-nsteps--course .bbs-nsteps__item:nth-child(2) .bbs-nsteps__text {
    max-width: 218px;
}

@media (max-width: 1199px) {
    .bbs-nsteps--course .bbs-nsteps__list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 20px;
    }
}

@media (max-width: 959px) {
    .bbs-nsteps--course .bbs-nsteps__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .bbs-nsteps--course .bbs-nsteps__list {
        grid-template-columns: minmax(0, 1fr);
    }
}


/*
 * "--five" on a course page (bebestschool.com/korporativna-italijska,
 * rec555152922): five steps at 20, 256, 482, 712 and 940 px on the grid, the
 * heading 60 px down, the numbers 42 px under it.
 */
@media (min-width: 1200px) {
    .bbs-nsteps.bbs-nsteps--five {
        padding: 60px 0 80px;
    }

    .bbs-nsteps--five .bbs-nsteps__title {
        line-height: 50px;
    }

    .bbs-nsteps--five .bbs-nsteps__list {
        grid-template-columns: 236px 226px 230px 228px 240px;
        padding-left: 0;
        column-gap: 0;
        margin-top: 42px;
    }

    .bbs-nsteps--five .bbs-nsteps__text {
        line-height: 28px;
    }

    .bbs-nsteps--five .bbs-nsteps__item:nth-child(1) .bbs-nsteps__text,
    .bbs-nsteps--five .bbs-nsteps__item:nth-child(3) .bbs-nsteps__text { max-width: 208px; }
    .bbs-nsteps--five .bbs-nsteps__item:nth-child(2) .bbs-nsteps__text { max-width: 190px; }
    .bbs-nsteps--five .bbs-nsteps__item:nth-child(4) .bbs-nsteps__text { max-width: 194px; }
    .bbs-nsteps--five .bbs-nsteps__item:nth-child(5) .bbs-nsteps__text { max-width: 228px; }
}

/*
 * A course page's band with a paragraph under the heading (the Russian
 * /italiano-course/italiano-beginner, rec673214809): the heading 16 px down,
 * the paragraph 859 px wide 16 px under it, the button 52 px below the
 * heading's top, the numbers rising 15 px into the paragraph.
 */
@media (min-width: 1200px) {
    .bbs-nsteps.bbs-nsteps--course:has(.bbs-nsteps__intro) {
        padding-top: 16px;
    }

    .bbs-nsteps--course:has(.bbs-nsteps__intro) .bbs-nsteps__intro {
        grid-column: 1;
        grid-row: 2;
        max-width: 859px;
        margin: 16px 0 0 2px;
        line-height: 31px;
    }

    .bbs-nsteps--course:has(.bbs-nsteps__intro) .bbs-nsteps__btn {
        grid-row: 1 / span 2;
        align-self: start;
        margin-top: 52px;
    }

    .bbs-nsteps--course .bbs-nsteps__intro + .bbs-nsteps__btn + .bbs-nsteps__list,
    .bbs-nsteps--course .bbs-nsteps__intro + .bbs-nsteps__list {
        grid-template-columns: 291px 296px 289px 228px;
        margin-top: -15px;
        padding-left: 32px;
    }

    .bbs-nsteps--course:has(.bbs-nsteps__intro) .bbs-nsteps__item:nth-child(1) .bbs-nsteps__text { max-width: 213px; }
    .bbs-nsteps--course:has(.bbs-nsteps__intro) .bbs-nsteps__item:nth-child(3) .bbs-nsteps__text { max-width: 211px; }
    .bbs-nsteps--course:has(.bbs-nsteps__intro) .bbs-nsteps__item:nth-child(4) .bbs-nsteps__text { max-width: 219px; }
}
