/* hakobu.dev/docs, on top of style.css: a menu on the left, the page, and
   what's on it on the right. Pages are made by tools/docsgen. */
.docs-wrap { max-width: 1320px; }
.docs-brand { display: inline-flex; align-items: center; gap: 10px; }
.docs-label { color: var(--fg-muted); font-weight: 500; font-size: 14px; border-left: 1px solid var(--border); padding-left: 10px; }
.docs-label:hover { color: var(--fg); text-decoration: none; }

.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 48px; align-items: start; padding-top: 40px; padding-bottom: 96px; }
.docs-menu { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.docs-menu > summary { display: none; }
.docs-nav { display: flex; flex-direction: column; gap: 1px; }
.docs-nav-section { color: var(--fg-muted); font-size: 12px; font-weight: 600; padding: 16px 10px 6px; }
.docs-nav-section:first-child { padding-top: 0; }
.docs-nav a { position: relative; color: var(--fg); font-size: 14px; border-radius: var(--radius); padding: 5px 10px; }
.docs-nav a:hover { background: var(--bg-hover); text-decoration: none; }
.docs-nav a[aria-current="page"] { background: var(--bg-hover); font-weight: 600; }
.docs-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -6px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--accent); }

.docs-toc { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.docs-toc-title { color: var(--fg-muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.docs-toc a { color: var(--fg-muted); padding: 3px 0; line-height: 1.4; }
.docs-toc a:hover { color: var(--fg); text-decoration: none; }
.docs-toc .toc-3 { padding-left: 12px; }

/* The page */
.docs-main { min-width: 0; }
.prose { max-width: 72ch; font-size: 15px; line-height: 1.7; }
.prose h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 20px; }
.prose h2 { font-size: 22px; line-height: 1.3; font-weight: 650; letter-spacing: -0.02em; margin: 48px 0 12px; padding-top: 8px; scroll-margin-top: 72px; }
.prose h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 32px 0 8px; scroll-margin-top: 72px; }
.prose p, .prose ul, .prose ol, .prose pre, .prose table, .prose blockquote { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose strong { font-weight: 600; }
.prose a { text-underline-offset: 2px; }
.prose a:hover { text-decoration: underline; }
.prose :not(pre) > code { font-family: var(--mono); font-size: .85em; background: var(--bg-muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.prose pre { background: var(--console-bg); color: var(--console-fg); border-radius: var(--radius-lg); padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); }
.prose pre code { font: inherit; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--accent-subtle); border-radius: 0 var(--radius) var(--radius) 0; padding: 10px 16px; color: var(--fg); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.prose th { text-align: left; color: var(--fg-muted); font-size: 12px; font-weight: 600; background: var(--bg-muted); }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; vertical-align: top; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

.docs-pager { max-width: 72ch; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.docs-pager a { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; color: var(--fg); font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.docs-pager a:hover { border-color: var(--accent); text-decoration: none; }
.docs-pager span { color: var(--fg-muted); font-size: 12px; font-weight: 500; }
.docs-next { text-align: right; grid-column: 2; }

@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 20px; }
  .docs-menu { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius-lg); }
  .docs-menu > summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-weight: 600; cursor: pointer; list-style: none; }
  .docs-menu > summary::after { content: "▾"; color: var(--fg-muted); }
  .docs-menu[open] > summary { border-bottom: 1px solid var(--border); }
  .docs-menu .docs-nav { padding: 8px; }
}

/* Title, and the page as Markdown for AI assistants */
.docs-head { margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.docs-head h1 { margin: 0; }
.docs-md { display: flex; gap: 8px; margin-top: 6px; }
