@charset "utf-8";
/* CSS Document */

/* Sidebar container */
.toc-container {
  position: sticky;
  top: 5rem;
  left: 0;
  max-height: 90vh;
  overflow-y: auto;
  width: 260px;
  padding: 1rem;
  background-color: #f9f9f9;
  border-right: 1px solid #ddd;
  font-size: 0.9rem;
  display: none;
  line-height: 1.6;
}

.toc-container h3 {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.toc-container ul {
  list-style-type: none;
  padding-left: 0;
}

.toc-container li {
  margin: 0.3rem 0;
}

.toc-container a {
  text-decoration: none;
  color: #333;
}

.toc-container a:hover {
  text-decoration: underline;
}

/* Articles (h2) bold and spaced */
.toc-article {
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

/* Sections (h3) indented slightly */
.toc-section {
  padding-left: 1rem;
  font-weight: normal;
  margin-bottom: 0.2rem;
}

main.content h2,
main.content h3,
article[id],
section[id] {
  scroll-margin-top: 100px; /* Adjust based on your header height */
}


/* Toggle button for mobile */
.toc-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* Mobile styles */
@media (max-width: 1024px) {
  .toc-container {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100%;
    max-height: none;
    background-color: #fff;
    z-index: 9999;
    display: block;
    transition: left 0.3s ease;
  }

  .toc-container.open {
    left: 0;
  }

  .toc-toggle {
    display: block;
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10000;
    background-color: #fff;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    cursor: pointer;
  }

  main.content {
    margin-left: 0;
  }
}

@media (min-width: 1025px) {
  .toc-container {
    display: block;
    float: left;
    margin-right: 2rem;
  }

  main.content {
    margin-left: 280px;
  }
}
