/* RobiOS Docs — sidebar + article layout on the site's token system */

.docs-body { background: var(--bg-base); }
.docs-nav-label { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.docs-search {
  height: 32px; width: 200px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-primary);
}
.docs-search::placeholder { color: var(--text-faint); }
.docs-search:focus { outline: none; box-shadow: var(--ring-accent); }

.docs-shell {
  max-width: 1200px;
  margin-inline: auto;
  padding: 24px 16px 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
}

/* ---------- sidebar ---------- */
.docs-side {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
  padding-right: 8px;
}
.docs-group {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 18px 0 6px;
}
.docs-tree a {
  display: block;
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-ui),
              background-color var(--dur-fast) var(--ease-ui);
}
.docs-tree a:hover { color: var(--text-primary); background: var(--bg-white-5); }
.docs-tree a.active {
  color: var(--accent);
  background: var(--accent-05);
  border-left-color: var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.docs-tree a.docs-hidden { display: none; }

/* ---------- articles ---------- */
.docs-doc { display: none; max-width: 720px; }
.docs-doc.active { display: block; animation: docs-in 0.3s var(--ease-pop); }
@keyframes docs-in { from { opacity: 0; transform: translateY(6px); } }

.docs-crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}
.docs-doc h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 34px; font-weight: 700;
  letter-spacing: var(--ls-display);
}
.docs-lead {
  margin-top: 10px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.docs-doc h2 {
  margin: 28px 0 10px;
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  letter-spacing: var(--ls-display);
}
.docs-doc p { margin: 10px 0; font-size: 14.5px; line-height: 1.65; color: var(--text-secondary); }
.docs-doc p b, .docs-doc li b { color: var(--text-primary); }
.docs-doc ul { margin: 10px 0 10px 18px; }
.docs-doc li { font-size: 14.5px; line-height: 1.7; color: var(--text-secondary); }
.docs-doc a { color: var(--accent); }
.docs-doc a:hover { text-decoration: underline; }
.docs-doc code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-card);
  border-radius: 4px;
  padding: 1px 5px;
}

.doc-code {
  position: relative;
  margin: 14px 0;
  background: var(--bg-terminal);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  overflow-x: auto;
}
.doc-code code {
  background: none; padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #C9D1C4;
  white-space: pre;
}
.doc-copy {
  position: absolute;
  top: 8px; right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  background: var(--bg-white-5);
  border-radius: 6px;
  padding: 3px 8px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-ui), color var(--dur-fast) var(--ease-ui);
}
.doc-code:hover .doc-copy { opacity: 1; }
.doc-copy:hover { color: var(--accent); }

.docs-next {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.docs-next a {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  letter-spacing: var(--ls-display);
  color: var(--accent);
}

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; gap: 16px; }
  .docs-side { position: static; max-height: none; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 8px; }
  .docs-tree { display: flex; gap: 4px; align-items: center; }
  .docs-group { display: none; }
  .docs-tree a { white-space: nowrap; border-left: 0; }
  .docs-search { display: none; }
}
