/* --------------------------------------------------------------
# Blog post additions
-------------------------------------------------------------- */

.blog-post .post-content {
    overflow-wrap: anywhere;
}

.blog-post .post-content img {
    max-width: 100%;
    height: auto;
}

.blog-post .post-content figure {
    max-width: 100%;
}

.blog-post .post-content iframe {
    max-width: 100%;
}

.blog-post .post-content table {
    width: 100%;
}

.blog-post-footer {
    margin-top: 35px;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #77758b;
}

.blog-share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.blog-share-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #4343a0;
    background: #f7f7fb;
    border: 1px solid #ececf2;
    border-radius: 8px;
}

.blog-share-links a:hover {
    background: #efeff8;
}

.blog-post .post-content .alignright {
    float: right;
    max-width: 46%;
    margin: 0 0 20px 24px;
}

.blog-post .post-content .alignleft {
    float: left;
    max-width: 46%;
    margin: 0 24px 20px 0;
}

.blog-post .post-content .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.blog-post .post-content .caption-text,
.blog-post .post-content figcaption {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.4;
    color: #77758b;
}

.blog-post .post-content::after {
    display: table;
    clear: both;
    content: '';
}

@media screen and (max-width: 640px) {
    .blog-post .post-content .alignright,
    .blog-post .post-content .alignleft {
        float: none;
        max-width: 100%;
        margin: 20px 0;
    }
}


/* Draft preview */

.blog-preview-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 0 18px;
    padding: 12px 18px;
    font-size: 12px;
    line-height: 1.45;
    color: #5b3ca0;
    background: #f4efff;
    border: 1px solid #dfd2ff;
    border-radius: 10px;
}

.blog-preview-banner strong {
    font-weight: 700;
}

.blog-preview-banner span {
    color: #6f6584;
}


/* --------------------------------------------------------------
# Blog post footer layout fix
-------------------------------------------------------------- */

/*
 * У старого шаблона сайта есть общие стили .post-footer / .share.
 * Для блога задаём собственную раскладку с более высокой
 * специфичностью, чтобы эти правила не ломали новый footer.
 */
.blog-post .blog-post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    width: 100%;
    margin-top: 35px;
    padding-top: 28px;
    clear: both;
}

.blog-post .blog-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0;
    flex: 0 1 auto;
}

.blog-post .blog-post-footer .share {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 12px;
    width: auto;
    margin: 0;
    padding: 0;
    float: none;
    text-align: left;
}

.blog-post .blog-post-footer .share > span {
    display: block;
    margin: 0;
    white-space: nowrap;
}

.blog-post .blog-share-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

@media screen and (max-width: 720px) {
    .blog-post .blog-post-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .blog-post .blog-post-footer .share {
        justify-content: flex-start;
    }
}


/* --------------------------------------------------------------
# Automatic table of contents
-------------------------------------------------------------- */

.blog-toc {
    margin: 0 0 34px;
    padding: 22px 24px;
    background: #f7f7fb;
    border: 1px solid #ececf2;
    border-radius: 12px;
}

.blog-toc-title {
    margin-bottom: 14px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: #171a2a;
}

.blog-toc-list,
.blog-toc-sublist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-toc-list {
    counter-reset: blog-toc;
}

.blog-toc-list > li {
    position: relative;
    margin: 9px 0 0;
    padding-left: 0;
}

.blog-toc-list > li:first-child {
    margin-top: 0;
}

.blog-toc a {
    color: #35358f;
    text-decoration: none;
}

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

.blog-toc-sublist {
    margin-top: 7px;
    padding-left: 22px;
}

.blog-toc-sublist li {
    position: relative;
    margin-top: 6px;
}

.blog-toc-sublist li::before {
    position: absolute;
    top: .75em;
    left: -14px;
    width: 5px;
    height: 5px;
    content: '';
    background: #a5a5c9;
    border-radius: 50%;
    transform: translateY(-50%);
}

.blog-post .post-content h2[id],
.blog-post .post-content h3[id] {
    scroll-margin-top: 110px;
}

@media screen and (max-width: 640px) {
    .blog-toc {
        margin-bottom: 28px;
        padding: 18px;
    }

    .blog-toc-title {
        font-size: 17px;
    }

    .blog-toc-sublist {
        padding-left: 18px;
    }
}

/* TOC: plain links without automatic list markers. */
.blog-post .post-content .blog-toc ol {
    list-style: none;
    counter-reset: none;
    padding-left: 0;
}

.blog-post .post-content .blog-toc li {
    list-style: none;
    counter-increment: none;
    padding-left: 0;
}

.blog-post .post-content .blog-toc li::before,
.blog-post .post-content .blog-toc li::after {
    content: none;
    display: none;
}

.blog-post .post-content .blog-toc li::marker {
    content: '';
}

.blog-post .post-content .blog-toc .blog-toc-sublist {
    padding-left: 20px;
}
