/*
 * Страница статьи. Каждый селектор начинается с .kb-page-article (класс <body>
 * из layout), чтобы стили не задевали остальные страницы и редактор.
 */

.kb-page-article {
    /* Высота fixed navbar с отступом: top у sticky-колонок и scroll-margin у заголовков. */
    --kb-sticky-top: 88px;
    background: #FAFAFA;
}

.kb-page-article main > .container {
    max-width: 1400px;
}

.kb-page-article .breadcrumb {
    background-color: transparent;
}

.kb-page-article .breadcrumb-block:before {
    background-image: linear-gradient(to right, rgba(250, 250, 250, 0), #FAFAFA 70%);
}

.kb-page-article .kb-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "article" "aside" "nav";
    gap: 48px;
    align-items: start;
    margin-top: 24px;
    padding-bottom: 48px;
    color: #1E2228;
    line-height: 1.7;
}

.kb-page-article .kb-article-nav {
    grid-area: nav;
    min-width: 0;
}

.kb-page-article .kb-article {
    grid-area: article;
    min-width: 0;
}

.kb-page-article .kb-article-aside {
    grid-area: aside;
    min-width: 0;
}

@media (min-width: 992px) {
    .kb-page-article .kb-article-layout {
        grid-template-columns: 240px minmax(0, 720px);
        grid-template-areas: "nav article" "nav aside";
        justify-content: center;
    }

    .kb-page-article .kb-article-nav {
        position: sticky;
        top: var(--kb-sticky-top);
        max-height: calc(100vh - var(--kb-sticky-top));
        overflow-y: auto;
        padding-bottom: 24px;
    }
}

@media (min-width: 1340px) {
    .kb-page-article .kb-article-layout {
        grid-template-columns: 240px minmax(0, 720px) 260px;
        grid-template-areas: "nav article aside";
    }

    .kb-page-article .kb-article-aside {
        position: sticky;
        top: var(--kb-sticky-top);
        max-height: calc(100vh - var(--kb-sticky-top));
        overflow-y: auto;
        padding-bottom: 24px;
    }
}

.kb-page-article .kb-article-header__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: #1E2228;
}

.kb-page-article .kb-article-header__description {
    margin: 0 0 8px;
    font-size: 15px;
    color: #5D6070;
}

.kb-page-article .kb-article-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E4E4E4;
    font-size: 13px;
    color: #8F9098;
}

.kb-page-article .kb-article__content {
    font-size: 16px;
}

.kb-page-article .kb-article__content .codex-editor__redactor {
    padding-bottom: 0 !important;
}

.kb-page-article .kb-article__content a {
    color: #00ACEF;
}

.kb-page-article .kb-article__content a:hover {
    color: #0095D1;
}

.kb-page-article .kb-article__content .ce-paragraph {
    margin: 12px 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.7;
    text-align: left;
}

.kb-page-article .kb-article__content .cdx-list__item {
    text-align: left;
}

.kb-page-article .kb-article__content .ce-header {
    position: relative;
    padding: 0;
    line-height: 1.4;
    scroll-margin-top: var(--kb-sticky-top);
}

.kb-page-article .kb-article__content h1.ce-header {
    margin: 44px 0 8px;
    font-size: 24px;
    font-weight: 700;
}

.kb-page-article .kb-article__content h2.ce-header {
    margin: 44px 0 8px;
    font-size: 20px;
    font-weight: 600;
}

.kb-page-article .kb-article__content h3.ce-header {
    margin: 32px 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.kb-page-article .kb-article__content .ce-block:first-child .ce-header {
    margin-top: 0;
}

.kb-page-article .kb-article__content .kb-heading-anchor {
    margin-left: 8px;
    font-weight: 400;
    color: #C9CBD1;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.kb-page-article .kb-article__content .kb-heading-anchor::before {
    content: "#";
}

.kb-page-article .kb-article__content .ce-header:hover .kb-heading-anchor,
.kb-page-article .kb-article__content .kb-heading-anchor:focus {
    opacity: 1;
}

.kb-page-article .kb-article__content .kb-heading-anchor:hover {
    color: #00ACEF;
    text-decoration: none;
}

.kb-page-article .kb-article__content .cdx-simple-image {
    margin: 24px 0;
    padding: 0;
    text-align: center;
}

.kb-page-article .kb-article__content .cdx-simple-image__picture {
    padding: 0;
    border: 0;
    background: none;
    text-align: center;
}

.kb-page-article .kb-article__content .cdx-simple-image__picture img {
    display: inline-block;
    width: auto;
    max-width: min(100%, 520px);
    height: auto;
    margin: 0;
    border: 1px solid #E4E4E4;
    border-radius: 8px;
    cursor: zoom-in;
}

.kb-page-article .kb-article__content .cdx-simple-image__caption {
    margin-top: 8px;
    padding: 0;
    border: 0;
    box-shadow: none;
    font-size: 13px;
    line-height: 1.5;
    color: #8F9098;
    text-align: center;
}

.kb-page-article .kb-article__content .cdx-simple-image__caption:empty {
    display: none;
}

.kb-page-article .kb-article__content .embed-tool {
    max-width: 720px;
    margin: 24px auto;
    padding: 0;
}

.kb-page-article .kb-article__content .embed-tool iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 1px solid #E4E4E4;
    border-radius: 12px;
}

.kb-page-article .kb-nav-group + .kb-nav-group {
    margin-top: 24px;
}

.kb-page-article .kb-nav-group__title,
.kb-page-article .kb-toc__title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8F9098;
}

.kb-page-article .kb-nav-group__list,
.kb-page-article .kb-toc__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kb-page-article .kb-nav-group__link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: #5D6070;
    text-decoration: none;
}

