/* numal.ai docs (17.11): one /docs for people and for agents, built by _src/build-docs.mjs from _src/docs/*.md. The blog's
   reading layout (page.css .doc + blog.css .doc.post); the docs menu takes the contents column, code sits in the
   template frame (.tpl), and every page has its Markdown copy for agents. Colors are page.css tokens, so dark.css holds. */

/* the bar: Docs reads as where you are on every docs page */
.nav a[aria-current="true"] { color: var(--fg); font-weight: 500; }

/* the docs menu on the left: Overview, then the two parts; the page you are on opens to its sections */
.docs .dnav { display: grid; gap: 22px; align-content: start; max-height: calc(100vh - var(--bar) - 48px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; scrollbar-width: thin; }
.dnav b { margin-bottom: 8px; }
.dnav a[aria-current="page"] { color: var(--fg); font-weight: 500; border-left-color: var(--fg); }
.dnav .dsub { margin: 2px 0 8px; border-left: 0; gap: 0; }
.dnav .dsub a { padding: 3px 0 3px 26px; font-size: 13px; line-height: 18px; }
.dnav .dsub a:hover { border-left-color: transparent; }

/* below 960px the menu folds above the title */
.dmenu { display: none; }

/* the page's own actions: the whole page as Markdown, for an agent */
.dacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.dacts .btn { height: 32px; padding: 0 13px 0 11px; gap: 7px; font-size: 13.5px; color: var(--soft); }
.dacts .btn:hover { color: var(--fg); }
.dacts svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.dacts .btn[data-done] { background: var(--green-wash); border-color: var(--green-wash); color: var(--green-ink); }

/* numbered steps */
.docs .prose ol.steps { counter-reset: step; list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.docs .prose ol.steps > li { counter-increment: step; position: relative; padding-left: 34px; }
.docs .prose ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--stone); color: var(--soft-2); font: 600 12px/22px var(--font); text-align: center; }
.docs .prose h3 { margin-top: 28px; }

/* code: the template frame, with a smaller caption */
.docs .tpl.code { margin-top: 16px; }
.docs .tpl.code figcaption { padding: 5px 6px 5px 16px; }
.docs .tpl.code figcaption b { font-size: 12.5px; font-weight: 500; color: var(--soft-2); }
.docs .tpl.code .copy { height: 28px; padding: 0 12px; font-size: 12.5px; }
.docs .tpl.code pre { padding: 14px 16px 16px; color: var(--fg); }

/* tables: two columns wrap at any width; long addresses break where they must */
.docs .tblwrap .tbl { min-width: 0; }
.docs .tbl td { overflow-wrap: anywhere; }
.docs .tbl[data-cols="3"] td:first-child { width: 22%; }
.docs .tbl[data-cols="3"] td:last-child { white-space: nowrap; color: var(--soft-2); }
.docs .tbl code { white-space: normal; }

/* the overview: each part as a grid of cards */
.dcards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prose .dcards li { padding: 0; }
.prose .dcards li::before { content: none; }
.prose .dcards a { display: block; height: 100%; padding: 16px 18px 18px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); text-decoration: none; box-shadow: 0 1px 2px rgba(15, 15, 15, .04); transition: border-color .15s, box-shadow .15s; }
.prose .dcards a:hover { border-color: var(--faint); box-shadow: 0 2px 8px rgba(15, 15, 15, .06); }
.dcards b { display: block; font-size: 15.5px; font-weight: 600; line-height: 22px; color: var(--fg); }
.dcards span { display: block; margin-top: 4px; font-size: 14px; line-height: 21px; color: var(--muted); }
.docs .prose > .note { margin-top: 40px; }

/* previous and next at the end of a page */
.pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.prose .pn a { display: block; padding: 13px 16px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .15s; }
.prose .pn a:hover { border-color: var(--line-2); }
.pn .next { grid-column: 2; text-align: right; }
.pn span { display: block; font-size: 12.5px; color: var(--muted); }
.pn b { display: block; margin-top: 2px; font-size: 15px; font-weight: 500; color: var(--fg); }

@media (max-width: 959px) {
  .docs .dnav { display: none; }
  .dmenu { display: block; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--tint); }
  .dmenu summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px 11px 16px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--fg); }
  .dmenu summary::-webkit-details-marker { display: none; }
  .dmenu summary svg { width: 16px; height: 16px; fill: none; stroke: var(--soft-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
  .dmenu[open] summary svg { transform: rotate(180deg); }
  .dmenu .dm-in { display: grid; gap: 14px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
  .dmenu b { font-size: 12.5px; font-weight: 600; color: var(--soft-2); }
  .dmenu ol { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
  .prose .dmenu a { display: block; padding: 6px 0; font-size: 15px; line-height: 22px; color: var(--soft); text-decoration: none; }
  .prose .dmenu a[aria-current="page"] { color: var(--fg); font-weight: 500; }
  .crumbs + .dmenu { margin-top: -4px; }
}
@media (max-width: 719px) {
  .dcards { grid-template-columns: minmax(0, 1fr); }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn .next { grid-column: 1; }
  .docs .tbl[data-cols="3"] td:first-child { width: 28%; }
  .docs .tpl.code pre { font-size: 12.5px; line-height: 20px; }
}
