.sticky-toc {
    position: sticky;
    top: 80px;
    padding: 0;
    background-color: #F5F7F5;
    z-index: 100;
    transition: top .3s;
}
body.admin-bar .sticky-toc {
    top: calc(32px);
}
body.admin-bar.is-scrolled .sticky-toc {
    top: calc(32px);
}
body.admin-bar.is-scrolling-up .sticky-toc {
    top: calc(32px + 80px);
}
body:not(.admin-bar).is-scrolled .sticky-toc {
    top: 0;
}
body:not(.admin-bar).is-scrolling-up .sticky-toc {
    top: 80px;
}

.sticky-toc > .wp-block-group {
    display: flex;
    align-items: center;
    gap: 120px;
    padding: 0 16px;
}

.sticky-toc nav {
    overflow: hidden;
    width: 100%;
    mask-image: linear-gradient(
            to right,
            black 0%,
            black calc(100% - 32px),
            transparent 100%
    );
    -webkit-mask-image: linear-gradient(
            to right,
            black 0%,
            black calc(100% - 32px),
            transparent 100%
    );
}

.sticky-toc ul {
    list-style: none;
    margin: 0;
    padding: 0 0 4px 0;
    display: flex;
    gap: 32px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}
.sticky-toc ul.is-dragging {
    cursor: grabbing;
}
.sticky-toc ul::-webkit-scrollbar {
    display: none;
}
.sticky-toc ul {
    scrollbar-width: thin;
}

.sticky-toc li {
    display: inline-flex;
}

.sticky-toc a {
    text-decoration: none;
    padding: 24px 0;
    font-weight: 600;
    line-height: 18px;
    font-size: 18px;
    letter-spacing: .4px;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #1F221F;
    white-space: nowrap;
}

.sticky-toc a.active {
    font-weight: bold;
}

.sticky-toc .icon_bg {
    background-color: #EBEEEB;
    padding: 4px;
    line-height: 0;
    border-radius: 4px;
    display: inline-block;
    transition: background-color .3s;
}
.sticky-toc .icon {
    color: #2F332E;
}

.sticky-toc a:hover .icon_bg {
    background-color: #C3CDC2;
}

.sticky-toc ul.toc-sublist {
    position: absolute;
    top: 100%;
    flex-direction: column;
    gap: 0;
    background-color: #f5f7f5;
    padding: 24px;
    display: none;
}
.sticky-toc li:hover > ul.toc-sublist {
    display: flex;
}
.toc-sublist a {
    padding: 12px 0;
}

#mobile-toc {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 99999;
    width: 100%;
    height: 100dvh;
    background-color: #00000000;
    transition: left .3s, background-color .3s;
}
#mobile-toc .toc-offcanvas__inner {
    width: calc(100% - 32px);
    height: 100%;
    background-color: #F5F7F5;
    box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.16);
}
#mobile-toc .sticky-toc {
    margin: 0;
    border-radius: 0;
    overflow: auto;
    max-height: 100%;
    scrollbar-width: thin;
}
#mobile-toc .toc-offcanvas__header {
    padding: 50px 24px 0 24px;
    font-weight: 600;
    font-size: var(--font-size-l-20);
    line-height: var(--line-height-l-20);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
#mobile-toc .wp-block-group {
    max-width: 100% !important;
    padding: 20px 24px;
}
#mobile-toc .sticky-toc ul {
    flex-direction: column;
    gap: 0;
}
#mobile-toc.toc-offcanvas.is-open {
    left: 0;
    background-color: #00000020;
}
.toc-fab {
    position: fixed;
    bottom: 50px;
    left: 16px;
    max-width: calc(100% - 130px);
    width: 350px;
    border: none;
    border-radius: 64px;
    padding: 16px 28px;
    background-color: #9BAB9A;
    color: #fff;
    font-size: var(--font-size-m-18, 16px);
    font-style: normal;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    z-index: 101;
    display: flex;
    gap: 8px;
    justify-content: center;
}
.mobile-toc,
.toc-fab {
    display: none;
}

@media (max-width: 768px) {
    .sticky-toc {
        position: relative;
        height: auto;
        top: 0 !important;
        margin: 0 16px;
        border-radius: 24px;
    }
    .sticky-toc > .wp-block-group {
        gap: 120px;
        padding: 20px 24px;
    }
    .sticky-toc > .wp-block-group > nav {
        width: 100%;
    }
    .sticky-toc ul {
        flex-direction: column;
        gap: 0;
    }
    .sticky-toc ul li {
        border-bottom: 1px solid #E1E6E1;
        flex-direction: column;
    }
    .sticky-toc ul li:has(ul) {
        background-image: url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.16406 8.08594L2.08594 9.16406L11.4609 18.5391L12 19.0547L12.5391 18.5391L21.9141 9.16406L20.8359 8.08594L12 16.9219L3.16406 8.08594Z" fill="%231F221F"/></svg>');
        background-repeat: no-repeat;
        background-position: calc(100% - 16px) 8px;
    }
    .sticky-toc ul li ul {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .sticky-toc ul li ul li {
        border-bottom: 0;
        border-top: 1px solid #E1E6E1;
    }
    .sticky-toc a {
        padding: 12px 8px;
        width: 100%;
    }
    .sticky-toc ul.toc-sublist {
        display: flex;
        position: relative;
        padding: 0;
    }

    .toc-fab {
        display: flex;
    }
    .mobile-toc {
        display: initial;
    }


}

