/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: var(--sp-8) var(--sp-5);
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.docs-sidebar-toggle {
  display: none;
}

.docs-nav h4 {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
  padding: 0 var(--sp-3);
}

.docs-nav h4:first-child {
  margin-top: 0;
}

.docs-nav ul {
  list-style: none;
  margin-bottom: var(--sp-2);
}

.docs-nav a {
  display: block;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--ease-fast), background var(--ease-fast);
  line-height: 1.8;
}

.docs-nav a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.docs-nav a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Content */
.docs-content {
  padding: var(--sp-12) var(--sp-10);
  max-width: var(--max-w-narrow);
}

.docs-section {
  margin-bottom: var(--sp-16);
  scroll-margin-top: 80px;
}

.docs-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--sp-6);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
  letter-spacing: var(--tracking-tight);
}

.docs-section:first-child h2 {
  border-top: none;
  padding-top: 0;
}

.docs-content h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.docs-content p {
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
  line-height: var(--leading-relaxed);
}

.docs-content strong {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.docs-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.docs-content a:hover {
  color: var(--text);
}

.docs-content ul,
.docs-content ol {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-6);
  color: var(--text-secondary);
}

.docs-content li {
  margin-bottom: var(--sp-2);
  line-height: var(--leading-relaxed);
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.docs-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  overflow-x: auto;
  margin-bottom: var(--sp-6);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: var(--text-secondary);
}

/* Docs tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-6);
  font-size: var(--text-sm);
}

.docs-content th,
.docs-content td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.docs-content th {
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  background: var(--bg-elevated);
}

.docs-content td {
  color: var(--text-secondary);
}

/* Callout boxes */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--sp-6);
}

.callout p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.callout strong {
  color: var(--accent);
}

.callout--warning {
  border-left-color: var(--warning);
  background: rgba(251, 191, 36, 0.08);
}

.callout--warning strong {
  color: var(--warning);
}

/* Mobile sidebar toggle button */
.docs-mobile-toggle {
  display: none;
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: var(--z-overlay);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: fixed;
    left: -300px;
    top: 64px;
    width: 280px;
    z-index: var(--z-overlay);
    transition: left var(--ease-base);
    box-shadow: none;
  }

  .docs-sidebar.open {
    left: 0;
    box-shadow: var(--shadow-lg);
  }

  .docs-mobile-toggle {
    display: flex;
  }

  .docs-content {
    padding: var(--sp-8) var(--sp-4);
  }
}
