/* free-direct documentation — shared stylesheet */

:root {
  --bg: #0f1117;
  --bg-panel: #161b22;
  --bg-code: #0d1117;
  --bg-table-head: #1c2333;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --link: #58a6ff;
  --link-hover: #79c0ff;
  --accent: #238636;
  --accent-soft: #2ea043;
  --warn: #e3b341;
  --danger: #f85149;
  --stub: #79c0ff;
  --partial: #e3b341;
  --implemented: #3fb950;
  --unknown: #8b949e;
  --nav-width: 240px;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
}

/* ── Layout ── */

.site-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--nav-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo a {
  text-decoration: none;
  color: var(--text);
}

.sidebar-logo .project-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: block;
}

.sidebar-logo .project-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.sidebar nav {
  padding: 10px 0;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 14px 18px 4px;
}

.sidebar nav a {
  display: block;
  padding: 6px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.sidebar nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.sidebar nav a.active {
  color: var(--link);
  border-left-color: var(--link);
  background: rgba(88,166,255,0.08);
}

.main-content {
  margin-left: var(--nav-width);
  flex: 1;
  min-width: 0;
}

.content-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

/* ── Typography ── */

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #e6edf3;
  margin-bottom: 12px;
  line-height: 1.25;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e6edf3;
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e6edf3;
  margin: 28px 0 8px;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 6px;
}

p { margin-bottom: 14px; }

p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

ul, ol {
  margin: 10px 0 14px 24px;
}

li { margin-bottom: 4px; }

strong { color: #e6edf3; font-weight: 600; }

em { color: var(--text-muted); }

/* ── Hero ── */

.hero {
  background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 32px;
  margin-bottom: 36px;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.hero .tagline {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.55;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-blue   { background: rgba(88,166,255,0.15); color: #58a6ff; border: 1px solid rgba(88,166,255,0.3); }
.badge-green  { background: rgba(63,185,80,0.15);  color: #3fb950; border: 1px solid rgba(63,185,80,0.3); }
.badge-yellow { background: rgba(227,179,65,0.15); color: #e3b341; border: 1px solid rgba(227,179,65,0.3); }
.badge-gray   { background: rgba(139,148,158,0.15);color: #8b949e; border: 1px solid rgba(139,148,158,0.3); }

/* ── Diagram ── */

.arch-diagram {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  white-space: pre;
  line-height: 1.8;
  overflow-x: auto;
}

/* ── Code ── */

code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(110,118,129,0.1);
  border: 1px solid rgba(110,118,129,0.2);
  border-radius: 4px;
  padding: 1px 5px;
  color: #e6edf3;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 14px 0 20px;
  line-height: 1.55;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #c9d1d9;
}

/* ── Tables ── */

.table-wrap { overflow-x: auto; margin: 16px 0 24px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  background: var(--bg-table-head);
  color: #e6edf3;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}

tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* ── Status pills ── */

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-implemented  { background: rgba(63,185,80,0.15);   color: var(--implemented); border: 1px solid rgba(63,185,80,0.3); }
.status-partial      { background: rgba(227,179,65,0.15);  color: var(--partial);     border: 1px solid rgba(227,179,65,0.3); }
.status-stub         { background: rgba(88,166,255,0.12);  color: var(--stub);        border: 1px solid rgba(88,166,255,0.25); }
.status-unsupported  { background: rgba(248,81,73,0.12);   color: var(--danger);      border: 1px solid rgba(248,81,73,0.25); }
.status-unknown      { background: rgba(139,148,158,0.12); color: var(--unknown);     border: 1px solid rgba(139,148,158,0.25); }

/* ── Callout boxes ── */

.callout {
  border-left: 3px solid;
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
}

.callout-note    { border-color: var(--link);    background: rgba(88,166,255,0.08); }
.callout-warn    { border-color: var(--warn);    background: rgba(227,179,65,0.08); }
.callout-danger  { border-color: var(--danger);  background: rgba(248,81,73,0.08); }
.callout-tip     { border-color: var(--implemented); background: rgba(63,185,80,0.08); }

.callout-label {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.callout-note   .callout-label { color: var(--link); }
.callout-warn   .callout-label { color: var(--warn); }
.callout-danger .callout-label { color: var(--danger); }
.callout-tip    .callout-label { color: var(--implemented); }

/* ── API doc entries ── */

.api-entry {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 20px 0;
  overflow: hidden;
}

.api-entry-header {
  background: var(--bg-panel);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.api-entry-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: #e6edf3;
  font-weight: 600;
}

.api-entry-kind {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(139,148,158,0.15);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.api-entry-body {
  padding: 14px 16px;
}

.api-entry-body p { font-size: 14px; }

.param-table { margin: 10px 0; }
.param-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--link);
  white-space: nowrap;
  width: 1%;
}

/* ── Quick card grid (index) ── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.15s;
  display: block;
}

.card:hover {
  border-color: var(--link);
  text-decoration: none;
}

.card-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Page header bar ── */

.page-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 36px;
}

.page-header .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.page-header .breadcrumb a {
  color: var(--text-muted);
}

/* ── Divider ── */

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .main-content {
    margin-left: 0;
  }

  .content-body {
    padding: 24px 20px 60px;
  }

  .hero h1 { font-size: 1.8rem; }
  .card-grid { grid-template-columns: 1fr; }
  .site-wrapper { flex-direction: column; }
}
