/* Legal Page Layout with Sidebar Table of Contents */

.legal-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-2xl);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    align-items: start;
    position: relative;
}

/* Sidebar TOC styles */
.legal-sidebar {
    position: sticky;
    top: 130px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 10px 20px 20px 0;
    border-right: 1px solid var(--border-light);
}

/* Custom scrollbar for sidebar */
.legal-sidebar::-webkit-scrollbar {
    width: 4px;
}
.legal-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.legal-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.legal-sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

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

.legal-toc li {
    padding: 0;
    margin: 0;
}

.legal-toc li.depth-3 {
    margin-left: 15px;
}

.legal-toc a {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--text-light);
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -2px;
}

.legal-toc li.depth-3 a {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legal-toc a:hover {
    color: var(--black);
    border-left-color: var(--primary-color);
}

.legal-toc a.active {
    color: var(--black);
    font-weight: 600;
    border-left-color: var(--black);
}

.legal-toc li.depth-3 a.active {
    border-left-color: var(--primary-color);
}

/* Mobile Collapsible TOC widget */
.mobile-toc-wrapper {
    display: none;
    margin-bottom: 40px;
    width: 100%;
}

.mobile-toc-details {
    background: var(--gray-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 15px 20px;
}

.mobile-toc-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    color: var(--black);
    user-select: none;
}

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

.mobile-toc-summary i {
    font-size: 1.25rem;
    color: var(--primary-dark);
}

.mobile-toc-details[open] .mobile-toc-summary {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.mobile-toc-details .legal-toc {
    max-height: 250px;
    overflow-y: auto;
}

/* Document content styles overrides */
.legal-content {
    max-width: 820px;
    width: 100%;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* Responsive transitions */
@media (max-width: 992px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .legal-sidebar {
        display: none;
    }
    
    .mobile-toc-wrapper {
        display: block;
    }
}
