/** Sticky article sidebar and table of contents. */
.article-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px + var(--ahm-admin-bar-offset, 0px));
    display: grid;
    width: 320px;
    gap: 20px;
    justify-self: end;
}

.article-sidebar-card {
    overflow: hidden;
    padding: 24px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.article-toc-card {
    padding: 0;
    background: var(--color-white);
    box-shadow: 0 10px 34px rgba(11, 29, 58, .07);
}

.article-card-heading {
    display: flex;
    min-height: 50px;
    padding: 0 18px;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--color-line);
    background: linear-gradient(180deg, #FFFFFF, #F9FBFA);
}

.article-card-heading > span {
    display: block;
    width: 3px;
    height: 19px;
    border-radius: 999px;
    background: var(--color-secondary);
}

.article-card-heading h3 {
    margin: 0;
    font-size: .95rem;
}

.article-toc-list {
    display: grid;
    max-height: min(55vh, 480px);
    margin: 0;
    padding: 12px 15px 15px;
    overflow-y: auto;
    gap: 10px;
    list-style: none;
    counter-reset: toc-h2;
}

.article-toc-item {
    position: relative;
}

.article-toc-item--h2 {
    counter-increment: toc-h2;
    counter-reset: toc-h3;
}

.article-toc-item--h3 {
    padding-left: 13px;
    counter-increment: toc-h3;
}

.article-toc-item a {
    display: grid;
    padding: 4px 6px;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 2px;
    border-radius: 6px;
    color: #52606A;
    font-size: .82rem;
    line-height: 1.42;
    transition: color .15s ease, background-color .15s ease;
}

.article-toc-item--h2 a::before {
    color: var(--color-secondary-text);
    font-weight: 750;
    content: counter(toc-h2) ".";
}

.article-toc-item--h3 a {
    padding-top: 3px;
    padding-bottom: 3px;
    grid-template-columns: 15px minmax(0, 1fr);
    gap: 5px;
    font-size: .79rem;
}

.article-toc-item--h3 a::before {
    width: 6px;
    height: 6px;
    margin-top: .52em;
    align-self: start;
    border-radius: 50%;
    background: var(--color-secondary);
    color: #81909A;
    font-size: .82rem;
    content: "";
}

.article-toc-item a:hover,
.article-toc-item a.is-active {
    background: rgba(76, 175, 80, .09);
    color: var(--color-primary);
}

.article-toc-item a.is-active {
    box-shadow: inset 2px 0 0 var(--color-secondary);
}

.article-toc-item--h3 a.is-active::before {
    background: var(--color-secondary-text);
}

.article-toc-list::-webkit-scrollbar {
    width: 5px;
}

.article-toc-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #C9D5D0;
}

.article-mobile-toc {
    display: none;
}

.article-mobile-toc details {
    overflow: hidden;
    border: 1px solid rgba(47, 125, 50, .28);
    border-radius: 14px;
    background: var(--color-white);
    box-shadow: 0 10px 28px rgba(11, 29, 58, .065);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.article-mobile-toc details[open] {
    border-color: rgba(47, 125, 50, .42);
    box-shadow: 0 14px 34px rgba(11, 29, 58, .08);
}

.article-mobile-toc summary {
    position: relative;
    display: flex;
    min-height: 56px;
    padding: 0 58px 0 18px;
    align-items: center;
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFDFB 100%);
    color: var(--color-primary);
    font-size: .96rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.article-mobile-toc summary:hover,
.article-mobile-toc summary:focus-visible {
    background: #F8FBF8;
}

.article-mobile-toc summary::-webkit-details-marker {
    display: none;
}

.article-mobile-toc summary::before {
    display: block;
    width: 4px;
    height: 20px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--color-secondary);
    content: "";
}

.article-mobile-toc summary::after {
    position: absolute;
    top: 50%;
    right: 16px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #D6E3D7;
    border-radius: 50%;
    background: #F3F8F2;
    color: var(--color-secondary-text);
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1;
    content: "+";
    transform: translateY(-50%);
}

.article-mobile-toc details[open] summary::after {
    content: "−";
}

.article-mobile-toc .article-toc-list {
    max-height: 380px;
    border-top: 1px solid #DCE6DE;
}

@media (max-width: 1320px) {
    .article-sidebar {
        width: 300px;
    }
}

@media (max-width: 1120px) {
    .article-sidebar {
        width: 280px;
    }
}

@media (max-width: 920px) {
    .article-mobile-toc {
        display: block;
        order: 1;
    }

    .article-main {
        order: 2;
    }

    .article-sidebar {
        position: static;
        width: auto;
        order: 3;
        justify-self: stretch;
    }

    .article-sidebar .article-toc-card {
        display: none;
    }
}

@media (max-width: 767px) {
    .article-mobile-toc {
        margin-bottom: 0;
    }

    .article-breadcrumbs {
        margin-bottom: 22px;
    }

    .article-breadcrumbs li:last-child {
        display: none;
    }

    .article-featured-image--hero {
        aspect-ratio: 4 / 3;
    }

    .article-mobile-toc,
    .article-mobile-toc details,
    .article-mobile-toc .article-toc-list {
        touch-action: pan-y;
    }

    .article-mobile-toc .article-toc-list {
        max-height: none;
        padding: 10px 12px 13px;
        overflow: visible;
        overscroll-behavior: auto;
        -webkit-overflow-scrolling: auto;
    }

    .article-mobile-toc .article-toc-item a {
        scroll-margin-top: calc(var(--header-height) + 18px);
    }

    .article-toc-item a {
        font-size: .84rem;
    }

    .article-toc-item--h3 a {
        font-size: .81rem;
    }
}
