/* Docs layout for CyberLens — top-level section tabs + per-page sidebar nav +
   prose content, dark theme (relies on .cyberlens-dark tokens from cyberlens.css). */

/* ---------- top-level section tabs (persistent across every docs page) ---------- */
.docs-topnav {
  position: sticky;
  top: 72px;
  z-index: 40;
  background: var(--paper-0);
  border-bottom: 1px solid var(--ink-100);
}
.docs-topnav .container { display: flex; gap: 4px; overflow-x: auto; }
.docs-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-500);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.docs-tab:hover { color: var(--ink-900); }
.docs-tab.is-active { color: var(--ink-900); border-bottom-color: var(--proj-accent); }
.docs-tab .docs-tab-index { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-300); }

/* ---------- shell: sidebar + content ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding: clamp(32px, 5vw, 56px) 0 clamp(64px, 8vw, 96px);
  align-items: start;
}
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; gap: 24px; }
}

.docs-sidebar {
  position: sticky;
  top: 132px;
  max-height: calc(100vh - 152px);
  overflow-y: auto;
  padding-bottom: 24px;
}
@media (max-width: 900px) {
  .docs-sidebar { position: static; max-height: none; overflow-y: visible; }
}

.docs-search {
  width: 100%;
  background: var(--paper-100);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-s);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 8px 12px;
  margin-bottom: 18px;
}
.docs-search:focus { outline: 2px solid var(--proj-accent); outline-offset: 1px; }
.docs-search::placeholder { color: var(--ink-500); }

.docs-nav-group { margin-bottom: 20px; }
.docs-nav-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 0 0 8px;
}
.docs-nav-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.docs-nav-group a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-s);
  font-size: 0.88rem;
  color: var(--ink-700);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.docs-nav-group a:hover { background: var(--paper-100); color: var(--ink-900); }
.docs-nav-group a.is-active { color: var(--proj-accent); border-left-color: var(--proj-accent); background: var(--paper-100); }

.docs-content { min-width: 0; }
.docs-section { padding-top: 8px; margin-bottom: 56px; scroll-margin-top: 148px; }
.docs-section:first-child { padding-top: 0; }
.docs-section h2 { font-size: 1.5rem; margin-bottom: 14px; }
.docs-section h3 { font-size: 1.05rem; margin: 28px 0 10px; color: var(--ink-900); }
.docs-section p { color: var(--ink-700); max-width: 72ch; }
.docs-section ul, .docs-section ol { color: var(--ink-700); max-width: 72ch; padding-left: 1.3em; }
.docs-section li { margin-bottom: 6px; }
.docs-section li > code { white-space: nowrap; }
.docs-section strong { color: var(--ink-900); }

.docs-callout {
  border: 1px solid var(--ink-100);
  border-left: 3px solid var(--proj-accent);
  background: var(--paper-100);
  border-radius: var(--radius-s);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: var(--ink-700);
  max-width: 72ch;
  margin: 16px 0;
}
.docs-callout strong { color: var(--ink-900); }

/* ---------- overview page: link cards to the 3 other sections ---------- */
.docs-link-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 8px; }
@media (max-width: 760px) { .docs-link-cards { grid-template-columns: 1fr; } }
.docs-link-card {
  display: block;
  text-decoration: none;
  background: var(--paper-100);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-m);
  padding: 20px 22px;
  transition: transform .15s ease, border-color .15s ease;
}
.docs-link-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--proj-accent) 40%, var(--ink-100)); }
.docs-link-card .dlc-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--proj-accent); }
.docs-link-card h3 { margin: 8px 0 6px; font-size: 1rem; color: var(--ink-900); }
.docs-link-card p { margin: 0; font-size: 0.86rem; color: var(--ink-500); max-width: none; }

/* ---------- code blocks ---------- */
.docs-code { position: relative; background: #0d1117; border: 1px solid var(--ink-100); border-radius: var(--radius-m); padding: 16px 18px; overflow-x: auto; margin: 14px 0 20px; }
.docs-code pre { margin: 0; font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.7; color: #C9D1D9; white-space: pre; padding-right: 70px; }
.docs-code .cmt { color: var(--ink-500); }
.docs-copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono); font-size: 0.72rem;
  background: rgba(255,255,255,0.06); color: var(--ink-300);
  border: 1px solid rgba(255,255,255,0.14); border-radius: var(--radius-s);
  padding: 4px 10px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.docs-copy-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

code:not(.docs-code code) {
  background: var(--paper-100);
  border: 1px solid var(--ink-100);
  border-radius: 5px;
  padding: 0.12em 0.4em;
  font-size: 0.88em;
}

/* ---------- reference tables ---------- */
.docs-table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 10px; flex-wrap: wrap; }
.docs-table-filter {
  background: var(--paper-100); border: 1px solid var(--ink-100); border-radius: var(--radius-s);
  color: var(--ink-900); font-family: var(--font-body); font-size: 0.86rem;
  padding: 7px 12px; min-width: 220px;
}
.docs-table-filter::placeholder { color: var(--ink-500); }

.docs-table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--ink-100); border-radius: var(--radius-m); }
.docs-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.docs-table th, .docs-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--ink-100); vertical-align: top; }
.docs-table th { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); background: var(--paper-100); white-space: nowrap; }
.docs-table tr:last-child td { border-bottom: none; }
.docs-table td:first-child { font-family: var(--font-mono); font-size: 0.85rem; color: var(--proj-accent); white-space: nowrap; }
.docs-table td p { margin: 0; max-width: none; }

.docs-flag { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-900); white-space: nowrap; }

/* ---------- module type badges ---------- */
.mtag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; margin: 2px 4px 2px 0; }
.mtag-passive { background: rgba(52,196,248,0.12); color: var(--cyan-300); border: 1px solid rgba(52,196,248,0.3); }
.mtag-active { background: rgba(225,69,85,0.12); color: #ff8a95; border: 1px solid rgba(225,69,85,0.3); }
.mtag-browser { background: rgba(168,85,247,0.12); color: #d4b3fb; border: 1px solid rgba(168,85,247,0.3); }
.mtag-auth { background: rgba(234,179,8,0.12); color: #fde68a; border: 1px solid rgba(234,179,8,0.3); }
