.toc-block {
    width: 100%;
    padding: 40px 20px;
}

.toc-block > .container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
}

.toc-block__wrapper {
    background: var(--color-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
    overflow: hidden;
}

.toc-block__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toc-block__header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toc-block__title {
    font-size: 24px;
    line-height: 30px;
    font-weight: 700;
    color: var(--primary-text-color);
    margin: 0;
    text-align: left;
    flex: 1;
}

.toc-block__icon {
    flex-shrink: 0;
    color: var(--accent-color);
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

.toc-block--open .toc-block__icon {
    transform: rotate(180deg);
}

.toc-block__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.toc-block--open .toc-block__content {
    max-height: 2000px;
}

.toc-block__nav {
    padding: 0 30px 30px 30px;
}

.toc-block__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toc-block__item {
    position: relative;
    opacity: 0;
    transform: translateX(-10px);
    animation: fadeInLeft 0.3s ease forwards;
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toc-block__item--h1 {
    padding-left: 0;
    font-weight: 700;
}

.toc-block__item--h2 {
    padding-left: 20px;
    font-weight: 600;
}

.toc-block__item--h3 {
    padding-left: 40px;
    font-weight: 500;
}

.toc-block__item--h4 {
    padding-left: 60px;
    font-weight: 400;
}

.toc-block__item--h5 {
    padding-left: 80px;
    font-weight: 400;
    font-size: 14px;
}

.toc-block__item--h6 {
    padding-left: 100px;
    font-weight: 400;
    font-size: 14px;
}

.toc-block__item--h2::before,
.toc-block__item--h3::before,
.toc-block__item--h4::before,
.toc-block__item--h5::before,
.toc-block__item--h6::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    border-radius: 50%;
}

.toc-block__item--h2::before {
    left: 0;
    width: 8px;
    height: 8px;
}

.toc-block__item--h3::before {
    left: 20px;
    width: 7px;
    height: 7px;
}

.toc-block__item--h4::before {
    left: 40px;
    width: 6px;
    height: 6px;
}

.toc-block__item--h5::before {
    left: 60px;
    width: 5px;
    height: 5px;
}

.toc-block__item--h6::before {
    left: 80px;
    width: 4px;
    height: 4px;
}

.toc-block__link {
    color: var(--primary-text-color);
    text-decoration: none;
    font-size: var(--font-size);
    line-height: 24px;
    transition: all 0.3s ease;
    display: inline-block;
}


/* Mobile */
@media screen and (max-width: 768px) {
    .toc-block__header {
        padding: 20px;
    }

    .toc-block__nav {
        padding: 0 20px 20px 20px;
    }

    .toc-block__title {
        font-size: 20px;
        line-height: 26px;
    }

    .toc-block__item--h2 {
        padding-left: 15px;
    }

    .toc-block__item--h3 {
        padding-left: 30px;
    }

    .toc-block__item--h4 {
        padding-left: 45px;
    }

    .toc-block__item--h5 {
        padding-left: 60px;
    }

    .toc-block__item--h6 {
        padding-left: 75px;
    }

    .toc-block__item--h3::before {
        left: 15px;
    }

    .toc-block__item--h4::before {
        left: 30px;
    }

    .toc-block__item--h5::before {
        left: 45px;
    }

    .toc-block__item--h6::before {
        left: 60px;
    }
}

.toc-block__item:hover {
    color: white !important;
}