/* docs.ferogram.dev - layered on top of assets/style.css */

.docs-shell {
  display: flex;
  align-items: flex-start;
  gap: 56px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

/* Sidebar */
.docs-sidebar {
  width: 232px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding-bottom: 24px;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.side-group { margin-bottom: 26px; }
.side-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
  padding: 0 10px;
}
.docs-sidebar a {
  display: block;
  font-size: 13.5px;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.4;
  transition: background 0.12s ease, color 0.12s ease;
}
.docs-sidebar a:hover { color: var(--text); background: var(--surface); }
.docs-sidebar a.active { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font-weight: 600; }
@media (max-width: 980px) {
  .docs-sidebar { display: none; }
  .docs-shell { padding-top: 24px; }
}

/* Content */
.docs-content { flex: 1; min-width: 0; max-width: 760px; }
.docs-intro { margin-bottom: 56px; }
.docs-intro .eyebrow { margin-bottom: 14px; }
.docs-intro h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.12; margin-bottom: 14px; }
.docs-intro p.lead { font-size: 16.5px; color: var(--text-dim); line-height: 1.65; max-width: 640px; }

.docs-section { padding: 52px 0; border-top: 1px solid var(--border-soft); scroll-margin-top: 84px; }
.docs-section:first-of-type { border-top: none; padding-top: 0; }
.docs-section .sec-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.docs-section h2 { font-size: 26px; margin-bottom: 10px; scroll-margin-top: 84px; }
.docs-section h3 { font-size: 18px; margin: 28px 0 10px; scroll-margin-top: 84px; }
.docs-section > p { color: var(--text-dim); font-size: 15px; line-height: 1.7; margin-bottom: 14px; }
.docs-section ul, .docs-section ol { color: var(--text-dim); font-size: 15px; line-height: 1.8; padding-left: 20px; margin: 10px 0 16px; }
.docs-section li { margin-bottom: 4px; }
.docs-section li strong { color: var(--text); }
.docs-section a.inline-link { color: var(--tg); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--tg) 40%, transparent); }
.docs-section a.inline-link:hover { border-color: var(--tg); }

/* Callouts */
.doc-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin: 18px 0;
  background: var(--surface);
}
.doc-callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.doc-callout .cal-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.doc-callout .cal-body { font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.doc-callout .cal-body code { font-size: 13px; }
.doc-callout.info { border-color: color-mix(in srgb, var(--core) 45%, var(--border)); background: color-mix(in srgb, var(--core) 7%, var(--surface)); }
.doc-callout.info svg { color: var(--core); }
.doc-callout.warn { border-color: color-mix(in srgb, var(--rust) 45%, var(--border)); background: color-mix(in srgb, var(--rust) 7%, var(--surface)); }
.doc-callout.warn svg { color: var(--rust); }
.doc-callout.danger { border-color: color-mix(in srgb, #ef4444 45%, var(--border)); background: color-mix(in srgb, #ef4444 7%, var(--surface)); }
.doc-callout.danger svg { color: #ef4444; }

/* Tables */
.docs-table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); }
table.docs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; }
.docs-table th, .docs-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.docs-table th { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); background: var(--surface); }
.docs-table tr:last-child td { border-bottom: none; }
.docs-table td code, .docs-table td .mono { font-size: 12.5px; background: var(--surface); padding: 2px 6px; border-radius: 5px; }

/* Docs-local language switch (reuses .switch look) */
.docs-switch { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.docs-switch button {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: none;
  background: transparent; color: var(--text-dim); cursor: pointer; display: flex; align-items: center; gap: 7px;
}
.docs-switch button .chip { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.docs-switch button[data-doclang="rust"] .chip { background: var(--rust); }
.docs-switch button[data-doclang="python"] .chip { background: var(--python); }
.docs-switch button.active { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.docs-panel { display: none; animation: fade 0.15s ease; }
.docs-panel.active { display: block; }

/* Ecosystem map: reuse crate-card look for docs.rs links */
.ecomap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0 8px; }
@media (max-width: 900px) { .ecomap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ecomap-grid { grid-template-columns: 1fr; } }
.ecomap-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 28px; }
@media (max-width: 640px) { .ecomap-hub { grid-template-columns: 1fr; } }
.ecomap-hub .crate-card .desc { font-size: 13px; color: var(--text-dim); }

/* Feature flags emphasis */
.flag-name { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text); }
.flag-off { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* Maintainer card */
.maintainer-card {
  display: flex; gap: 18px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; margin: 18px 0; background: var(--surface);
}
.maintainer-card .m-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; display: block; border: 1px solid var(--border);
}
.maintainer-card .m-name { font-weight: 700; font-size: 15.5px; margin-bottom: 2px; }
.maintainer-card .m-role { font-size: 13px; color: var(--text-faint); margin-bottom: 8px; }
.maintainer-card .m-links { display: flex; gap: 14px; flex-wrap: wrap; }
.maintainer-card .m-links a { font-size: 13px; color: var(--tg); text-decoration: none; }
.maintainer-card .m-links a:hover { text-decoration: underline; }

/* Mobile TOC toggle */
.docs-toc-toggle { display: none; }
@media (max-width: 980px) {
  .docs-toc-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 12.5px; color: var(--text-dim);
    border: 1px solid var(--border); background: var(--surface);
    padding: 8px 14px; border-radius: 999px; margin-bottom: 28px; cursor: pointer;
  }
}
