/**
 * Text cards block.
 *
 * Values mirror the two Tilda originals on bebestschool.es/en/english/a1:
 *
 *   rec2037316103  the introduction — 20 px/1.55 black, 20 px in from the grid,
 *                  20 px from the top of a 130 px band
 *   rec2036958963  two 580×462 cards 40 px apart with a 56 px radius, a
 *                  61 px/1.55/600 heading 40 px in from the corner, 20 px/1.55
 *                  copy 196 px down, and a 341×55 #ff5c00 button with a 20 px
 *                  radius, 20 px/500 white, centred 46 px under the cards
 *
 * The coral card is white on #ff4e60; the grey one is #f1f1f1 with an #ff5c00
 * heading and #2e2e2e copy.
 */

.bbs-text-cards {
    --bbs-text-cards-font: 'ApercuPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --bbs-text-cards-container: 1200px;
    --bbs-text-cards-gutter: 20px;

    --bbs-text-cards-orange: #ff5c00;
    --bbs-text-cards-orange-hover: #e35100;

    --bbs-text-cards-bg: #ff4e60;
    --bbs-text-cards-title: #ffffff;
    --bbs-text-cards-ink: #ffffff;

    padding: 20px 0 57px;
    background: #ffffff;
    font-family: var(--bbs-text-cards-font);
}

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

.bbs-text-cards__inner {
    max-width: calc(var(--bbs-text-cards-container) + var(--bbs-text-cards-gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--bbs-text-cards-gutter);
}

/* ── Introduction ──
 * 20 px further in than the cards, as the original's text box is. */
.bbs-text-cards__intro {
    padding: 0 20px;
}

.bbs-text-cards__intro p {
    margin: 0 0 1em;
    color: #000000;
    font-size: 20px;
    line-height: 1.55;
    font-weight: 400;
}

.bbs-text-cards__intro p:last-child {
    margin-bottom: 0;
}

/* The introduction's band ends 17 px under its text, the cards start 40 px
   into theirs. */
.bbs-text-cards__intro + .bbs-text-cards__grid {
    margin-top: 57px;
}

/* ── Cards ── */
.bbs-text-cards__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bbs-text-cards__card {
    margin: 0;
    /* The copy boxes on the original run to 20–29 px from the right edge, not
       40: keeping that measure keeps the lines breaking where they did. */
    padding: 40px 20px 49px 40px;
    border-radius: 56px;
    background: var(--bbs-text-cards-bg);
}

.bbs-text-cards__card--coral {
    --bbs-text-cards-bg: #ff4e60;
    --bbs-text-cards-title: #ffffff;
    --bbs-text-cards-ink: #ffffff;
}

.bbs-text-cards__card--grey {
    --bbs-text-cards-bg: #f1f1f1;
    --bbs-text-cards-title: #ff5c00;
    --bbs-text-cards-ink: #2e2e2e;
}

.bbs-text-cards__card--purple {
    --bbs-text-cards-bg: #a40acf;
    --bbs-text-cards-title: #ffffff;
    --bbs-text-cards-ink: #ffffff;
}

.bbs-text-cards__card--orange {
    --bbs-text-cards-bg: #ff5c00;
    --bbs-text-cards-title: #ffffff;
    --bbs-text-cards-ink: #ffffff;
}

.bbs-text-cards__title {
    /* 40 px of card, a 94.5 px line box, then the copy at 196 px. */
    margin: 0 0 62px;
    color: var(--bbs-text-cards-title);
    font-size: 61px;
    line-height: 1.55;
    font-weight: 600;
}

.bbs-text-cards__title strong {
    font-weight: 700;
}

.bbs-text-cards__text p,
.bbs-text-cards__text ul,
.bbs-text-cards__text ol {
    margin: 0 0 1em;
    color: var(--bbs-text-cards-ink);
    font-size: 20px;
    line-height: 1.55;
    font-weight: 400;
}

.bbs-text-cards__text > *:last-child {
    margin-bottom: 0;
}

.bbs-text-cards__text ul,
.bbs-text-cards__text ol {
    padding-left: 1.3em;
}

.bbs-text-cards__text a {
    color: inherit;
}

/* ── Button ── */
.bbs-text-cards__actions {
    display: flex;
    justify-content: center;
    margin-top: 46px;
}

.bbs-text-cards__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 341px;
    min-height: 55px;
    padding: 8px 24px;
    border-radius: 20px;
    background: var(--bbs-text-cards-orange);
    color: #ffffff;
    font-size: 20px;
    line-height: 1.55;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.bbs-text-cards__btn:hover,
.bbs-text-cards__btn:focus-visible {
    background: var(--bbs-text-cards-orange-hover);
    color: #ffffff;
    text-decoration: none;
}

.bbs-text-cards__btn:focus-visible {
    outline: 2px solid var(--bbs-text-cards-orange);
    outline-offset: 3px;
}

/* ── 1199 and below: the 960 grid ── */
@media (max-width: 1199px) {
    .bbs-text-cards__grid {
        gap: 30px;
    }

    .bbs-text-cards__card {
        padding: 40px 20px 45px 30px;
    }

    .bbs-text-cards__title {
        margin-bottom: 50px;
        font-size: 58px;
    }

    .bbs-text-cards__actions {
        margin-top: 45px;
    }

    .bbs-text-cards__btn {
        min-width: 273px;
        min-height: 49px;
    }
}

/* ── 959 and below: the cards stack ── */
@media (max-width: 959px) {
    .bbs-text-cards {
        padding-bottom: 60px;
    }

    .bbs-text-cards__grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }

    .bbs-text-cards__intro + .bbs-text-cards__grid {
        margin-top: 50px;
    }

    .bbs-text-cards__card {
        padding: 40px 27px 45px 30px;
    }

    .bbs-text-cards__actions {
        margin-top: 50px;
    }
}

/* ── 639 and below ── */
@media (max-width: 639px) {
    .bbs-text-cards__grid {
        gap: 40px;
        padding: 0;
    }

    .bbs-text-cards__intro {
        padding: 0;
    }

    .bbs-text-cards__card {
        padding: 40px 15px 40px 25px;
    }

    .bbs-text-cards__title {
        margin-bottom: 20px;
    }

    .bbs-text-cards__intro p,
    .bbs-text-cards__text p,
    .bbs-text-cards__text ul,
    .bbs-text-cards__text ol {
        font-size: 18px;
    }

    .bbs-text-cards__actions {
        margin-top: 38px;
    }

    .bbs-text-cards__btn {
        font-size: 18px;
    }
}

/* ── 479 and below ── */
@media (max-width: 479px) {
    .bbs-text-cards {
        --bbs-text-cards-gutter: 16px;

        padding-bottom: 40px;
    }

    .bbs-text-cards__grid {
        gap: 30px;
    }

    .bbs-text-cards__card {
        padding: 40px 16px 40px 16px;
        border-radius: 40px;
    }

    .bbs-text-cards__title {
        margin-bottom: 17px;
        font-size: 43px;
    }

    .bbs-text-cards__actions {
        margin-top: 22px;
    }

    .bbs-text-cards__btn {
        width: 100%;
        min-width: 0;
        max-width: 250px;
        min-height: 50px;
    }
}

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