/**
 * Site footer.
 *
 * Values mirror the Tilda original (bebestschool.com, record rec531924874): a
 * 270 px #f66746 band on the 1200 px grid with a 120 px logo at 46 px, link
 * columns at 200, 359 and 516 px with the address under the last two, the
 * sales contacts at 666 px and the line about the school at 974 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: 30px 0 20px;
    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,
.bbs-footer a:visited {
    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: 154px 466px 308px minmax(0, 1fr);
    grid-template-areas:
        "logo nav contacts about"
        "legal legal legal legal";
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 0 46px;
}

/* ── Logo ── */
.bbs-footer__logo {
    grid-area: logo;
    display: block;
    width: 120px;
    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, the address under the second and third ── */
.bbs-footer__nav {
    grid-area: nav;
    display: grid;
    grid-template-columns: 159px 157px 150px;
    align-items: start;
}

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

.bbs-footer__menu li {
    margin: 0;
    line-height: 25px;
}

/* The first column is the long one; the address sits beside its lower half. */
.bbs-footer__nav--3 .bbs-footer__menu:first-child,
.bbs-footer__nav--2 .bbs-footer__menu:first-child {
    grid-row: 1 / span 2;
}

.bbs-footer__address {
    grid-column: 2 / -1;
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.55;
}

.bbs-footer__nav--1 .bbs-footer__address,
.bbs-footer__nav--0 .bbs-footer__address {
    grid-column: 1 / -1;
}

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

.bbs-footer__label,
.bbs-footer__phone,
.bbs-footer__email {
    line-height: 20px;
}

.bbs-footer__phone,
.bbs-footer__email {
    margin-top: 5px;
}

.bbs-footer__icons {
    display: flex;
    gap: 10px;
    margin-top: 39px;
}

.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%;
}

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

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

.bbs-footer__copyright {
    margin-top: 15px;
    line-height: 20px;
}

.bbs-footer__about .bbs-footer__icons {
    gap: 8px;
    margin: 29px 0 0 -6px;
}

/* ── Legal links: centred on the page, not on the columns ── */
.bbs-footer__bottom {
    grid-area: legal;
    margin: 25px 0 0 -46px;
}

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

.bbs-footer__legal li {
    min-width: 125px;
    margin: 0;
    text-align: center;
}

.bbs-footer .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;
        max-width: 960px;
        padding: 0 20px;
    }

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

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

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

    .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;
    }

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

    .bbs-footer__nav--3 .bbs-footer__menu:first-child,
    .bbs-footer__nav--2 .bbs-footer__menu:first-child {
        grid-row: auto;
    }

    .bbs-footer__address,
    .bbs-footer__nav--1 .bbs-footer__address,
    .bbs-footer__nav--0 .bbs-footer__address {
        grid-column: 1 / -1;
        margin-top: 16px;
    }

    .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: 20px;
        padding: 0 16px;
    }

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

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

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

    .bbs-footer__icons,
    .bbs-footer__about .bbs-footer__icons {
        margin: 16px 0 0;
    }

    .bbs-footer__nav {
        grid-template-columns: repeat(2, minmax(0, 160px));
        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 {
        break-inside: avoid;
    }

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