/* Documentation pages (generated from site/content by site/build).
   Builds on style.css: same palette, nav, footer, buttons. */

:root {
  --read: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --sidebar-w: 250px;
  --toc-w: 220px;
}

.docs-body { background: var(--paper); }
.nav-wide { width: min(1440px, 100% - 40px); margin-inline: auto; }
.nav-menu { display: none; background: none; border: 0; color: #fff; padding: 6px; margin-right: 8px; cursor: pointer; }
.nav-docs.is-current { color: var(--yellow); opacity: 1; }

/* ------------------------------------------------------------ layout -- */

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 56px;
  align-items: start;
  padding: 40px 0 72px;
}

.docs-sidebar, .docs-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ----------------------------------------------------------- sidebar -- */

.docs-sidebar { font-size: .95rem; padding-bottom: 24px; }
.docs-sidebar ul { list-style: none; margin: 0 0 18px; padding: 0; }
.docs-sidebar a, .sidebar-home {
  display: block;
  text-decoration: none;
  color: var(--ink-soft);
  padding: .38em .8em .28em;
  border-radius: 8px;
  border-left: 3px solid transparent;
}
.docs-sidebar a:hover { color: var(--ink); background: rgba(43,43,42,.05); }
.docs-sidebar a.is-current {
  color: var(--ink);
  font-weight: 700;
  background: var(--yellow-soft);
  border-left-color: var(--yellow-deep);
  border-radius: 0 8px 8px 0;
}
.sidebar-home { font-weight: 600; margin-bottom: 14px; }
.sidebar-section {
  margin: 0 0 6px .8em;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* --------------------------------------------------------------- toc -- */

.docs-toc { font-size: .88rem; }
.toc-title { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 6px 0 10px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.docs-toc a {
  display: block;
  padding: .3em .9em .2em;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.35;
}
.docs-toc .toc-l3 a { padding-left: 1.8em; font-size: .95em; }
.docs-toc a:hover { color: var(--ink); }
.docs-toc a.is-active { color: var(--ink); font-weight: 700; border-left-color: var(--yellow-deep); }

/* -------------------------------------------------------------- prose -- */

.docs-main { min-width: 0; }
.docs-section { margin-bottom: 1rem; }

.prose { max-width: 780px; font-family: var(--read); font-size: 1.0625rem; line-height: 1.72; color: #34332f; }
.prose h1, .prose h2, .prose h3, .prose dt, .prose th { font-family: var(--sans); color: var(--ink); }
.prose h1 { font-size: clamp(2.1rem, 4vw, 2.8rem); font-weight: 700; margin: 0 0 .45em; }
.prose h1 + p { font-size: 1.22rem; line-height: 1.6; color: var(--ink-soft); margin-bottom: 1.6em; }
.prose h2 { font-size: 1.75rem; font-weight: 700; margin: 2.2em 0 .6em; padding-top: .2em; scroll-margin-top: 84px; }
.prose h3 { font-size: 1.28rem; font-weight: 700; margin: 1.8em 0 .5em; scroll-margin-top: 84px; }
.prose p, .prose ul, .prose ol, .prose dl { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--yellow-deep); font-weight: 700; }
.prose a { color: #6d5a06; text-decoration: underline; text-decoration-color: rgba(201,171,18,.55); text-underline-offset: .18em; text-decoration-thickness: 2px; }
.prose a:hover { color: var(--ink); text-decoration-color: var(--yellow-deep); }
.prose strong, .prose b { color: var(--ink); }
.prose code { font-size: .84em; background: rgba(43,43,42,.07); padding: .12em .38em; border-radius: 5px; color: var(--ink); overflow-wrap: anywhere; }
.prose a code { color: inherit; }
.prose pre code { color: #e8e6df; background: none; padding: 0; font-size: inherit; border-radius: 0; overflow-wrap: normal; }
.prose kbd, kbd {
  font-family: var(--mono); font-size: .78em; padding: .1em .45em; border-radius: 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; color: var(--ink);
}

.anchor { margin-left: .35em; color: var(--yellow-deep); text-decoration: none !important; opacity: 0; font-weight: 400; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }

/* code blocks */
.code { position: relative; margin: 0 0 1.3em; }
.code pre { margin: 0; font-size: 13.5px; line-height: 1.65; padding: 16px 18px; border-radius: 12px; }
.code-lang {
  position: absolute; top: 8px; right: 12px; z-index: 1;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #85827a;
  transition: opacity .15s;
}
.code-copy {
  position: absolute; top: 7px; right: 8px; z-index: 2;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  padding: .35em .75em .2em; border-radius: 999px; border: 1px solid #4a4843;
  background: #353431; color: #e8e6df; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.code:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code:hover .code-lang { opacity: 0; }
.code-copy.is-done { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* build-time syntax highlighting (highlight.php class names) */
.hljs-comment, .hljs-quote { color: #85827a; font-style: italic; }
.hljs-keyword, .hljs-built_in, .hljs-section, .hljs-title, .hljs-bullet, .hljs-selector-tag { color: var(--yellow); }
.hljs-string, .hljs-symbol, .hljs-regexp { color: #9bdc9d; }
.hljs-attr, .hljs-attribute, .hljs-name, .hljs-tag { color: #a9cbff; }
.hljs-number, .hljs-literal { color: #ff9a92; }
.hljs-variable, .hljs-template-variable, .hljs-subst { color: #cdbdff; }
.hljs-meta, .hljs-type { color: #ffc27a; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.55; }
.prose th { text-align: left; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: 12px 14px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.prose table.cmds td:first-child { width: 46%; }
.prose table.cmds td:first-child code { white-space: normal; background: none; padding: 0; font-weight: 600; }
.prose table.cmds td a { white-space: nowrap; }

/* definition lists */
.prose dt { font-weight: 700; font-size: 1.05rem; margin-top: 1em; }
.prose dd { margin: .25em 0 0; padding-left: 1em; border-left: 3px solid var(--yellow-soft); }

/* callouts */
.callout { position: relative; margin: 0 0 1.4em; padding: .95em 1.2em .3em; border-radius: 12px; border-left: 4px solid; font-size: 1rem; }
.callout::before { display: block; font-family: var(--sans); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .35em; }
.callout p { margin-bottom: .7em; }
.callout.note { background: #e9f0fc; border-color: #5b8def; }
.callout.note::before { content: 'Note'; color: #24508f; }
.callout.tip { background: #e3f2e2; border-color: #4caf50; }
.callout.tip::before { content: 'Tip'; color: #2c6a2f; }
.callout.warning { background: #fdecd6; border-color: #f0a04b; }
.callout.warning::before { content: 'Watch out'; color: #8a4b0b; }

/* numbered steps */
.prose ol.walkthrough { list-style: none; counter-reset: step; padding: 0; margin: 1.4em 0 2em; }
.prose ol.walkthrough > li { counter-increment: step; position: relative; padding: 0 0 1.2em 3.2em; margin: 0; border-left: 2px solid var(--line); margin-left: 1rem; }
.prose ol.walkthrough > li:last-child { border-left-color: transparent; }
.prose ol.walkthrough > li::before {
  content: counter(step);
  position: absolute; left: -1.05rem; top: -.1em;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; padding-top: 3px;
  background: var(--yellow); color: var(--ink); font-family: var(--sans); font-weight: 700;
}
.prose ol.walkthrough > li > h3 { margin-top: 0; }

/* figures */
.prose figure { margin: 0 0 1.6em; }
.prose figure.shot { border-radius: 12px; overflow: hidden; box-shadow: 0 24px 50px -28px rgba(43,43,42,.6); transform: none; }
.prose figcaption { font-size: .92rem; color: var(--ink-soft); margin-top: .6em; }
.sm-figure .sm-svg { min-width: 720px; }
.states-legend { font-size: .95rem; color: var(--ink-soft); }

/* docs home */
.quickstart { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 2em; }
.prose .quick {
  display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: .95rem; line-height: 1.45;
  transition: transform .15s, border-color .15s;
}
.prose .quick:hover { transform: translateY(-2px); border-color: var(--yellow-deep); color: var(--ink-soft); }
.prose .quick b { display: block; font-family: var(--sans); font-size: 1.1rem; color: var(--ink); margin-bottom: .15em; }
.prose .quick-wide { grid-column: 1 / -1; align-items: center; background: var(--yellow-soft); border-color: var(--yellow-deep); }
.quick-num { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--ink); color: var(--yellow); display: grid; place-items: center; font-family: var(--sans); font-weight: 700; padding-top: 3px; }
.prose ul.wants { list-style: none; padding: 0; }
.prose ul.wants li { padding-left: 1.5em; position: relative; }
.prose ul.wants li::before { content: '→'; position: absolute; left: 0; color: var(--yellow-deep); font-weight: 700; }

.docs-map { max-width: 980px; margin-top: 2.6rem; display: grid; gap: 2rem; }
.docs-map-section h2 { font-size: 1.35rem; margin: 0 0 .8rem; }
.docs-map-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.docs-map-section h2 { grid-column: 1 / -1; }
.docs-card { display: flex; flex-direction: column; gap: .3em; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.docs-card:hover { border-color: var(--yellow-deep); transform: translateY(-2px); }
.docs-card-title { font-weight: 700; font-size: 1.05rem; }
.docs-card-desc { font-family: var(--read); font-size: .9rem; line-height: 1.45; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* pager + edit link */
.docs-pager { max-width: 780px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 3.2rem; }
.docs-pager a { display: flex; flex-direction: column; gap: .2em; text-decoration: none; font-weight: 700; font-size: 1.05rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; transition: border-color .15s; }
.docs-pager a:hover { border-color: var(--yellow-deep); }
.docs-pager a span { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.pager-next { grid-column: 2; text-align: right; }
.docs-edit { max-width: 780px; margin-top: 1.4rem; font-size: .9rem; }
.docs-edit a { color: var(--ink-soft); }

/* -------------------------------------------------------- responsive -- */

@media (max-width: 1200px) {
  .docs-layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 900px) {
  .nav-menu { display: inline-flex; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .docs-sidebar {
    position: fixed; z-index: 20; top: 64px; left: 0; bottom: 0;
    width: min(300px, 86vw); max-height: none;
    background: var(--paper); padding: 20px 16px 40px;
    box-shadow: 20px 0 50px -20px rgba(43,43,42,.5);
    transform: translateX(-105%); transition: transform .2s ease;
  }
  .docs-sidebar.is-open { transform: none; }
  .quickstart, .docs-map-section { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .prose { font-size: 1rem; }
  .docs-pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
}
