/**
 * A blog post.
 *
 * Values mirror the Tilda original (bebestschool.kz/blog/fundae): a 575 px
 * cover with a colour background and a #eeeeee pill 1062 × 360 rounded 150 px
 * holding the title in 60 px bold; under it, in 18 px #c7c7c7, the author's
 * 50 px photo, name and 14 px role, the date in the middle and the reading
 * time on the right; then the text across the 1160 px grid — 20 px at 31 px,
 * headings in #1cb65a, 30 px at 47 px; the table of contents in coral bold;
 * grey #f5f5f5 quote boxes 880 px wide in bold italic; tables with a green
 * header and green and grey rows. Phones: an 18 px title on a 50 px pill,
 * the author centred over the date and time.
 */

.bbs-post {
    --bbs-post-green: #1cb65a;
    --bbs-post-coral: #f66746;
    --bbs-post-grey: #c7c7c7;

    color: #000000;
    font-family: var(--bbs-font, 'ApercuPro', Arial, sans-serif);
}

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

/* ── Cover ──
   Most articles: the title in 70 px bold at 88 px, 1064 px wide, straight
   on the picture, in its own colour, the cover 395 px or more. With
   "bbs-post__hero--pill": a 575 px cover and the title in 60 px on a grey
   pill, as on bebestschool.kz/blog/fundae. */
.bbs-post__hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 395px;
    padding: 60px 20px;
    background-color: #ffffff;
    background-position: center;
    background-size: cover;
}

.bbs-post__pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1064px;
}

.bbs-post__title {
    max-width: 1064px;
    margin: 0;
    color: #000000;
    font-size: 70px;
    line-height: 88px;
    font-weight: 700;
    text-align: center;
}

/* "Размер обложки": "tall" a 545 px cover, as on
   bebestschool.kz/exercises/upragnenia-na-datu; "tall-small" also the title
   on one line in 49 px at 61 px, as on /exercises/upragnenia-na-past-perfect. */
.bbs-post__hero--tall,
.bbs-post__hero--tall-small {
    min-height: 545px;
}

.bbs-post__hero--tall-small .bbs-post__title {
    max-width: 1100px;
    font-size: 49px;
    line-height: 61px;
}

.bbs-post__hero--pill {
    min-height: 575px;
    padding: 89px 20px 126px;
    background-color: #eeeeee;
}

.bbs-post__hero--pill .bbs-post__pill {
    max-width: 1062px;
    min-height: 360px;
    padding: 40px 0;
    border-radius: 150px;
    background: #eeeeee;
}

.bbs-post__hero--pill .bbs-post__title {
    max-width: 1110px;
    font-size: 60px;
    line-height: 60px;
}

/* The title runs 24 px past the pill on a wide screen, as the original's. */
@media (min-width: 1200px) {
    .bbs-post__hero--pill .bbs-post__title {
        margin: 0 -24px;
    }
}

/* ── Author, date, reading time ── */
.bbs-post__meta {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    max-width: 1160px;
    margin: 50px auto 0;
    padding: 0 20px;
    color: var(--bbs-post-grey);
    font-size: 18px;
    line-height: 28px;
}

.bbs-post__author {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-left: 20px;
}

