/* Sidebar Styles for GitHub Pages Wiki */

.container-wrapper {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
}

.sidebar-container {
  flex: 0 0 250px;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.main-content-wrapper {
  flex: 1;
  min-width: 0;
}

.sidebar {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-nav h1 {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ddd;
}

.sidebar-nav h1:first-child {
  margin-top: 0;
}

.sidebar-nav h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1rem 0;
}

.sidebar-nav li {
  margin: 0.25rem 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.4rem 0.8rem;
  color: #0366d6;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.sidebar-nav a:hover {
  background: #e1e4e8;
  color: #0366d6;
  text-decoration: none;
  padding-left: 1rem;
}

.sidebar-nav a:active,
.sidebar-nav a.active {
  background: #0366d6;
  color: white;
}

.sidebar-nav hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1rem 0;
}

/* Scrollbar styling */
.sidebar-container::-webkit-scrollbar {
  width: 6px;
}

.sidebar-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.sidebar-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.sidebar-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive design */
@media (max-width: 768px) {
  .container-wrapper {
    flex-direction: column;
  }

  .sidebar-container {
    position: static;
    flex: none;
    max-height: none;
    margin-bottom: 2rem;
  }

  .sidebar {
    padding: 1rem;
  }

  .sidebar-nav {
    column-count: 2;
    column-gap: 1rem;
  }

  .sidebar-nav h1,
  .sidebar-nav h2 {
    break-after: avoid;
  }

  .sidebar-nav ul {
    break-inside: avoid;
  }
}

@media (max-width: 480px) {
  .sidebar-nav {
    column-count: 1;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .sidebar {
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .sidebar-nav h1 {
    color: #e1e4e8;
    border-bottom-color: #444;
  }

  .sidebar-nav h2 {
    color: #c9d1d9;
  }

  .sidebar-nav a {
    color: #58a6ff;
  }

  .sidebar-nav a:hover {
    background: #444;
    color: #58a6ff;
  }

  .sidebar-nav a:active,
  .sidebar-nav a.active {
    background: #58a6ff;
    color: #0d1117;
  }

  .sidebar-nav hr {
    border-top-color: #444;
  }

  .sidebar-container::-webkit-scrollbar-track {
    background: #2d2d2d;
  }

  .sidebar-container::-webkit-scrollbar-thumb {
    background: #666;
  }

  .sidebar-container::-webkit-scrollbar-thumb:hover {
    background: #888;
  }
}