/* Make No Mistakes — true black theme */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #000000;
  --bg-sidebar: #050505;
  --bg-code: #0f0f0f;
  --border: #1a1a1a;
  --border-accent: #2a2a2a;
  --text: #d4d4d4;
  --text-muted: #737373;
  --heading: #ffffff;
  --link: #6eb5ff;
  --link-hover: #b794ff;
  --red: #ef4444;
}

/* ── Kill HonKit / fontsettings color themes ─────────────── */

.book.color-theme-1 .book-body,
.book.color-theme-2 .book-body,
.book.color-theme-1 .book-body .page-wrapper .page-inner section,
.book.color-theme-2 .book-body .page-wrapper .page-inner section,
.book.color-theme-1 .book-summary,
.book.color-theme-2 .book-summary {
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* ── Base ────────────────────────────────────────────────── */

html,
body,
.book {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

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

.book .book-summary {
  background: var(--bg-sidebar) !important;
  color: var(--text-muted) !important;
  border-right: 1px solid var(--border) !important;
}

.book .book-summary ul.summary li a,
.book .book-summary ul.summary li span {
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

.book .book-summary ul.summary li a:hover {
  color: var(--heading) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  text-decoration: none !important;
}

.book .book-summary ul.summary li.active > a {
  color: var(--heading) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border-right: 2px solid var(--red) !important;
}

.book .book-summary ul.summary li.divider {
  background: var(--border) !important;
  box-shadow: none !important;
}

/* ── Header ────────────────────────────────────────────────── */

.book .book-header {
  background: var(--bg) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}

.book .book-header h1 {
  color: var(--heading) !important;
  letter-spacing: -0.02em;
}

.book .book-header .btn {
  color: var(--text-muted) !important;
}

.book .book-header .btn:hover {
  color: var(--heading) !important;
}

/* ── Main content — every layer forced black ─────────────── */

.book .book-body,
.book .book-body .body-inner,
.book .book-body .page-wrapper,
.book .book-body .page-inner,
.book .book-body .page-wrapper .page-inner section,
.book .book-body .page-wrapper .page-inner section.normal,
.book .book-body .page-wrapper .page-inner section.markdown-section,
.markdown-section {
  background: var(--bg) !important;
  color: var(--text) !important;
}

.book .book-body .page-inner {
  max-width: 820px;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

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

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.book .book-body .page-wrapper .page-inner section.normal h1,
.book .book-body .page-wrapper .page-inner section.normal h2,
.book .book-body .page-wrapper .page-inner section.normal h3 {
  color: var(--heading) !important;
  border-color: var(--border-accent) !important;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.markdown-section h1 {
  font-size: 2rem;
  border-bottom: 1px solid var(--border-accent);
  padding-bottom: 0.4em;
  margin-top: 0;
}

.markdown-section h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  border-bottom: none;
  padding-bottom: 0;
}

.markdown-section strong,
.book .book-body .page-wrapper .page-inner section.normal strong {
  color: var(--heading) !important;
  font-weight: 600;
}

.markdown-section p,
.markdown-section li {
  line-height: 1.7;
  color: var(--text);
}

/* ── Links ─────────────────────────────────────────────────── */

.markdown-section a,
.book .book-body .page-wrapper .page-inner section.normal a {
  color: var(--link) !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(110, 181, 255, 0.25);
  transition: color 0.15s, border-color 0.15s;
}

.markdown-section a:hover {
  color: var(--link-hover) !important;
  border-bottom-color: var(--link-hover);
}

/* ── Blockquotes ───────────────────────────────────────────── */

.markdown-section blockquote,
.book .book-body .page-wrapper .page-inner section.normal blockquote {
  border-left: 3px solid var(--red) !important;
  background: rgba(239, 68, 68, 0.06) !important;
  color: var(--text) !important;
  border-radius: 0 6px 6px 0;
  padding: 0.75em 1em;
}

.markdown-section hr {
  border: none !important;
  height: 1px !important;
  background: var(--border) !important;
  margin: 2rem 0;
}

/* ── Tables (override gitbook tr { background:#fff }) ─────── */

.markdown-section table,
.book .book-body .page-wrapper .page-inner section.normal table {
  display: table !important;
  width: 100% !important;
  border-collapse: collapse !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg) !important;
  margin: 1.25em 0 1.75em;
}

.markdown-section table tr,
.book .book-body .page-wrapper .page-inner section.normal table tr {
  background: var(--bg) !important;
  background-color: var(--bg) !important;
  border-top: 1px solid var(--border) !important;
}

.markdown-section table thead tr,
.book .book-body .page-wrapper .page-inner section.normal table thead tr {
  background: #0a0a0a !important;
  background-color: #0a0a0a !important;
}

.markdown-section table tr:nth-child(2n),
.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) {
  background: #080808 !important;
  background-color: #080808 !important;
}

.markdown-section table th,
.markdown-section table td,
.book .book-body .page-wrapper .page-inner section.normal table th,
.book .book-body .page-wrapper .page-inner section.normal table td {
  border: 1px solid var(--border) !important;
  padding: 0.65em 0.95em !important;
  color: var(--text) !important;
  background: transparent !important;
  background-color: transparent !important;
}

.markdown-section table thead th,
.book .book-body .page-wrapper .page-inner section.normal table thead th {
  color: var(--heading) !important;
  font-weight: 600;
  background: #0a0a0a !important;
  background-color: #0a0a0a !important;
  border-bottom: 1px solid var(--border-accent) !important;
}

.markdown-section table tbody tr:nth-child(2n) td,
.book .book-body .page-wrapper .page-inner section.normal table tbody tr:nth-child(2n) td {
  background: #080808 !important;
  background-color: #080808 !important;
}

.markdown-section table a,
.book .book-body .page-wrapper .page-inner section.normal table a {
  color: var(--link) !important;
  border-bottom-color: rgba(110, 181, 255, 0.35) !important;
}

/* ── Code ──────────────────────────────────────────────────── */

.markdown-section :not(pre) > code,
.book .book-body .page-wrapper .page-inner section.normal :not(pre) > code {
  font-family: "JetBrains Mono", ui-monospace, monospace !important;
  background: #141414 !important;
  color: #e8e8e8 !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px;
  padding: 0.12em 0.4em;
  font-size: 0.88em;
}

.markdown-section pre,
.book .book-body .page-wrapper .page-inner section.normal pre {
  background: var(--bg-code) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  padding: 1em 1.1em;
  overflow-x: auto;
}

.markdown-section pre > code,
.book .book-body .page-wrapper .page-inner section.normal pre > code {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  padding: 0;
  font-size: 0.85em;
}

/* ── Navigation ────────────────────────────────────────────── */

.book .navigation {
  background: var(--bg) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}

.book .navigation .link:hover {
  color: var(--link) !important;
}

/* ── Footer ────────────────────────────────────────────────── */

.gitbook-link {
  background: var(--bg) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  opacity: 0.5;
}

/* ── Logo ──────────────────────────────────────────────────── */

.markdown-section img[alt="Make No Mistakes"] {
  display: block;
  margin: 0 auto 2rem;
  max-width: 260px;
}

/* ── Scrollbars ────────────────────────────────────────────── */

.book-summary::-webkit-scrollbar {
  width: 6px;
}

.book-summary::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 3px;
}

/* ── Custom persistent footer on every page ───────────────── */

.custom-footer {
  margin-top: 3rem;
  padding: 1.25rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  font-size: 0.85em;
  color: var(--text-muted);
}

.custom-footer strong {
  color: var(--heading);
  display: block;
  margin-bottom: 0.4em;
}

.custom-footer a {
  color: var(--link);
}

.footer-links {
  margin-top: 0.6em;
}

.footer-links a {
  margin-right: 1em;
}

.footer-credit {
  margin-top: 0.8em;
  font-size: 0.75em;
  opacity: 0.6;
}
