/* ─── PRism — docs.css — documentation page styles ────────────────────── */

.docs-page {
  flex: 1;
  padding: 0 24px;
}

/* ── Two-column layout: sidebar + content ───────────────────────────────── */
.docs-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
  padding-top: 32px;
}

/* ── Sidebar TOC ────────────────────────────────────────────────────────── */
.docs-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 16px 0;
}

.docs-toc h3 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-hint);
  margin-bottom: 12px;
}

.docs-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-toc li {
  margin-bottom: 4px;
}

.docs-toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1.4;
}

.docs-toc a:hover {
  background: rgba(255,255,255,.04);
  color: var(--text-primary);
  text-decoration: none;
}

/* ── Main content area ──────────────────────────────────────────────────── */
.docs-wrap {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 64px;
}

.docs-wrap h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.docs-lead {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 40px;
}

/* ── Section ────────────────────────────────────────────────────────────── */
.docs-section {
  margin-bottom: 40px;
  scroll-margin-top: 80px;
}

.docs-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.docs-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-primary);
}

.docs-section p {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.docs-section ul,
.docs-section ol {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.7;
  margin: 0 0 16px 20px;
}

.docs-section li {
  margin-bottom: 6px;
}

.docs-section code {
  font-size: .85em;
}

.docs-section pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: .82rem;
  overflow-x: auto;
  margin-bottom: 16px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ── ASCII / architecture diagram ───────────────────────────────────────── */
.docs-ascii {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  font-size: .75rem;
  line-height: 1.45;
  overflow-x: auto;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre;
}

/* ── Info callout ───────────────────────────────────────────────────────── */
.docs-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--brand-purple-bg);
  border: 1px solid rgba(56,139,253,.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.docs-callout strong {
  color: var(--brand-purple-lt);
}

.docs-callout-example {
  background: var(--surface);
  border-color: var(--border);
}

.docs-callout-example strong {
  color: var(--text-primary);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.docs-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  line-height: 1.55;
}

.docs-table thead {
  background: var(--surface-3);
}

.docs-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: .8rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.docs-table td {
  padding: 9px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.docs-table tbody tr:last-child td {
  border-bottom: none;
}

.docs-table tbody tr:hover {
  background: rgba(255,255,255,.02);
}

.docs-table code {
  font-size: .82em;
}

/* ── Agent card grid ────────────────────────────────────────────────────── */
.agent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.agent-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.agent-card:hover {
  border-color: var(--brand-purple);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.agent-card h4 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.agent-card p {
  font-size: .8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── Footer (matched with landing) ──────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 28px 24px;
  background: #010409;
}

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  color: var(--text-hint);
}

.footer-logo { width: 22px; height: 22px; }

.footer-links {
  display: flex;
  gap: 20px;
  font-size: .82rem;
}

.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--brand-purple-lt); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 24px;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 24px;
  }
  .docs-toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
  }
  .docs-toc a {
    font-size: .75rem;
    padding: 4px 8px;
  }
}

@media (max-width: 640px) {
  .docs-wrap { margin: 0 auto; padding-bottom: 40px; }
  .agent-cards { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
