/* ==========================================================================
   DemokratikKongo — Documentation
   Read surface in the JVM Runtime Inspector world: instrument ground, hairlines,
   Familjen Grotesk headings, JetBrains Mono for code and values.
   ========================================================================== */

.docs-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(11, 13, 18, 0.96);
  border-bottom: 1px solid var(--line);
}
.docs-topbar-left { display: flex; align-items: center; gap: 14px; }
.badge-docs {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 8px;
}
.docs-topbar-right { display: flex; align-items: center; gap: 20px; }
.docs-topbar-right a { font-size: 13px; font-family: var(--mono); color: var(--muted); transition: color 0.15s; }
.docs-topbar-right a:hover { color: var(--text); }

.docs-burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  width: 36px; height: 34px;
  cursor: pointer;
  font-size: 16px;
}

/* ---------- layout ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 56px;
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.docs-sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 22px 14px 60px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }

.docs-search { margin-bottom: 16px; position: relative; }
.docs-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.docs-search input:focus { border-color: var(--c1); }
.docs-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.docs-nav-group { margin-bottom: 6px; }
.docs-nav-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 10px 6px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.docs-nav-label .caret { transition: transform 0.2s; font-size: 10px; }
.docs-nav-group.collapsed .caret { transform: rotate(-90deg); }
.docs-nav-group.collapsed .docs-nav-items { display: none; }

.docs-nav-items { display: flex; flex-direction: column; gap: 1px; }
.docs-nav-items a {
  font-size: 13.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.docs-nav-items a:hover { color: var(--text); background: var(--surface); }
.docs-nav-items a.active {
  color: var(--text);
  background: rgba(125, 122, 255, 0.12);
}

/* ---------- content ---------- */
.docs-content { padding: 40px 48px 120px; max-width: 900px; min-width: 0; }

.docs-content h1 {
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.docs-content h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 64px 0 14px;
  padding-top: 8px;
  scroll-margin-top: 76px;
}
.docs-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 10px;
  scroll-margin-top: 76px;
}
.docs-content p { color: var(--dim); font-size: 15.5px; line-height: 1.75; margin-bottom: 16px; }
.docs-content p strong { color: var(--text); }
.docs-content a { color: var(--c1); }
.docs-content ul, .docs-content ol { margin: 0 0 16px 22px; color: var(--dim); font-size: 15px; line-height: 1.75; }
.docs-content li { margin-bottom: 6px; }
.docs-content code {
  font-family: var(--mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}
.docs-content pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}
.docs-content pre code { background: none; border: none; padding: 0; color: inherit; }
.docs-content blockquote {
  border-left: 1px solid var(--line-strong);
  padding: 4px 0 4px 18px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14.5px;
}

.docs-lede { font-size: 17px !important; color: var(--dim) !important; }

/* ---------- callouts ---------- */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 3px;
  margin: 20px 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--dim);
}
.callout .callout-icon { flex-shrink: 0; font-size: 16px; line-height: 1.4; }
.callout strong { color: var(--text); }
.callout-info { border: 1px solid rgba(125, 122, 255, 0.35); background: rgba(125, 122, 255, 0.07); }
.callout-warn { border: 1px solid rgba(240, 178, 74, 0.4); background: rgba(240, 178, 74, 0.07); }
.callout-danger { border: 1px solid rgba(243, 101, 109, 0.4); background: rgba(243, 101, 109, 0.07); }
.callout-info .callout-icon { color: var(--c1); }
.callout-warn .callout-icon { color: var(--warn); }
.callout-danger .callout-icon { color: var(--danger); }

/* ---------- module reference ---------- */
.category-block { margin-bottom: 56px; }
.category-block > h2 { margin-bottom: 8px; }
.category-count { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: -6px 0 22px; }

.doc-module {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-2);
  margin-bottom: 22px;
  overflow: hidden;
  scroll-margin-top: 76px;
}
.doc-module-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.doc-module-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 3px;
  background: rgba(125, 122, 255, 0.12);
  color: var(--c1);
  flex-shrink: 0;
}
.doc-module-title { flex: 1; }
.doc-module-title h3 { margin: 0; font-size: 16px; font-weight: 600; }
.doc-module-title .doc-module-desc { font-size: 13px; color: var(--dim); margin-top: 3px; }
.doc-module-key { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }

.doc-settings { padding: 6px 18px 10px; }
.doc-settings-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 4px;
}

.setting { padding: 11px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setting-name { font-size: 13.5px; font-weight: 600; color: var(--text); font-family: var(--mono); }
.setting-type {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
}
.type-toggle { color: var(--live); border-color: rgba(52, 209, 123, 0.35); background: rgba(52, 209, 123, 0.08); }
.type-slider { color: #22d3ee; border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }
.type-range { color: #22d3ee; border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }
.type-dropdown { color: #8b5cf6; border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.08); }
.type-keybind { color: var(--warn); border-color: rgba(240, 178, 74, 0.35); background: rgba(240, 178, 74, 0.08); }
.type-color { color: #f472b6; border-color: rgba(244, 114, 182, 0.35); background: rgba(244, 114, 182, 0.08); }
.type-text { color: #a5b4fc; border-color: rgba(165, 180, 252, 0.35); background: rgba(165, 180, 252, 0.08); }
.type-button { color: var(--danger); border-color: rgba(243, 101, 109, 0.35); background: rgba(243, 101, 109, 0.08); }
.setting-default { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-left: auto; }
.setting-meta { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 4px; }
.setting-desc { font-size: 13px; color: var(--dim); line-height: 1.6; margin-top: 4px; }
.setting-desc code { font-size: 12px; }

/* ---------- chips ---------- */
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  color: var(--dim);
  background: var(--panel);
  margin-right: 6px;
  margin-bottom: 6px;
}

/* ---------- footer ---------- */
.docs-footer {
  border-top: 1px solid var(--line);
  padding: 24px 48px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  max-width: 1400px;
  margin: 0 auto;
}
.docs-footer a { color: var(--text); }
.docs-footer a:hover { color: var(--c1); }

/* ---------- search results ---------- */
.doc-module.hidden { display: none; }
.category-block.hidden { display: none; }
.docs-no-results { display: none; padding: 30px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed;
    left: 0; top: 56px;
    width: 270px;
    transform: translateX(-100%);
    transition: transform 0.25s;
    background: #0a0c11;
    z-index: 90;
    border-right: 1px solid var(--line);
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-burger { display: block; }
  .docs-content { padding: 28px 22px 100px; }
  .docs-footer { padding: 24px 22px; }
}