.kb-page-article a.kb-nav-group__link:hover {
    background: #F2F3F5;
    color: #1E2228;
    text-decoration: none;
}

.kb-page-article .kb-nav-group__link.is-current {
    background: #E6F6FE;
    color: #1E2228;
    font-weight: 600;
}

.kb-page-article .kb-toc__list {
    border-left: 1px solid #E4E4E4;
}

.kb-page-article .kb-toc__link {
    display: block;
    margin-left: -1px;
    padding: 7px 0 7px 16px;
    border-left: 2px solid transparent;
    font-size: 14px;
    line-height: 1.45;
    color: #5D6070;
    text-decoration: none;
}

.kb-page-article .kb-toc__link:hover {
    color: #1E2228;
    text-decoration: none;
}

.kb-page-article .kb-toc__link.is-active {
    border-left-color: #00ACEF;
    color: #1E2228;
    font-weight: 600;
}

.kb-page-article .kb-toc__item--sub .kb-toc__link {
    padding-left: 28px;
}

.kb-page-article .kb-toc-compact {
    margin: 0 0 24px;
    border: 1px solid #E4E4E4;
    border-radius: 12px;
    background: #fff;
}

.kb-page-article .kb-toc-compact__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: #1E2228;
    cursor: pointer;
    list-style: none;
}

.kb-page-article .kb-toc-compact__summary::-webkit-details-marker {
    display: none;
}

.kb-page-article .kb-toc-compact__summary::after {
    content: "";
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 2px solid #8F9098;
    border-bottom: 2px solid #8F9098;
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.kb-page-article .kb-toc-compact[open] .kb-toc-compact__summary::after {
    transform: rotate(225deg);
}

.kb-page-article .kb-toc-compact__summary:focus {
    outline: none;
}

.kb-page-article .kb-toc-compact__summary:focus-visible {
    outline: 2px solid #00ACEF;
    outline-offset: 2px;
}

.kb-page-article .kb-toc-compact nav {
    max-height: 60vh;
    padding: 0 16px 12px;
    overflow-y: auto;
}

@media (min-width: 1340px) {
    .kb-page-article .kb-toc-compact {
        display: none;
    }
}

@media (max-width: 1339.98px) {
    .kb-page-article .kb-toc {
        display: none;
    }

    .kb-page-article .kb-toc + .kb-banner {
        margin-top: 0;
    }
}

.kb-page-article .kb-banner {
    border: 1px solid #E4E4E4;
    background: #fff;
    box-shadow: -2px 4px 16px rgba(30, 34, 40, 0.05);
}

.kb-page-article .kb-banner--support {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
}

.kb-page-article .kb-toc[hidden] + .kb-banner {
    margin-top: 0;
}

.kb-page-article .kb-banner__title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.kb-page-article .kb-banner__text {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #5D6070;
}

.kb-page-article .kb-banner__button {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: #00ACEF;
    font-size: 14px;
    line-height: 1.45;
    color: #fff;
    text-decoration: none;
}

.kb-page-article .kb-banner__button:hover,
.kb-page-article .kb-banner__cta:hover {
    background: #0095D1;
    color: #fff;
    text-decoration: none;
}

.kb-page-article .kb-banner--connect {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
    padding: 20px;
    border-radius: 16px;
}

.kb-page-article .kb-banner__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.kb-page-article .kb-banner__icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #FBEDEA;
    color: #E17664;
}

.kb-page-article .kb-banner__icon svg,
.kb-page-article .kb-banner__check svg {
    display: block;
}

.kb-page-article .kb-banner__heading {
    margin: 0;
    padding-top: 2px;
    font-size: 17px;
    font-weight: 700;
    line-height: 23px;
    color: #1E2228;
}

.kb-page-article .kb-banner__features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kb-page-article .kb-banner__feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 20px;
    color: #1E2228;
}

.kb-page-article .kb-banner__check {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 5px;
    background: #FBEDEA;
    color: #E17664;
}

.kb-page-article .kb-banner__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    background: #00ACEF;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    text-decoration: none;
}

@media (min-width: 480px) and (max-width: 767.98px) {
    .kb-page-article .kb-banner__cta {
        align-self: flex-start;
    }
}

@media (min-width: 768px) and (max-width: 1339.98px) {
    .kb-page-article .kb-banner--connect {
        flex-direction: row;
        align-items: center;
        gap: 32px;
        padding: 24px;
    }

    .kb-page-article .kb-banner__head {
        flex: none;
        align-items: center;
    }

    .kb-page-article .kb-banner__features {
        flex: 1 1 auto;
        gap: 8px;
    }

    .kb-page-article .kb-banner__cta {
        flex: none;
    }

    .kb-page-article .kb-banner--support {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 24px;
        padding: 16px 24px;
    }

    .kb-page-article .kb-banner--support .kb-banner__text {
        grid-column: 1;
        margin-bottom: 0;
    }

    .kb-page-article .kb-banner--support .kb-banner__button {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

.kb-page-article .kb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(30, 34, 40, 0.9);
    cursor: zoom-out;
}

.kb-page-article .kb-lightbox[hidden] {
    display: none;
}

.kb-page-article .kb-lightbox:focus {
    outline: none;
}

.kb-page-article .kb-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.kb-page-article .kb-lightbox__hint {
    position: absolute;
    right: 0;
    bottom: 24px;
    left: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

@media (max-width: 767.98px) {
    .kb-page-article .kb-lightbox {
        padding: 8px;
    }

    .kb-page-article .kb-lightbox__image {
        border-radius: 4px;
    }

    .kb-page-article .kb-lightbox__hint {
        bottom: 16px;
    }
}
