.single-post__toc {
    background: var(--white-color);
    border-radius: 12px;
    -webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.18);
            box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.18);
    padding: 18px 18px 24px 18px;
}

.single-post__toc-title {
    font-size: var(--large-font-size);
    font-weight: var(--medium-font-weight);
    color: var(--secondary-text-color);
    margin-bottom: 14px;
}

.toc__list {
    max-height: 52vh;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: overlay;
    -ms-scroll-chaining: none;
        overscroll-behavior: contain;
}

@media (-webkit-min-device-pixel-ratio: 1.5625), (min-resolution: 150dpi) {
    .toc__list {
        max-height: 64vh;
    }
}

.toc__list::-webkit-scrollbar {
    width: 6px;
    background: var(--white-color);
    border-radius: 12px;
}

.toc__list::-webkit-scrollbar-thumb {
    background-color: var(--light-blue-color);
    border-radius: 12px;
}

.toc__item {
   padding-right: 4px;
   margin-top: 4px;
}

.toc__item:first-child {
   margin-top: 0;
}

.toc__list--nested {
    padding-left: 12px;
}

.toc__link {
    display: block;
    font-size: var(--small-font-size);
    line-height: var(--medium-line-height);
    color: var(--primary-text-color);
    text-decoration: none;
    padding: 8px 12px;
    -webkit-transition: all .1s linear;
    transition: all .1s linear;
    border-radius: 4px;
}

.toc__link:hover {
    color: inherit;
}

.toc__link:not(.toc__link--active):hover {
    background-color: var(--light-blue-color);
}

.toc__link--active {
    background-color: var(--extra-light-blue-color);
}

.single-post__body :is(h2, h3, h4, h5, h6) {
    scroll-margin-top: 120px;
}

/* ============================================================
   Mobile: TOC as a bottomsheet (<= 992px)
   ============================================================ */

@media only screen and (min-width: 993px) {
    .bottomsheet {
        display: none;
    }
}

.bottomsheet-button--island {
    display: block;
    background: var(--white-color);
    border-radius: 12px;
    -webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.18);
            box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.18);
    position: fixed;
    bottom: 76px;
    left: 20px;
    right: 20px;
    z-index: 4;
    padding: 16px;
    text-align: center;
    font-size: var(--medium-font-size);
    font-weight: var(--medium-font-weight);
    color: var(--primary-text-color);
    cursor: pointer;
}

@media only screen and (min-width: 768px) {
    .bottomsheet-button--island {
        bottom: 20px;
    }
}

.bottomsheet__wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: end;
        -ms-flex-pack: end;
            justify-content: flex-end;
}

#toc-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    visibility: visible;
    -webkit-transition: opacity .5s, visibility .5s;
    transition: opacity .5s, visibility .5s;
}

#toc-sheet[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#toc-sheet .bottomsheet__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: var(--secondary-text-color);
    opacity: .5;
}

#toc-sheet .bottomsheet__container {
    max-width: 70rem;
    width: 100%;
    max-height: 100vh;
    height: 30vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    background: var(--white-color);
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow-y: hidden;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    --default-transitions: transform .5s, border-radius .5s;
    -webkit-transition: var(--default-transitions);
    transition: var(--default-transitions);
    -webkit-transform: translateY(0);
        -ms-transform: translateY(0);
            transform: translateY(0);
    padding: 16px;
    padding-top: 36px;
}

#toc-sheet .bottomsheet__container:not(.not-selectable) {
    -webkit-transition: var(--default-transitions), height .5s;
    transition: var(--default-transitions), height .5s;
}

#toc-sheet .bottomsheet__container.fullscreen {
    border-radius: 0;
}

#toc-sheet[aria-hidden="true"] .bottomsheet__container {
    -webkit-transform: translateY(100%);
        -ms-transform: translateY(100%);
            transform: translateY(100%);
}

#toc-sheet .draggable-area {
    width: 66px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 0;
    margin: auto;
    cursor: -webkit-grab;
    cursor: grab;
}

#toc-sheet .draggable-thumb {
    width: inherit;
    height: 4px;
    background: rgba(55, 59, 60, .40);
    border-radius: 50px;
}

#toc-sheet .bottomsheet__content {
    height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-flex: 1;
        -ms-flex-positive: 1;
            flex-grow: 1;
    -ms-flex-negative: 0;
        flex-shrink: 0;
    overflow-y: auto;
}

#toc-sheet .bottomsheet__content::-webkit-scrollbar {
    width: 6px;
    background: var(--white-color);
}

#toc-sheet .bottomsheet__content::-webkit-scrollbar-thumb {
    background-color: var(--light-blue-color);
    border-radius: 12px;
}

#toc-sheet .bottomsheet__content .single-post__toc {
    background: transparent;
    -webkit-box-shadow: none;
            box-shadow: none;
    border-radius: 0;
    padding: 0;
}

#toc-sheet .bottomsheet__content .toc__list {
    max-height: none;
    overflow: visible;
}