/* ── Enfono Docs Theme ────────────────────────────────────────────────── */
/* Dark theme (default) */
:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-sidebar: #0d0d0d;
  --text: #fafafa;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666666;
  --border: #2a2a2a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --code-bg: #1a1a1a;
  --pre-bg: #0d0d0d;
  --pre-text: #e0e0e0;
  --sidebar-width: 260px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Light theme */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-card: #f8f8f8;
  --bg-sidebar: #f5f5f5;
  --text: #171717;
  --text-secondary: #525252;
  --text-tertiary: #a3a3a3;
  --border: #e5e5e5;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --code-bg: #f0f0f0;
  --pre-bg: #1e1e2e;
  --pre-text: #cdd6f4;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .logo {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-brand h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  padding: 8px 8px 4px;
}

.sidebar-search {
  padding: 0 12px;
  margin-bottom: 12px;
}

.sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search input::placeholder { color: var(--text-tertiary); }
.sidebar-search input:focus { border-color: var(--accent); }

.nav-list { list-style: none; padding: 0 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.15s;
}

.nav-link:hover { background: var(--accent-soft); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* Theme toggle */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid var(--border);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  width: 100%;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}

.theme-toggle:hover { background: var(--accent-soft); color: var(--text); }

/* ── Content ──────────────────────────────────────────────────────────── */

.content {
  margin-left: var(--sidebar-width);
  padding: 48px 56px;
  max-width: 860px;
  width: 100%;
}

/* ── Home hero ────────────────────────────────────────────────────────── */

.hero {
  padding: 20px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); text-decoration: none; }

/* ── Feature cards ────────────────────────────────────────────────────── */

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.15s;
}

.feature-card:hover { border-color: var(--accent); }

.feature-card .icon {
  width: 36px; height: 36px;
  background: var(--accent-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── Quick links ──────────────────────────────────────────────────────── */

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 16px 0 32px;
}

.quick-link {
  display: block;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

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

.quick-link small {
  display: block;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Typography ───────────────────────────────────────────────────────── */

h1 { font-size: 28px; margin: 32px 0 12px; color: var(--text); font-weight: 700; letter-spacing: -0.3px; }
h1:first-child { margin-top: 0; }
h2 { font-size: 22px; margin: 32px 0 12px; color: var(--text); font-weight: 600; }
h3 { font-size: 18px; margin: 24px 0 8px; color: var(--text); font-weight: 600; }
h4 { font-size: 15px; margin: 20px 0 6px; color: var(--text); font-weight: 600; }

p { line-height: 1.7; margin-bottom: 12px; color: var(--text-secondary); }

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

ul, ol { margin: 8px 0 16px 24px; color: var(--text-secondary); }
li { margin-bottom: 6px; line-height: 1.6; }
li:last-child { margin-bottom: 0; }

code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text);
}

pre {
  background: var(--pre-bg);
  color: var(--pre-text);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border);
}

pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ── Callouts ─────────────────────────────────────────────────────────── */

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text);
}

.callout-warning {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
}

.callout-info {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.callout-tip {
  border-left-color: var(--success);
  background: rgba(34, 197, 94, 0.08);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

/* ── Tables ───────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

th {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg-card);
}

tr:hover td { background: var(--bg-card); }

/* ── Steps ────────────────────────────────────────────────────────────── */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 16px 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 20px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 26px; height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  font-size: 13px;
  font-weight: 600;
}

.steps li h3 { margin-top: 0; }

/* ── Prev/Next navigation ─────────────────────────────────────────────── */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.page-nav-link {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s;
  max-width: 45%;
}

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

.page-nav-link.prev { align-items: flex-start; }
.page-nav-link.next { align-items: flex-end; text-align: right; margin-left: auto; }

.page-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.page-nav-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ── GitHub edit link ─────────────────────────────────────────────────── */

.edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 24px;
  text-decoration: none;
}

.edit-link:hover { color: var(--accent); text-decoration: none; }

/* ── Mobile ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    padding: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand { border-bottom: none; margin-bottom: 0; padding: 0; }
  .sidebar-search { flex: 1; min-width: 200px; }
  .sidebar-footer { display: none; }
  .nav-list { display: flex; flex-wrap: wrap; gap: 2px; padding: 0; }
  .layout { flex-direction: column; }
  .content { margin-left: 0; padding: 24px 20px; }

  .hero h1 { font-size: 28px; }
  .features { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; }
  .page-nav { flex-direction: column; }
  .page-nav-link { max-width: 100%; }
  .page-nav-link.next { margin-left: 0; }
}
