/* ============================================================
   Docs layout — uses only tokens from site.css
   ============================================================ */

/* Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 0;
}

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

.docs-sidebar-section {
  margin-bottom: 1.75rem;
}

.docs-sidebar-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 0 0.75rem;
  margin-bottom: 0.35rem;
}

.docs-sidebar a {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  line-height: 1.4;
  transition:
    color 0.15s,
    background 0.15s;
}

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

.docs-sidebar a[aria-current='page'] {
  color: var(--accent);
  background: var(--bg-accent);
  font-weight: 600;
}

.docs-sidebar-changelog {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  display: block;
  transition:
    color 0.15s,
    background 0.15s;
}

.docs-sidebar-changelog:hover {
  color: var(--text);
  background: var(--bg-accent);
}

/* ── Content area ────────────────────────────────────────── */
.docs-content {
  padding: 2.5rem 0 4rem 3rem;
  min-width: 0;
  max-width: 760px;
}

.docs-content article h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.docs-content article .docs-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  line-height: 1.6;
}

.docs-content article h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  color: var(--text);
}

.docs-content article h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}

.docs-content article p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.docs-content article ul,
.docs-content article ol {
  margin: 0 0 1rem 1.25rem;
  color: var(--text-muted);
}

.docs-content article li {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

.docs-content article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}

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

/* ── Tables ──────────────────────────────────────────────── */
.docs-content article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0 0 1.5rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.docs-content article thead {
  background: var(--bg-accent);
}

.docs-content article th,
.docs-content article td {
  padding: 0.65rem 1rem;
  text-align: left;
  border: 1px solid var(--surface-border);
  vertical-align: top;
  line-height: 1.5;
}

.docs-content article th {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

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

.docs-content article tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--bg-accent) 40%, transparent);
}

/* ── Code ────────────────────────────────────────────────── */
.docs-content article code {
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: 0.85em;
  background: var(--bg-accent);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--accent-strong);
}

.docs-content article pre {
  background: var(--bg-strong);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.docs-content article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text);
}

/* ── Callouts ────────────────────────────────────────────── */
.docs-callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.docs-callout--warning {
  border-left-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 8%, var(--bg));
}

.docs-callout--danger {
  border-left-color: #ef4444;
  background: color-mix(in srgb, #ef4444 8%, var(--bg));
}

.docs-callout strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}

/* ── Step list ───────────────────────────────────────────── */
.docs-steps {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  counter-reset: steps;
}

.docs-steps li {
  counter-increment: steps;
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.docs-steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Pagination ──────────────────────────────────────────── */
.docs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--surface-border);
  gap: 1rem;
}

.docs-pagination a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--bg-elevated);
  transition:
    background 0.15s,
    border-color 0.15s;
}

.docs-pagination a:hover {
  background: var(--bg-accent);
  border-color: var(--accent);
}

.docs-pagination-next {
  margin-left: auto;
}

/* ── Docs landing cards ──────────────────────────────────── */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.docs-card {
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
  display: block;
}

.docs-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.docs-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.docs-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.docs-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--surface-border);
    padding: 1.25rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .docs-sidebar-section {
    margin-bottom: 0;
  }

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

  .docs-sidebar a {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .docs-content {
    padding: 1.75rem 0 3rem;
  }

  .docs-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .docs-pagination-next {
    margin-left: 0;
  }
}
