/* markdown.css */
/* All Markdown styles apply only when inside .markdown-body */

.markdown-body {
  color-scheme: dark;
  /* background: #121212; */
  color: #e0e0e0;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

:root {
    --border-rad: 1em;
}

/* Headings */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Paragraphs */
.markdown-body p {
  margin: 0.5rem 0;
}

/* Code blocks */
.markdown-body pre {
  background: #1e1e1e;
  border-radius: var(--border-rad);
  padding: 0.75rem;
  overflow-x: auto;
}
.markdown-body code {
  background: #2a2a2a;
  color: #f0f0f0;
  padding: 0.15rem 0.4rem;
  border-radius: var(--border-rad);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
}
.markdown-body pre code {
  background: none;
  padding: 0;
}

/* Links */
.markdown-body a {
  color: #80b3ff;
  text-decoration: none;
}
.markdown-body a:hover {
  text-decoration: underline;
}

/* Lists */
.markdown-body ul,
.markdown-body ol {
  /* margin: 0.5rem 0 0.5rem 1.5rem; */
  padding-inline-start: 2em;
}

/* GitHub-style blockquotes (dark theme) */
.markdown-body blockquote {
  margin: 1em 0;
  padding: 0 1em;
  color: #b1b1b1;
  border-left: 0.25em solid #3a3a3a;
  background: transparent;
}

.markdown-body blockquote p {
  margin: 0.5em 0;
}

.markdown-body blockquote > :first-child {
  margin-top: 0;
}

.markdown-body blockquote > :last-child {
  margin-bottom: 0;
}

/* Nested blockquotes have slightly lighter borders */
.markdown-body blockquote blockquote {
  border-left-color: #555;
}

.markdown-body pre.codeblock {
  counter-reset: linenumber;
  position: relative;
  background-color: #1e1e1e;
  color: #f8f8f2;
  padding: 1em 1em 1em 3.5em;  /* left padding for gutter + code */
  overflow-x: auto;
  font-family: monospace;
  border-radius: var(--border-rad);
}

/* Gutter background filling entire height */
.markdown-body pre.codeblock::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3.5em;  /* same as left padding */
  height: 100%;
  background-color: #2c2c2c;
  z-index: 0;
}

.markdown-body pre.codeblock .code-line {
  counter-increment: linenumber;
  display: block;
  white-space: pre;
  position: relative;
  padding-left: 0.5em; /* spacing from gutter edge */
  z-index: 1;          /* ensure text is above gutter background */
}

.markdown-body pre.codeblock .code-line::before {
  content: counter(linenumber);
  position: absolute;
  left: -3.5em;
  width: 3em;          /* fits inside gutter */
  text-align: right;
  color: #888;
  user-select: none;
  z-index: 2;           /* above gutter background */
}

.markdown-body img {
  text-align: center;
  align-self: center;
}

.markdown-body .math-block {
  align-self: center;
}

.markdown-body b,
.markdown-body i {
    display: inline;
}