/* Developer docs: a sidebar of pages, a readable column, code blocks with a copy button. Built on site.css. */

.docs { padding: clamp(28px, 4vw, 56px) 0 clamp(64px, 8vw, 110px); }
.docs-grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }

/* Sidebar */
.docs-side { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; padding-bottom: 24px; }
.docs-side-title { margin: 0 0 14px; font: 600 0.78rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.docs-nav { display: grid; gap: 22px; }
.docs-nav p { margin: 0 0 6px; font-size: 0.82rem; font-weight: 600; color: var(--ink-3); }
.docs-nav ul { display: grid; gap: 2px; }
.docs-nav a { display: block; padding: 7px 12px; border-radius: var(--r-s); font-size: 0.95rem; color: var(--ink-2); text-decoration: none; }
.docs-nav a:hover { background: var(--canvas); color: var(--ink); }
.docs-nav a[aria-current="page"] { background: var(--canvas); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--violet); }
.docs-toggle { display: none; }

/* Article */
.docs-body { min-width: 0; max-width: 46rem; }
.docs-body .eyebrow { margin-bottom: 14px; }
.docs-body h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); margin-bottom: 18px; }
.docs-body > .lede { margin-bottom: 36px; }
.docs-body h2 { font-size: clamp(1.45rem, 2.2vw, 1.8rem); margin: 52px 0 14px; scroll-margin-top: 90px; }
.docs-body h3 { font-size: 1.15rem; margin: 32px 0 10px; scroll-margin-top: 90px; }
.docs-body p { margin: 0 0 16px; color: var(--ink-2); }
.docs-body p strong, .docs-body li strong { color: var(--ink); }
.docs-body ul, .docs-body ol { margin: 0 0 18px; padding-left: 1.3em; color: var(--ink-2); }
.docs-body ul { list-style: disc; }
.docs-body ol { list-style: decimal; }
.docs-body li { margin: 6px 0; padding-left: 4px; }
.docs-body a { color: var(--violet); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.docs-body a:hover { color: var(--ink); }
.docs-body :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--canvas); border: 1px solid var(--line); color: var(--ink); font: 0.86em/1.4 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }

/* Code blocks */
.docs-code { position: relative; margin: 6px 0 24px; }
.docs-code pre { margin: 0; padding: 20px 22px; border-radius: var(--r-m); background: var(--ink); color: #e9e5f2; font: 0.84rem/1.7 ui-monospace, "SF Mono", Menlo, monospace; overflow-x: auto; white-space: pre; tab-size: 2; }
.docs-code .label { position: absolute; top: 10px; left: 22px; font: 600 0.7rem/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; color: #8f88a2; }
.docs-code .label + pre { padding-top: 34px; }
.docs-copy { position: absolute; top: 8px; right: 8px; height: 30px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: #e9e5f2; font-size: 0.78rem; font-weight: 550; cursor: pointer; opacity: 0.85; }
.docs-copy:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }

/* Notes, tables, cards */
.docs-note { margin: 0 0 22px; padding: 14px 18px; border-radius: var(--r-m); background: var(--canvas); border: 1px solid var(--line); color: var(--ink-2); font-size: 0.96rem; }
.docs-note p:last-child { margin-bottom: 0; }
.docs-note strong { color: var(--ink); }
.docs-soon { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: #f1ecff; color: #5b3fd6; font: 600 0.72rem/1.5 var(--body); letter-spacing: 0.02em; vertical-align: middle; white-space: nowrap; }
.docs-table { width: 100%; margin: 6px 0 26px; border-collapse: collapse; font-size: 0.92rem; }
.docs-table-wrap { overflow-x: auto; margin: 0 0 8px; }
.docs-table th, .docs-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--ink-2); }
.docs-table th { font-weight: 600; color: var(--ink); background: var(--canvas); }
.docs-table td code { white-space: normal; overflow-wrap: anywhere; }
.docs-table td:first-child code { white-space: nowrap; }
.docs-table th:nth-child(2), .docs-table td:nth-child(2) { min-width: 9.5em; }
.docs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 8px 0 30px; }
.docs-cards a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-card); }
.docs-cards a:hover { border-color: var(--line-strong); }
.docs-cards strong { display: block; margin-bottom: 4px; font-size: 1.02rem; }
.docs-cards span { display: block; color: var(--ink-2); font-size: 0.92rem; line-height: 1.5; }
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.docs-pager a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); }
.docs-pager a span { font-size: 0.8rem; color: var(--ink-3); }
.docs-pager a:last-child { text-align: right; margin-left: auto; }

@media (max-width: 900px) {
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .docs-side { position: static; max-height: none; overflow: visible; padding: 0; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--canvas); }
  .docs-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; border: 0; background: none; font-weight: 600; cursor: pointer; text-align: left; }
  .docs-toggle::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translateY(-3px); transition: transform 0.15s; }
  .docs-side.is-open .docs-toggle::after { transform: rotate(-135deg) translateY(-2px); }
  .docs-side .docs-side-title { display: none; }
  .docs-side .docs-nav { display: none; padding: 0 12px 16px; }
  .docs-side.is-open .docs-nav { display: grid; }
  .docs-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .docs-code pre { padding: 18px 16px; font-size: 0.8rem; border-radius: var(--r-s); }
  .docs-code .label { left: 16px; }
  .docs-pager { flex-direction: column; }
  .docs-pager a:last-child { text-align: left; margin-left: 0; }
}
