html {
    scroll-behavior: smooth;
}

.article-toc {
    margin-bottom: 42px;
    padding: 26px 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.article-toc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    cursor: pointer;
    list-style: none;
}

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

.article-toc-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.article-toc-chevron {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    color: rgba(255, 255, 255, 0.68);
    transition: transform 180ms ease, color 180ms ease;
}

.article-toc-details[open]:not(.is-closing) .article-toc-chevron {
    transform: rotate(180deg);
}

.article-toc-summary:hover .article-toc-chevron {
    color: #ffffff;
}

.article-toc-summary:focus-visible {
    border-radius: 6px;
    outline: 2px solid currentColor;
    outline-offset: 6px;
}

.article-toc-content {
    box-sizing: border-box;
    padding-top: 16px;
}

.article-toc-content.is-animating {
    overflow: hidden;
}

.article-toc-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 1.3rem;
}

.article-toc-item {
    padding-left: 4px;
    color: rgba(255, 255, 255, 0.48);
}

.article-toc-sublist {
    display: grid;
    gap: 8px;
    margin: 9px 0 2px;
    padding-left: 20px;
    list-style: none;
}

.article-toc-subitem {
    position: relative;
    padding-left: 14px;
}

.article-toc-subitem::before {
    content: '';
    position: absolute;
    top: 0.78em;
    left: 0;
    width: 6px;
    height: 1px;
    background: rgba(255, 255, 255, 0.32);
}

.article-toc-link {
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.55;
    text-decoration: none;
    text-underline-offset: 4px;
    transition: color 180ms ease;
}

.article-toc-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.article-toc-sublink {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.93em;
}

.article-toc-link:focus-visible {
    border-radius: 4px;
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.blog-post-section-title[id],
.blog-post-subheading[id] {
    scroll-margin-top: 32px;
}

@media (max-width: 640px) {
    .article-toc {
        margin-bottom: 30px;
        padding: 22px 20px;
        border-radius: 14px;
    }

    .article-toc-sublist {
        padding-left: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .article-toc-chevron {
        transition: none;
    }
}
