/* Documentation pages. Shares tokens.css and site-header.css with the homepage. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--color-surface); color: var(--color-text); font-family: var(--font-ui), sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.skip-link { position: fixed; top: 16px; left: 24px; z-index: 2; padding: 12px 20px; border-radius: var(--radius-full); background: var(--color-ink); color: #fff; text-decoration: none; transform: translateY(calc(-100% - 32px)); }
.skip-link:focus { transform: translateY(0); }

.docs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 48px; max-width: var(--container-page); margin: 0 auto; padding: 32px 20px 96px; }

/* Left navigation */
.docs-nav { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; font-size: var(--text-sm); }
.docs-nav-toggle { display: none; }
.docs-nav section + section { margin-top: 24px; }
.docs-nav h2 { margin: 0 0 8px; font-size: var(--text-xs); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-text-muted); }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a { display: block; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--color-text-secondary); text-decoration: none; line-height: 20px; }
.docs-nav li a:hover { color: var(--color-text); background: var(--color-sand-50); }
.docs-nav li a[aria-current="page"] { color: var(--color-text); background: var(--color-sand-50); font-weight: var(--font-weight-medium); }

/* Right table of contents */
.docs-toc { position: sticky; top: 24px; align-self: start; font-size: var(--text-sm); }
.docs-toc h2 { margin: 0 0 8px; font-size: var(--text-xs); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-text-muted); }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--color-border); }
.docs-toc li a { display: block; padding: 4px 12px; color: var(--color-text-secondary); text-decoration: none; line-height: 20px; }
.docs-toc li a:hover { color: var(--color-text); }

/* Content */
.docs-content { min-width: 0; max-width: 760px; font-size: var(--text-md); line-height: var(--leading-relaxed); }
.docs-crumbs { margin: 0 0 12px; font-size: var(--text-sm); color: var(--color-text-muted); }
.docs-content h1 { margin: 0 0 12px; font-size: 40px; line-height: 44px; font-weight: var(--font-weight-semibold); letter-spacing: -0.03em; }
.lede { margin: 0 0 32px; font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--color-text-secondary); }
.docs-content h2 { margin: 48px 0 12px; padding-top: 16px; border-top: 1px solid var(--color-border); font-size: 24px; line-height: 30px; font-weight: var(--font-weight-semibold); letter-spacing: -0.02em; }
.docs-content h3 { margin: 28px 0 8px; font-size: var(--text-lg); line-height: 24px; font-weight: var(--font-weight-semibold); }
.docs-content p, .docs-content ul, .docs-content ol { margin: 0 0 16px; }
.docs-content li { margin-bottom: 6px; }
.docs-content li > p { margin-bottom: 6px; }
.docs-content a { text-decoration: underline; text-decoration-color: var(--color-stone); text-underline-offset: 3px; }
.docs-content a:hover { text-decoration-color: var(--color-ink); }
.docs-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--color-sand-50); border: 1px solid var(--color-border); border-radius: 4px; padding: 1px 5px; }
.docs-content pre { position: relative; margin: 0 0 20px; padding: 16px 72px 16px 18px; background: var(--color-ink); color: #fff; border-radius: var(--radius-md); overflow-x: auto; font-size: 13.5px; line-height: 20px; }
.docs-content pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.copy-button { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border: 1px solid #ffffff33; border-radius: var(--radius-full); background: #ffffff14; color: #fff; font: inherit; font-size: 12px; line-height: 16px; cursor: pointer; }
.copy-button:hover { background: #ffffff29; }
.docs-content blockquote { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--color-stone); background: var(--color-sand-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--color-text-secondary); }
.docs-content blockquote p:last-child { margin: 0; }
.table-scroll { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.docs-content table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 20px; }
.docs-content th, .docs-content td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-border); }
.docs-content th { background: var(--color-sand-50); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); }
.docs-content tr:last-child td { border-bottom: 0; }
.docs-content td code { white-space: nowrap; }
table.schema td.depth-1 { padding-left: 28px; }
table.schema td.depth-2 { padding-left: 44px; }
table.schema td.depth-1::before, table.schema td.depth-2::before { content: '↳ '; color: var(--color-text-muted); }
.muted { color: var(--color-text-muted); }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.endpoint code { font-size: var(--text-md); padding: 4px 10px; }
.method { display: inline-block; padding: 3px 10px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-wide); color: #fff; background: var(--color-ink); }
.method-get { background: var(--color-success); }
.method-post { background: var(--color-info); }
.method-patch { background: var(--color-warning); color: var(--color-ink); }
.method-delete { background: var(--color-danger); }
.scope { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* Previous and next */
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--color-border); }
.docs-pager a { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); text-decoration: none; font-weight: var(--font-weight-medium); }
.docs-pager a[rel="next"] { text-align: right; }
.docs-pager a span { font-size: var(--text-xs); font-weight: var(--font-weight-regular); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.docs-pager a:hover { background: var(--color-sand-50); }
.docs-footer { margin-top: 32px; font-size: var(--text-sm); color: var(--color-text-muted); }

@media (max-width: 1279px) {
  .docs-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 1023px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 16px; }
  .docs-nav { position: static; max-height: none; }
  .docs-nav-toggle { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-surface); font: inherit; font-size: var(--text-sm); font-weight: var(--font-weight-medium); cursor: pointer; }
  .docs-nav-list { display: none; margin-top: 16px; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
  .docs-nav-toggle[aria-expanded="true"] + .docs-nav-list { display: block; }
  .docs-content h1 { font-size: 32px; line-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
