/* GitHub Dark Theme
   https://github.com/primer/primitives
   Applied as an override stylesheet for VS Code markdown-exported HTML files */

/* ── Reset / Base ───────────────────────────────────────────────────── */
html {
  color-scheme: dark;
}

body {
  background-color: #0d1117 !important;
  color: #c9d1d9 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji" !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 26px !important;
}

/* ── Headings ───────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: #e6edf3 !important;
  border-bottom: 1px solid #21262d;
  padding-bottom: .3em;
  margin-top: 1.5em;
  margin-bottom: .5em;
  font-weight: 600;
}
h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; border-bottom: none; }
h4, h5, h6 { border-bottom: none; }

/* ── Links ──────────────────────────────────────────────────────────── */
a {
  color: #58a6ff !important;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ── Paragraphs & inline text ───────────────────────────────────────── */
p { color: #c9d1d9 !important; }
strong { color: #e6edf3; }
em { color: #c9d1d9; }
del { color: #8b949e; }

/* ── Code & Pre ─────────────────────────────────────────────────────── */
code, tt {
  background-color: #161b22 !important;
  color: #ff7b72 !important;
  padding: .2em .4em;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace !important;
  font-size: 85%;
  border: none !important;
}

pre {
  background-color: #161b22 !important;
  color: #c9d1d9 !important;
  padding: 16px !important;
  border-radius: 6px !important;
  overflow-x: auto;
  border: 1px solid #30363d !important;
  line-height: 1.45;
}

pre code, pre tt {
  background-color: transparent !important;
  color: #c9d1d9 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 100%;
  white-space: pre;
}

/* Syntax-highlight colours (basic, language-agnostic) */
.hljs-keyword,
.token.keyword   { color: #ff7b72; }
.hljs-string,
.token.string    { color: #a5d6ff; }
.hljs-comment,
.token.comment   { color: #8b949e; font-style: italic; }
.hljs-number,
.token.number    { color: #79c0ff; }
.hljs-built_in,
.token.function  { color: #d2a8ff; }
.hljs-class,
.token.class-name{ color: #ffa657; }
.hljs-attr,
.token.attr-name { color: #79c0ff; }

/* ── Blockquotes ────────────────────────────────────────────────────── */
blockquote {
  color: #8b949e !important;
  border-left: 4px solid #3fb950 !important;
  background-color: #161b22;
  padding: .5em 1em;
  margin: 0 0 16px 0;
  border-radius: 0 6px 6px 0;
}
blockquote p { color: #8b949e !important; }

/* ── Tables ─────────────────────────────────────────────────────────── */
table {
  border-collapse: collapse !important;
  width: 100%;
  margin-bottom: 16px;
  color: #c9d1d9 !important;
  background-color: transparent !important;
}

table th {
  background-color: #161b22 !important;
  color: #e6edf3 !important;
  font-weight: 600;
  padding: 6px 13px !important;
  border: 1px solid #30363d !important;
}

table td {
  color: #c9d1d9 !important;
  padding: 6px 13px !important;
  border: 1px solid #30363d !important;
  background-color: transparent !important;
}

table tr {
  background-color: #0d1117 !important;
  border-top: 1px solid #21262d !important;
}

table tr:nth-child(even) {
  background-color: #161b22 !important;
}

/* ── Horizontal Rule ────────────────────────────────────────────────── */
hr {
  height: 2px !important;
  border: none !important;
  background-color: #21262d !important;
  margin: 24px 0;
}

/* ── Lists ──────────────────────────────────────────────────────────── */
ul, ol {
  padding-left: 2em;
  color: #c9d1d9 !important;
}
li { margin: .25em 0; color: #c9d1d9 !important; }
li + li { margin-top: .25em; }

/* ── Images ─────────────────────────────────────────────────────────── */
img {
  max-width: 100%;
  background-color: transparent !important;
}

/* ── Badges (shields.io) ────────────────────────────────────────────── */
img[src*="shields.io"] {
  display: inline-block;
  margin: 2px 3px;
  vertical-align: middle;
}

/* ── Mermaid diagrams ───────────────────────────────────────────────── */
.mermaid {
  background-color: #161b22 !important;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #30363d;
}

/* ── Scrollbar (Webkit) ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #161b22; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ── Selection ──────────────────────────────────────────────────────── */
::selection {
  background-color: #1f6feb;
  color: #ffffff;
}

/* ── Misc overrides from VS Code markdown export ────────────────────── */
#code-csp-warning {
  background-color: #1f2937 !important;
  color: #c9d1d9 !important;
}
