/* Shared tokens, reset, links are in /shared.css */
/* Docs-specific variables */
:root {
  --sidebar-width: 240px;
  --content-max: 820px;
}
/* Nav and mobile menu styles are in /shared.css — .site-nav */

/* ─── Layout ─── */
.docs-layout {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 64px;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.docs-sidebar {
  position: fixed;
  top: 64px;
  left: max(0px, calc((100vw - var(--max-width)) / 2));
  width: var(--sidebar-width);
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 24px 16px 40px 24px;
  border-right: 1px solid var(--border-light);
  scrollbar-width: thin;
  scrollbar-color: rgba(139,148,158,0.2) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 5px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(139,148,158,0.2); border-radius: 3px; }
.sidebar-section {
  margin-bottom: 24px;
}
.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 8px;
}
.sidebar-links {
  list-style: none;
}
.sidebar-links li a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  line-height: 1.5;
}
.sidebar-links li a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.sidebar-links li a.active {
  color: var(--accent);
  background: rgba(0, 122, 255, 0.08);
  font-weight: 500;
}
.sidebar-links li.nested a {
  padding-left: 20px;
  font-size: 0.82rem;
}
.sidebar-page-link {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-page-link .page-icon {
  font-size: 0.85rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ─── Content ─── */
.docs-content {
  margin-left: var(--sidebar-width);
  padding: 32px 40px 80px;
  max-width: var(--content-max);
  width: 100%;
}
.docs-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  line-height: 1.2;
}
.docs-content .subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}
/* .gradient-text is in /shared.css */
.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: -0.01em;
}
.docs-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.docs-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.docs-content p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
}
.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-secondary);
}
.docs-content li {
  margin-bottom: 6px;
  line-height: 1.6;
}
.docs-content strong { color: var(--text-primary); }

/* ─── Inline code ─── */
.docs-content code {
  font-family: var(--mono);
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.85em;
  color: #E5C07B;
  border: 1px solid var(--border-light);
}

/* ─── Code blocks ─── */
.code-block {
  position: relative;
  margin: 16px 0 24px;
  background: #1E2229;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(30, 34, 41, 0.9);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.code-copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.code-copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.code-block pre {
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,148,158,0.2) transparent;
}
.code-block pre::-webkit-scrollbar { height: 5px; }
.code-block pre::-webkit-scrollbar-track { background: transparent; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(139,148,158,0.2); border-radius: 3px; }
.code-block code {
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

/* Syntax highlighting (Atom One Dark) */
.hl-keyword { color: #C678DD; }
.hl-id { color: #E06C75; }
.hl-prop { color: #D19A66; }
.hl-string { color: #98C379; }
.hl-number { color: #D19A66; }
.hl-comment { color: #5C6370; font-style: italic; }
.hl-color { color: #56B6C2; }
.hl-trigger { color: #61AFEF; }
.hl-punct { color: #ABB2BF; }

/* ─── Tables ─── */
.docs-table-wrap {
  margin: 16px 0 24px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.docs-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.docs-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: top;
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.docs-table code {
  font-size: 0.82em;
  white-space: nowrap;
}

/* ─── Callout / Tip blocks ─── */
.callout {
  margin: 20px 0 24px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  font-size: 0.9rem;
  line-height: 1.65;
}
.callout-tip {
  background: rgba(52, 199, 89, 0.06);
  border-color: var(--success);
  color: var(--text-secondary);
}
.callout-tip strong { color: var(--success); }
.callout-info {
  background: rgba(0, 122, 255, 0.06);
  border-color: var(--accent);
  color: var(--text-secondary);
}
.callout-info strong { color: var(--accent); }
.callout-warning {
  background: rgba(255, 159, 10, 0.06);
  border-color: #FF9F0A;
  color: var(--text-secondary);
}
.callout-warning strong { color: #FF9F0A; }

/* ─── Keyboard key badges ─── */
kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  color: var(--text-primary);
  line-height: 1.5;
  vertical-align: middle;
}

/* ─── Version badges ─── */
.version-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent);
  vertical-align: middle;
  margin-left: 6px;
}
.version-badge.done {
  background: rgba(52, 199, 89, 0.12);
  color: var(--success);
}

/* ─── Changelog entries ─── */
.changelog-version {
  margin-top: 40px;
  padding-bottom: 4px;
}
.changelog-version h3 {
  margin-top: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.changelog-version ul {
  padding-left: 20px;
}
.changelog-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 3px;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tag-feature { background: rgba(108, 92, 231, 0.15); color: #6C5CE7; }
.tag-fix { background: rgba(255, 69, 58, 0.12); color: #FF453A; }
.tag-ux { background: rgba(52, 199, 89, 0.12); color: var(--success); }
.tag-perf { background: rgba(255, 159, 10, 0.12); color: #FF9F0A; }
.tag-docs { background: rgba(0, 122, 255, 0.12); color: var(--accent); }
.tag-infra { background: rgba(139, 148, 158, 0.15); color: var(--text-secondary); }

/* Footer styles are in /shared.css — .site-footer */

/* ─── Prev/Next navigation ─── */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.page-nav-link {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.page-nav-link:hover {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.04);
}
.page-nav-link.next { text-align: right; }
.page-nav-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.page-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

/* ─── Mobile responsive ─── */
@media (max-width: 768px) {
  .docs-sidebar {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: 280px;
    height: calc(100vh - 56px);
    background: var(--bg-primary);
    z-index: 90;
    border-right: 1px solid var(--border);
  }
  .docs-sidebar.open { display: block; }
  .docs-content {
    margin-left: 0;
    padding: 24px 16px 60px;
  }
  .mobile-menu-btn { display: flex; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .docs-content h1 { font-size: 1.7rem; }
  .docs-content h2 { font-size: 1.3rem; }
  .page-nav { grid-template-columns: 1fr; }
  .code-block pre { padding: 12px 14px; }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .docs-sidebar { width: 200px; }
  .docs-content { margin-left: 200px; padding: 28px 28px 60px; }
}

/* Scroll animation is in /shared.css */
