/**
 * Table of Contents Block Styles
 */

.table-of-contents {
    margin: 24px 0;
}

.toc-container {
    background: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 25px;
    overflow: hidden;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 36px;
    background: #FFFFFF;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.toc-header:hover {
    background: #F0F0F0;
}

.toc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #5DB24C;
    border-radius: 6px;
    color: #ffffff;
    flex-shrink: 0;
}

.toc-icon svg {
    width: 18px;
    height: 18px;
}

.toc-title {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 36px;
    font-weight: 800;
    line-height: 100%;
    color: #34363D;
    flex-grow: 1;
}

.toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #fff;
    border-radius: 8px;
    background-color: #5DB24C;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.toc-container.open .toc-toggle {
    transform: rotate(180deg);
}

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

.toc-container.open .toc-content {
    max-height: 2000px;
}

.toc-list {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    max-height: calc(4 * 60px + 3 * 8px);
    gap: 8px 16px;
    padding: 24px 20px;
    margin: 0;
    list-style: none;
    counter-reset: toc-counter;
}

.toc-item {
    margin: 0;
    width: calc(25% - 12px);
    flex-shrink: 0;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #2C2C2C;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.toc-link:hover {
    background: #F8F8F8;
    color: #5DB24C;
}

.toc-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    background: #F8F8F8;
    border: 1px solid #E6E6E6;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: #908F8F;
    flex-shrink: 0;
}

.toc-link:hover .toc-number {
    background: #5DB24C;
    color: #ffffff;
}

.toc-text {
    font-size: 14px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .toc-header {
        padding: 16px;
    }
}
@media (max-width: 1200px) {
    .toc-list {
        max-height: calc(6 * 60px + 5 * 8px);
    }
    
    .toc-item {
        width: calc(33.333% - 11px);
    }
}

@media (max-width: 900px) {
    .toc-list {
        max-height: calc(8 * 60px + 7 * 8px);
    }
    
    .toc-item {
        width: calc(50% - 8px);
    }
}

@media (max-width: 600px) {
    .toc-list {
        max-height: none;
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 20px 16px;
    }
    
    .toc-item {
        width: 100%;
    }
    
    .toc-header {
        padding: 14px 16px;
    }
    
    .toc-toggle {
        order: 3;
        margin-left: auto;
    }
    
    .toc-icon {
        order: 1;
    }
    
    .toc-title {
        order: 2;
    }
}
