/* Legal Pages Table of Contents Styles */

.legal-content-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.toc-sidebar {
  position: sticky;
  top: 2rem;
  width: 250px;
  flex-shrink: 0;
}

.toc-nav {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.toc-nav h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #333;
}

.toc-nav nav {
  margin: 0;
}

.toc-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc-nav ul ul {
  padding-left: 1.2rem;
  margin-top: 0.25rem;
}

.toc-nav li {
  margin-bottom: 0.5rem;
}

.toc-nav a {
  color: #555;
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.toc-nav a:hover {
  color: #0066cc;
}

/* Highlight current section */
.toc-nav a.active {
  color: #0066cc;
  font-weight: 500;
}

/* Make the main content take remaining space */
.legal-main-content {
  flex: 1;
  min-width: 0; /* Prevent content from overflowing */
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Add some spacing to headings for better anchor positioning */
.main-paragraph h2,
.main-paragraph h3,
.main-paragraph h4 {
  scroll-margin-top: 2rem;
}

/* Responsive: Hide TOC on mobile */
@media (max-width: 768px) {
  .legal-content-wrapper {
    flex-direction: column;
  }
  
  .toc-sidebar {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    top: 0;
  }
  
  .toc-nav {
    background: #ffffff;
  }
}

/* Optional: Collapsible TOC on mobile */
@media (max-width: 768px) {
  .toc-nav {
    position: relative;
  }
  
  .toc-nav h4 {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .toc-nav h4::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.2s;
  }
  
  .toc-nav.collapsed h4::after {
    transform: rotate(-90deg);
  }
  
  .toc-nav.collapsed nav {
    display: none;
  }
}