/* storiasai.com/api — developer docs only. Reuses storias-site.css's tokens (colour, type, spacing,
   shadow) so the page reads as the same site; nothing here redefines a colour or a font. Kept in its own
   file so it never collides with edits to storias-site.css's own (unrelated) rules. */

.docs-hero-inner { padding-top: clamp(40px, 6vw, 84px); padding-bottom: clamp(32px, 4.5vw, 56px); max-width: 740px; }
.docs-facts { margin: 26px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: .02em; }
.docs-facts li { display: inline-flex; align-items: center; gap: 8px; }
.docs-facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ready); flex: none; }
.docs-facts code { font-family: var(--mono); background: var(--well); padding: 1px 7px; border-radius: 6px; }

.docs-page { max-width: 900px; margin: 0 auto; padding-bottom: clamp(56px, 8vw, 96px); }

.docs-toc { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: clamp(20px, 3vw, 32px); padding: 16px 18px; background: var(--card); border: 1px solid var(--hair); border-radius: 16px; box-shadow: var(--shadow); }
.docs-toc a { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--ink-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--well); white-space: nowrap; }
.docs-toc a:hover { color: var(--ink); background: var(--line); }

.docs-section { padding-top: clamp(48px, 6vw, 76px); border-top: 1px solid var(--hair); margin-top: clamp(48px, 6vw, 76px); }
.docs-section:first-of-type { border-top: 0; margin-top: 0; padding-top: clamp(36px, 5vw, 56px); }
.docs-section h2 { margin: 4px 0 0; font-weight: 900; font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.03em; line-height: 1.05; }
.docs-section > .section-intro { margin: 14px 0 0; color: var(--body); font-size: 16.5px; line-height: 1.55; max-width: 66ch; }
.docs-section > .section-intro code { font-family: var(--mono); background: var(--well); padding: 1px 7px; border-radius: 6px; font-size: .92em; }

/* ─── endpoints ────────────────────────────────────────────────────────────── */
.tag-group + .tag-group { margin-top: 48px; }
.tag-title { margin: 0; font-family: var(--mono); font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--coral-text); }
.tag-desc { margin: 6px 0 0; color: var(--meta); font-size: 14.5px; max-width: 66ch; }

.endpoint { margin-top: 24px; padding: 24px 26px 28px; background: var(--card); border: 1px solid var(--hair); border-radius: 20px; box-shadow: var(--shadow); scroll-margin-top: 18px; }
.endpoint-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.endpoint .method { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 10px; border-radius: 7px; color: #fff; }
.endpoint .method.get { background: var(--ready); }
.endpoint .method.post { background: var(--coral); }
.endpoint .method.put, .endpoint .method.patch, .endpoint .method.delete { background: var(--ink-2); }
.endpoint .path { font-family: var(--mono); font-size: 14.5px; color: var(--ink); word-break: break-all; }
.endpoint h4 { margin: 14px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.endpoint h5, .schema-block h4 { margin: 24px 0 8px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--meta); }
.endpoint p, .schema-block > p { margin: 8px 0 0; color: var(--body); font-size: 15px; line-height: 1.6; }
.endpoint p code, .schema-block p code, .note code, .tag-desc code { font-family: var(--mono); background: var(--well); padding: 1px 6px; border-radius: 5px; font-size: .9em; }

.schema-block { margin-top: 34px; padding-top: 6px; }
.schema-block:first-child { margin-top: 0; }

/* ─── field tables ─────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
table.field-table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 13.5px; }
.field-table th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--meta); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.field-table td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; color: var(--ink-2); line-height: 1.5; }
.field-table tr:last-child td { border-bottom: 0; }
.field-table td:first-child { white-space: nowrap; }
.field-table code { font-family: var(--mono); font-size: 12px; background: var(--well); padding: 1px 6px; border-radius: 5px; }
.field-table .req { display: inline-block; margin-inline-start: 6px; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--coral-text); background: rgba(255, 106, 77, .12); padding: 2px 6px; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.field-table .fmt { color: var(--meta); font-size: 11.5px; }
.note { margin: 12px 0 0; font-size: 13.5px; color: var(--meta); line-height: 1.5; }

/* ─── examples & code blocks ───────────────────────────────────────────────── */
.example { margin-top: 14px; }
.example-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--meta); margin-bottom: 6px; }

pre.code-block { position: relative; margin: 14px 0 0; padding: 18px 54px 18px 20px; background: var(--slate); color: var(--slate-ink); border-radius: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 12.5px; line-height: 1.6; box-shadow: var(--shadow); max-width: 100%; }
pre.code-block code { font-family: var(--mono); white-space: pre; }
.copy-btn { position: absolute; top: 10px; right: 10px; height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--slate-hair); background: rgba(246, 242, 232, .06); color: var(--slate-body); font: 600 10.5px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; transition: background 150ms ease, color 150ms ease, border-color 150ms ease; }
.copy-btn:hover { background: rgba(246, 242, 232, .16); color: var(--slate-ink); }
.copy-btn[data-copied="true"] { color: #8FE0A5; border-color: rgba(143, 224, 165, .4); }

/* ─── quick start steps ────────────────────────────────────────────────────── */
/* `min-width: 0` on every grid/flex item below matters, not just tidiness: a `pre` cannot break its
   line, so its min-content width is the length of the longest curl command — without this, that width
   demands the same from its grid item, which demands it from the grid, which demands it from the page,
   and a phone (or a narrow desktop pane) gets a horizontal scrollbar under the WHOLE site, not just the
   code block. `overflow-x: auto` on `pre.code-block` only gets to do its job once its container stops
   growing to fit it. */
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 36px; min-width: 0; }
.steps > li { min-width: 0; }
.steps > li h3 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.steps > li > p { margin: 8px 0 0; color: var(--body); font-size: 15px; line-height: 1.55; }
.steps > li > p code { font-family: var(--mono); background: var(--well); padding: 1px 6px; border-radius: 5px; font-size: .88em; }

/* ─── limits ────────────────────────────────────────────────────────────────── */
.limits-grid { margin-top: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.limit-card { padding: 20px 20px 22px; background: var(--card); border: 1px solid var(--hair); border-radius: 18px; box-shadow: var(--shadow); }
.limit-card .name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.limit-card ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.limit-card li::before { content: "✓ "; color: var(--ready); font-weight: 800; }

@media (max-width: 860px) {
  .limits-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .endpoint { padding: 18px 16px 20px; border-radius: 16px; }
  .endpoint h4 { font-size: 18px; }
  pre.code-block { padding: 16px 46px 16px 14px; font-size: 12px; border-radius: 12px; }
  .copy-btn { height: 26px; padding: 0 9px; font-size: 9.5px; }
  .docs-toc { gap: 6px 8px; padding: 12px 14px; }
  .docs-toc a { padding: 5px 10px; font-size: 11px; }
}