.bbs-post__avatar {
    flex: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.bbs-post__who {
    display: flex;
    flex-direction: column;
}

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

a.bbs-post__name:hover {
    color: var(--bbs-post-green);
}

.bbs-post__role {
    font-size: 14px;
    line-height: 22px;
}

.bbs-post__time {
    justify-self: end;
    padding-right: 10px;
}

/* ── Text ── */
.bbs-post__content {
    max-width: 1200px;
    margin: 84px auto 0;
    padding: 0 20px 40px;
    font-size: 20px;
    line-height: 31px;
    overflow-wrap: break-word;
    hyphens: auto;
}

.bbs-post__content > * {
    margin-top: 0;
    margin-bottom: 0;
}

.bbs-post__content > * + * {
    margin-top: 20px;
}

.bbs-post__content > .alignfull {
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
}

.bbs-post__content a:not([class]) {
    color: var(--bbs-post-green);
}

/* The article's own headings — not those inside blocks such as the price
   plans or the answers, which keep their own. */
.bbs-post__content > h2,
.bbs-post__content > h3,
.bbs-post__content > h4 {
    color: var(--bbs-post-green);
    font-weight: 700;
    scroll-margin-top: 100px;
}

.bbs-post__content > h2 {
    font-size: 30px;
    line-height: 47px;
}

.bbs-post__content > * + h2 {
    margin-top: 40px;
}

.bbs-post__content > h3 {
    font-size: 20px;
    line-height: 31px;
}

.bbs-post__content > * + h3 {
    margin-top: 30px;
}

.bbs-post__content > h2 + *,
.bbs-post__content > h3 + * {
    margin-top: 20px;
}

.bbs-post__content ul,
.bbs-post__content ol {
    padding-left: 20px;
}

.bbs-post__content img {
    max-width: 100%;
    height: auto;
}

.bbs-post__content .wp-block-image {
    text-align: center;
}

.bbs-post__content .wp-block-image img {
    display: inline-block;
}

.bbs-post__content .bbs-post-accent {
    color: var(--bbs-post-green);
    font-size: 22px;
    line-height: 28px;
    font-weight: 700;
    text-align: center;
}

/* The article's own heading under the author: black, centred, 40 px. */
.bbs-post__content h2.bbs-post-lead {
    color: #000000;
    font-size: 40px;
    line-height: 50px;
    text-align: center;
}

.bbs-post__content h2.bbs-heading--dark,
.bbs-post__content h3.bbs-heading--dark {
    color: #000000;
}

/* A button between paragraphs: a 250 × 45 green pill, 16 px bold, centred,
   as on bebestschool.kz/exercises/* ("Записаться на пробный урок"). */
.bbs-post__content .bbs-post-button {
    text-align: center;
}

.bbs-post__content .bbs-post-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
    min-height: 45px;
    padding: 0 20px;
    border-radius: 20px;
    background: var(--bbs-post-green);
    color: #ffffff;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.bbs-post__content .bbs-post-button__link:hover,
.bbs-post__content .bbs-post-button__link:focus-visible {
    opacity: 0.85;
}

/* Table of contents */
.bbs-post__content .bbs-toc-title {
    color: #000000;
    font-size: 30px;
    line-height: 47px;
    font-weight: 700;
}

.bbs-post__content .bbs-toc {
    margin-top: 28px;
    color: var(--bbs-post-coral);
    font-weight: 300;
}

.bbs-post__content .bbs-toc a:not([class]) {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.bbs-post__content .bbs-toc a:hover {
    text-decoration: underline;
}

/* Quote box */
.bbs-post__content .wp-block-quote {
    max-width: 880px;
    margin: 90px auto;
    padding: 60px;
    border: 0;
    background: #f5f5f5;
    font-size: 20px;
    line-height: 31px;
    font-weight: 700;
    font-style: italic;
    text-align: center;
}

.bbs-post__content .wp-block-quote p {
    margin: 0;
}

.bbs-post__content .wp-block-quote p + p {
    margin-top: 31px;
}

/* "bbs-quote--plain": the grey box with plain 20 px light text, left
   aligned, as on bebestschool.kz/exercises/* (t248). */
.bbs-post__content .wp-block-quote.bbs-quote--plain {
    font-weight: 300;
    font-style: normal;
    text-align: left;
}

/* "bbs-quote--line": 18 px light text 760 px wide behind a 3 px black bar.
   "bbs-quote--impact": 28 px light text at 42 px, centred, across the grid.
   Their links in coral bold italic. */
.bbs-post__content .wp-block-quote.bbs-quote--line {
    max-width: 760px;
    margin: 60px auto;
    padding: 0 0 0 24px;
    border-left: 3px solid #000000;
    background: none;
    font-size: 18px;
    line-height: 28px;
    font-weight: 300;
    font-style: normal;
    text-align: left;
}

.bbs-post__content .wp-block-quote.bbs-quote--impact {
    max-width: none;
    margin: 60px 0;
    padding: 0;
    background: none;
    font-size: 28px;
    line-height: 42px;
    font-weight: 300;
    font-style: normal;
}

.bbs-post__content .wp-block-quote a {
    color: var(--bbs-post-coral);
    font-weight: 700;
    font-style: italic;
    text-decoration: none;
}

@media (max-width: 639px) {
    .bbs-post__content .wp-block-quote.bbs-quote--impact {
        font-size: 20px;
        line-height: 30px;
    }

    .bbs-post__content .wp-block-quote.bbs-quote--line {
        margin: 40px 0;
        font-size: 16px;
        line-height: 25px;
    }
}

/* Table */
.bbs-post__content .wp-block-table {
    max-width: 960px;
    margin: 90px auto 120px;
    overflow-x: auto;
}

.bbs-post__content .wp-block-table thead {
    border-bottom: 0;
}

.bbs-post__content .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
    line-height: 1.55;
    font-weight: 300;
}

.bbs-post__content .wp-block-table th,
.bbs-post__content .wp-block-table td {
    padding: 20px;
    border: 0;
    text-align: left;
    vertical-align: top;
}

.bbs-post__content .wp-block-table thead th,
.bbs-post__content .wp-block-table thead td {
    background: var(--bbs-post-green);
    font-weight: 600;
}

.bbs-post__content .wp-block-table tbody tr:nth-child(odd) td {
    background: #eeeeee;
}

.bbs-post__content .wp-block-table tbody tr:nth-child(even) td {
    background: var(--bbs-post-green);
}

/* Coral tables, as many of the original articles': a #f66746 header in
   white, rows white and #fff0ed in #4d4c4c, centred, a coral line under
   each, across the grid. "bbs-table--coral-dark": the header type black.
   "bbs-table--plain": 960 px, a bold black header over a black line, rows
   white and #eeeeee in #4d4c4c with #d9d9d9 lines, on the left. */
.bbs-post__content .wp-block-table.bbs-table--coral {
    max-width: none;
}

.bbs-post__content .bbs-table--coral th,
.bbs-post__content .bbs-table--coral td {
    text-align: center;
    vertical-align: middle;
}

.bbs-post__content .bbs-table--coral thead th {
    border-bottom: 1px solid #cccccc;
    background: #f66746;
    color: #ffffff;
}

.bbs-post__content .bbs-table--coral-dark thead th {
    color: #000000;
}

.bbs-post__content .bbs-table--coral tbody td {
    border-bottom: 1px solid #f66746;
    color: #4d4c4c;
}

.bbs-post__content .bbs-table--coral tbody tr:nth-child(odd) td {
    background: #fefefe;
}

.bbs-post__content .bbs-table--coral tbody tr:nth-child(even) td {
    background: #fff0ed;
}

.bbs-post__content .bbs-table--plain thead th {
    border-bottom: 1px solid #000000;
    background: transparent;
    color: #000000;
}

.bbs-post__content .bbs-table--plain tbody td {
    border-bottom: 1px solid #d9d9d9;
    color: #4d4c4c;
}

.bbs-post__content .bbs-table--plain tbody tr:nth-child(odd) td {
    background: #ffffff;
}

.bbs-post__content .bbs-table--plain tbody tr:nth-child(even) td {
    background: #eeeeee;
}

.bbs-post__content .bbs-pcta,
.bbs-post__content .bbs-pricing {
    margin-top: 40px;
    margin-bottom: 40px;
}

/* ── Related posts ── */
.bbs-blog--related {
    padding: 70px 0 70px;
}

.bbs-blog--related .bbs-blog__title {
    font-size: 24px;
    line-height: 1.2;
}

.bbs-blog--related .bbs-blog__excerpt,
.bbs-blog--related .bbs-blog__author {
    font-size: 16px;
    line-height: 1.55;
}

.bbs-blog--related .bbs-blog__author {
    display: none;
}

/* ── Tablets ── */
@media (max-width: 959px) {
    .bbs-post__hero {
        min-height: 300px;
        padding: 40px 20px;
    }

    .bbs-post__title {
        font-size: 48px;
        line-height: 58px;
    }

    .bbs-post__hero--pill {
        min-height: 400px;
        padding: 60px 20px;
    }

    .bbs-post__hero--pill .bbs-post__pill {
        min-height: 260px;
        border-radius: 100px;
    }

    .bbs-post__hero--pill .bbs-post__title {
        padding: 0 30px;
        font-size: 40px;
        line-height: 44px;
    }

    .bbs-blog--related .bbs-blog__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Phones ── */
@media (max-width: 639px) {
    .bbs-post__hero {
        min-height: 200px;
        padding: 30px 20px;
    }

    .bbs-post__title {
        font-size: 30px;
        line-height: 38px;
        overflow-wrap: break-word;
    }

    .bbs-post__hero--pill {
        min-height: 225px;
        padding: 46px 39px 56px;
    }

    .bbs-post__hero--pill .bbs-post__pill {
        min-height: 108px;
        padding: 18px 10px;
        border-radius: 50px;
    }

    .bbs-post__hero--pill .bbs-post__title {
        padding: 0;
        font-size: 18px;
        line-height: 18px;
    }

    .bbs-post__content h2.bbs-post-lead {
        font-size: 26px;
        line-height: 34px;
    }

    .bbs-post__meta {
        grid-template-columns: 1fr 1fr;
        row-gap: 20px;
        margin-top: 40px;
    }

    .bbs-post__author {
        grid-column: 1 / -1;
        justify-content: center;
        gap: 10px;
        padding: 0;
    }

    .bbs-post__date {
        padding-left: 18px;
    }

    .bbs-post__time {
        padding-right: 7px;
    }

    .bbs-post__content {
        margin-top: 50px;
        padding: 0 28px 30px;
    }

    .bbs-post__content > h2 {
        font-size: 26px;
        line-height: 34px;
    }

    .bbs-post__content .bbs-toc {
        line-height: 29px;
    }

    .bbs-post__content .wp-block-quote {
        margin: 60px -28px;
        padding: 20px;
        font-size: 16px;
        line-height: 23px;
    }

    .bbs-post__content .wp-block-table {
        margin: 60px 0;
    }

    .bbs-post__content .wp-block-table td,
    .bbs-post__content .wp-block-table th {
        overflow-wrap: anywhere;
    }

    .bbs-post__content .wp-block-table table {
        font-size: 15px;
    }

    .bbs-post__content .wp-block-table th,
    .bbs-post__content .wp-block-table td {
        padding: 12px;
    }
}
