/* cfgdrift docs-site — shared stylesheet (zero dependencies).
 * Palette mirrors the Web dashboard dark theme (src/cfgdrift/web/static/index.html).
 */
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --critical: #ef4444;
  --warn: #f59e0b;
  --info: #22c55e;
  --none: #64748b;
  --border: #334155;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

/* ---- layout ---- */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }

nav.site-nav { display: flex; flex-wrap: wrap; gap: 4px 10px; }

nav.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 2px 4px;
}
nav.site-nav a:hover { color: var(--accent); }
nav.site-nav a.active { color: var(--accent); border-bottom: 2px solid var(--accent); }

main { padding: 36px 0 48px; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
  color: var(--muted);
  font-size: 14px;
}
footer.site-footer .links { margin-bottom: 6px; }
footer.site-footer a { color: var(--accent); text-decoration: none; }
footer.site-footer a:hover { text-decoration: underline; }

/* ---- typography ---- */
h1 { font-size: 30px; line-height: 1.3; margin: 0 0 8px; color: #fff; }
h2 { font-size: 22px; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 18px; margin: 28px 0 8px; color: var(--accent); }
p { margin: 10px 0; }
ul, ol { margin: 10px 0; padding-left: 24px; }
li { margin: 4px 0; }

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

code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 0.9em;
  color: #bae6fd;
}

pre {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

blockquote {
  margin: 12px 0;
  padding: 8px 16px;
  border-left: 4px solid var(--accent);
  background: var(--panel);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
}
blockquote strong { color: var(--text); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
}
th, td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--panel); color: #fff; }

/* ---- components ---- */
.lead { font-size: 18px; color: var(--muted); margin-top: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 16px 0;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
  margin-right: 6px;
}
.badge.critical { background: var(--critical); color: #fff; }
.badge.warn { background: var(--warn); color: #1c1917; }
.badge.info { background: var(--info); color: #052e16; }
.badge.none { background: var(--none); color: #fff; }

.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.pill {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.pill:hover { border-color: var(--accent); text-decoration: none; }
.pill .t { color: var(--accent); font-weight: 600; }
.pill .d { color: var(--muted); font-size: 14px; margin-top: 4px; }

.toc { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
.toc ul { margin: 6px 0; }

.kbd {
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}

@media (max-width: 640px) {
  header.site-header .container { flex-direction: column; align-items: flex-start; gap: 8px; }
  nav.site-nav { width: 100%; }
}
