.docs-layout {
  min-height: calc(100vh - 180px);
}

.docs-layout > .container {
  display: flex;
  gap: 3rem;
  padding: 3rem 0;
}

.docs-sidebar {
  flex: 0 0 240px;
  position: sticky;
  top: 100px;
  align-self: flex-start;
  overflow-y: auto;
}

.sidebar-nav h5 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.sidebar-nav a {
  display: block;
  color: var(--subtle-text);
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color 0.2s ease-in-out;
  border-left: 2px solid transparent;
  padding-left: 1rem;
  margin-left: -1rem;
}

.sidebar-nav a:hover {
  color: var(--heading-color);
}

.sidebar-nav a.active {
  color: var(--primary-light);
  font-weight: 600;
  border-left-color: var(--primary-light);
}

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

.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4 {
  color: var(--heading-color);
  line-height: 1.3;
  margin-bottom: 1rem;
  margin-top: 2.5rem;
  scroll-margin-top: 120px;
}

.docs-content h1 {
  font-size: 2.8rem;
  margin-top: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.docs-content h2 {
  font-size: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.docs-content h3 {
  font-size: 1.5rem;
}

.docs-content p,
.docs-content ul,
.docs-content ol {
  margin-bottom: 1.25rem;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.5rem;
}

.docs-content a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
}

.docs-content a:hover {
  text-decoration: underline;
}

.docs-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background-color: var(--subtle-bg);
  border-left: 4px solid var(--primary-color);
  border-radius: 4px;
  color: var(--subtle-text);
}

.docs-content pre {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  box-shadow: var(--card-shadow);
  font-size: 0.95em;
  margin-bottom: 1.25rem;
}

.docs-content :not(pre) > code {
  background-color: var(--subtle-bg);
  color: var(--primary-light);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

@media (max-width: 992px) {
  .docs-layout > .container {
    flex-direction: column;
    gap: 0;
  }

  .docs-sidebar {
    position: static;
    flex: none;
    width: 100%;
    margin-bottom: 2rem;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-nav h5 {
    margin-top: 0;
    grid-column: 1 / -1;
  }

  .docs-content h1 {
    font-size: 2.2rem;
  }

  .docs-content h2 {
    font-size: 1.75rem;
  }

  .docs-layout > .container {
    padding: 1.5rem 0;
  }
}
