/**
 * Site footer.
 *
 * Values mirror the Tilda original (bebestschool.kz, record rec554936686): a
 * 290 px #f66746 band on the 1200 px grid with a 120 px logo at 46 px, link
 * columns from 217 px, the sales contacts at 726 px and the line about the
 * school at 964 px, all white 16 px type, and 13 px underlined legal links
 * centred along the bottom. Below 960 px the columns stack, centred.
 */

.bbs-footer {
    --bbs-footer-font: 'ApercuPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --bbs-footer-bg: #f66746;
    --bbs-footer-ink: #ffffff;

    margin: 0;
    padding: 26px 0 41px;
    background: var(--bbs-footer-bg);
    color: var(--bbs-footer-ink);
    font-family: var(--bbs-footer-font);
    font-size: 16px;
    line-height: 1.55;
}

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

.bbs-footer a {
    color: inherit;
    text-decoration: none;
}

.bbs-footer a:hover,
.bbs-footer a:focus-visible {
    color: inherit;
    text-decoration: underline;
}

.bbs-footer a:focus-visible {
    outline: 2px solid var(--bbs-footer-ink);
    outline-offset: 2px;
}

.bbs-footer p {
    margin: 0;
}

/* The original's columns, at its places on the grid. */
.bbs-footer__inner {
    display: grid;
    grid-template-columns: 171px 509px 238px minmax(0, 1fr);
    grid-template-areas:
        "logo nav contacts about"
        "legal legal legal legal";
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    /* No right padding: as in the original, the last column's text may run
       a little past the grid. */
    padding: 0 0 0 46px;
}

/* ── Logo ── */
.bbs-footer__logo {
    grid-area: logo;
    display: block;
    width: 120px;
    margin-top: 4px;
    line-height: 0;
}

.bbs-footer__logo:hover,
.bbs-footer__logo:focus-visible {
    text-decoration: none;
}

.bbs-footer__logo-img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Link columns ── */
.bbs-footer__nav {
    grid-area: nav;
    display: grid;
    grid-template-columns: 175px 160px 174px;
}

.bbs-footer__menu,
.bbs-footer__legal {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bbs-footer__menu li {
    margin: 0 0 7px;
}

/* ── Contacts ── */
.bbs-footer__contacts {
    grid-area: contacts;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 4px;
}

.bbs-footer__label {
    line-height: 1.25;
}

.bbs-footer__phone {
    margin-top: 8px;
    font-size: 20px;
    line-height: 1.2;
}

.bbs-footer__note {
    line-height: 1.25;
}

.bbs-footer__icons {
    display: flex;
    gap: 5px;
    margin-top: 12px;
}

.bbs-footer__icon {
    display: block;
    width: 31px;
    height: 31px;
    line-height: 0;
    transition: transform 0.2s ease-in-out;
}

.bbs-footer__icon:hover,
.bbs-footer__icon:focus-visible {
    transform: scale(1.1);
}

.bbs-footer__icon img {
    display: block;
    width: 100%;
    height: 100%;
}

.bbs-footer__email {
    margin-top: 15px;
    line-height: 1.25;
}

/* ── About ── */
.bbs-footer__about {
    grid-area: about;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 4px;
}

.bbs-footer__text {
    max-width: 250px;
    font-size: 15px;
    line-height: 1.25;
}

.bbs-footer__copyright {
    line-height: 1.25;
}

.bbs-footer__about .bbs-footer__icons {
    margin-top: 8px;
    gap: 8px;
}

/* ── Legal links ── */
/* Level with the last language in the first column, as in the original — the
   two sit side by side, the links in the middle and the column on the left. */
.bbs-footer__bottom {
    grid-area: legal;
    margin: -22px 0 0 -26px;
}

.bbs-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 40px;
    font-size: 13px;
    line-height: 1.55;
}

.bbs-footer__legal a {
    text-decoration: underline;
}

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

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

/* ── 1199 and below: the 960 px grid ── */
@media (max-width: 1199px) {
    .bbs-footer__inner {
        grid-template-columns: 140px minmax(0, 1fr) 200px 200px;
        column-gap: 16px;
        padding-left: 20px;
    }

    .bbs-footer__nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 12px;
    }

    .bbs-footer__bottom {
        margin-left: 0;
    }
}

/* ── 959 and below: stacked and centred ── */
@media (max-width: 959px) {
    .bbs-footer {
        padding: 30px 0 28px;
        text-align: center;
    }

    .bbs-footer__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "nav nav nav"
            "logo about contacts"
            "legal legal legal";
        gap: 28px 24px;
        max-width: 700px;
        padding: 0 20px;
    }

    .bbs-footer__nav {
        grid-template-columns: repeat(3, minmax(0, 170px));
        justify-content: center;
    }

    .bbs-footer__contacts {
        align-items: flex-start;
        padding-top: 0;
        text-align: left;
    }

    .bbs-footer__logo {
        margin-top: 0;
    }

    .bbs-footer__about {
        text-align: left;
    }

    .bbs-footer__bottom {
        margin-top: 0;
    }
}

/* ── 639 and below: one column ── */
@media (max-width: 639px) {
    .bbs-footer__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "logo"
            "about"
            "contacts"
            "nav"
            "legal";
        gap: 18px;
        padding: 0 16px;
    }

    .bbs-footer__contacts {
        align-items: center;
        text-align: center;
    }

    .bbs-footer__logo {
        justify-self: center;
        width: 90px;
    }

    .bbs-footer__about {
        align-items: center;
        text-align: center;
    }

    .bbs-footer__text {
        max-width: 280px;
        font-size: 14px;
    }

    .bbs-footer__nav {
        grid-template-columns: repeat(2, minmax(0, 160px));
        justify-content: center;
        gap: 14px 16px;
    }

    /* The first column (the languages) spreads over two, as the original's. */
    .bbs-footer__nav .bbs-footer__menu:first-child {
        grid-column: 1 / -1;
        columns: 2;
        column-gap: 16px;
    }

    .bbs-footer__menu li {
        margin-bottom: 4px;
        break-inside: avoid;
    }

    .bbs-footer__legal {
        gap: 8px 24px;
        font-size: 14px;
    }
}
