/* =============================================================
   Code Syntax Highlighting
   Matching the thesis minted style (light background, gray line numbers)
   ============================================================= */

/* --- Inline Code --- */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: #f3f4f6;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: #1f2937;
}

/* --- Code Blocks --- */
pre {
  margin: 1.5rem 0;
  padding: 0;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

pre code {
  display: block;
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.55;
  background: transparent;
  border-radius: 0;
  tab-size: 4;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

/* --- Code Listing with Caption --- */
.code-listing {
  margin: 1.5rem 0;
}

.code-listing .listing-caption {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.code-listing .listing-caption strong {
  color: var(--text);
}

/* --- Line Numbers --- */
pre code .line-number {
  display: inline-block;
  width: 2.5em;
  text-align: right;
  padding-right: 1em;
  margin-right: 0.75em;
  color: #b0b0b0;
  border-right: 1px solid #e0e0e0;
  user-select: none;
  font-size: 0.78rem;
}

/* --- Pandoc/Skylighting Syntax Colors --- */
/* Keywords */
code span.kw { color: #d73a49; font-weight: 600; }
/* Data types */
code span.dt { color: #6f42c1; }
/* Decimal values */
code span.dv { color: #005cc5; }
/* Base-N integers */
code span.bn { color: #005cc5; }
/* Floats */
code span.fl { color: #005cc5; }
/* Characters */
code span.ch { color: #032f62; }
/* Strings */
code span.st { color: #032f62; }
/* Comments */
code span.co { color: #6a737d; font-style: italic; }
/* Others */
code span.ot { color: #d73a49; }
/* Alerts */
code span.al { color: #d1242f; font-weight: bold; }
/* Functions */
code span.fu { color: #6f42c1; }
/* Region markers */
code span.re { }
/* Errors */
code span.er { color: #d1242f; font-weight: bold; }
/* Built-in */
code span.bu { color: #005cc5; }
/* Operators */
code span.op { color: #d73a49; }
/* Control flow */
code span.cf { color: #d73a49; font-weight: 600; }
/* Preprocessor */
code span.pp { color: #d73a49; }
/* Attribute */
code span.at { color: #005cc5; }
/* Documentation */
code span.do { color: #6a737d; font-style: italic; }
/* Annotation */
code span.an { color: #6a737d; font-weight: bold; }
/* Constant */
code span.cn { color: #005cc5; }
/* Special char */
code span.sc { color: #032f62; }
/* Verbatim string */
code span.vs { color: #032f62; }
/* Special string */
code span.ss { color: #032f62; }
/* Import */
code span.im { color: #d73a49; }
/* Variable */
code span.va { color: #e36209; }
