/**
 * Blog list.
 *
 * Values mirror the Tilda original (bebestschool.com/blog, rec514655507,
 * rec514496296 and the T649 lists under it): the 62 / 90 px bold "БЛОГ" to
 * the left 60 px under the crumbs; a 960 px row of five equal 18 px tabs with
 * a 1 px #1cb65a edge rounded 50 px at its ends, the open one filled green in
 * white 600; 45 px lower the articles, three to a row across the 1160 px
 * grid in TildaSans — a square picture, the date Bold 14 px #c7c7c7 spaced
 * 2.5 px, the name Bold 32 / 1.17, the excerpt 20 / 31 px, the author in
 * #c7c7c7. Below 960 px the row of tabs
 * turns into a green drop-down rounded 50 px, and the articles stand two to
 * a row; on phones, one.
 */

.bbs-blog {
    --bbs-blog-green: #1cb65a;
    --bbs-blog-grey: #c7c7c7;
    --bbs-blog-gap: 40px;
    --bbs-blog-cols: 3;

    padding: 60px 0 90px;
    background: #ffffff;
    color: #000000;
    font-family: var(--bbs-font, 'ApercuPro', Arial, sans-serif);
}

.bbs-blog__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.bbs-blog__title {
    margin: 0 0 70px;
    color: inherit;
    font-size: 62px;
    line-height: 90px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ── Tabs ── */
.bbs-blog__nav {
    max-width: 960px;
    margin: 0 auto 45px;
}

.bbs-blog__tabs {
    display: flex;
}

.bbs-blog__tab {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin-left: -1px;
    padding: 14px 16px;
    border: 1px solid var(--bbs-blog-green);
    background: #ffffff;
    color: #000000;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.bbs-blog__tab:first-child {
    margin-left: 0;
    border-radius: 50px 0 0 50px;
}

.bbs-blog__tab:last-child {
    border-radius: 0 50px 50px 0;
}

.bbs-blog__tab:hover {
    background: #eefaf2;
    color: #000000;
}

.bbs-blog__tab[aria-selected="true"] {
    position: relative;
    z-index: 1;
    background: var(--bbs-blog-green);
    color: #ffffff;
    font-weight: 600;
}

.bbs-blog__tab:focus-visible,
.bbs-blog__select:focus-visible {
    position: relative;
    z-index: 2;
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* The drop-down only once the script can act on it. */
.bbs-blog__select-wrap {
    display: none;
    position: relative;
}

.bbs-blog__select-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 22px;
    border-style: solid;
    border-width: 6px 5px 0;
    border-color: #ffffff transparent transparent;
    transform: translateY(-50%);
    pointer-events: none;
}

.bbs-blog__select {
    display: block;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 14px 48px 14px 22px;
    border: 1px solid var(--bbs-blog-green);
    border-radius: 50px;
    background: var(--bbs-blog-green);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
}

.bbs-blog__select option {
    background: #ffffff;
    color: #000000;
    font-weight: 400;
}

/* ── Articles: one tab's at a time; until the script runs, the first ── */
.bbs-blog__panel[hidden] {
    display: none;
}

.bbs-blog__list {
    font-family: 'TildaSans', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-wrap: wrap;
    gap: 90px var(--bbs-blog-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bbs-blog__card {
    display: flex;
    flex: 0 0 calc((100% - var(--bbs-blog-gap) * (var(--bbs-blog-cols) - 1)) / var(--bbs-blog-cols));
    flex-direction: column;
    min-width: 0;
    margin: 0;
}

.bbs-blog__media {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f0f0;
}

.bbs-blog__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.bbs-blog__card:hover .bbs-blog__img {
    transform: scale(1.03);
}

.bbs-blog__date {
    display: block;
    margin-top: 15px;
    color: var(--bbs-blog-grey);
    font-size: 14px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: 2.5px;
}

.bbs-blog__name {
    margin: 5px 0 20px;
    color: inherit;
    font-size: 32px;
    line-height: 1.17;
    font-weight: 700;
    overflow-wrap: break-word;
}

.bbs-blog__name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.bbs-blog__name a:hover,
.bbs-blog__name a:focus-visible {
    color: var(--bbs-blog-green);
}

.bbs-blog__excerpt,
.bbs-blog__author {
    margin: 0;
    font-size: 20px;
    line-height: 31px;
    overflow-wrap: break-word;
}

.bbs-blog__author {
    margin-top: 31px;
    color: var(--bbs-blog-grey);
}

.bbs-blog__empty {
    margin: 0;
    font-size: 20px;
    line-height: 1.55;
}

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

    .bbs-blog__title {
        margin-bottom: 40px;
    }

    .bbs-blog__list {
        row-gap: 60px;
    }

    .bbs-blog__inner {
        padding: 0 40px;
    }

    .bbs-blog__title {
        font-size: 56px;
        line-height: 1.3;
    }

    .bbs-blog__name {
        font-size: 28px;
    }

    .bbs-blog__excerpt,
    .bbs-blog__author {
        font-size: 18px;
    }
}

/* ── 959 and below: a drop-down, two to a row ── */
@media (max-width: 959px) {
    .bbs-blog {
        --bbs-blog-cols: 2;
        --bbs-blog-gap: 24px;

        padding: 40px 0 70px;
    }

    .bbs-blog__inner {
        max-width: 720px;
        padding: 0 20px;
    }

    .bbs-blog__title {
        font-size: 48px;
    }

    .bbs-blog.is-ready .bbs-blog__tabs {
        display: none;
    }

    .bbs-blog.is-ready .bbs-blog__select-wrap {
        display: block;
    }

    /* Without the script the tabs stay links, in a row that scrolls. */
    .bbs-blog:not(.is-ready) .bbs-blog__tabs {
        overflow-x: auto;
    }

    .bbs-blog:not(.is-ready) .bbs-blog__tab {
        flex: 0 0 auto;
    }

    .bbs-blog__nav {
        margin-bottom: 36px;
    }

    .bbs-blog__name {
        font-size: 24px;
    }

    .bbs-blog__excerpt,
    .bbs-blog__author {
        font-size: 16px;
    }
}

/* ── 639 and below: one to a row ── */
@media (max-width: 639px) {
    .bbs-blog {
        --bbs-blog-cols: 1;
    }

    .bbs-blog__inner {
        max-width: 420px;
    }

    .bbs-blog__title {
        margin-bottom: 24px;
        font-size: 40px;
    }

    .bbs-blog__list {
        row-gap: 48px;
    }

    .bbs-blog__date {
        margin-top: 16px;
    }

    .bbs-blog__name {
        margin-bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bbs-blog__tab,
    .bbs-blog__name a,
    .bbs-blog__img {
        transition: none;
    }

    .bbs-blog__card:hover .bbs-blog__img {
        transform: none;
    }
}
