/* ============================================================
   LearnHub — Prism.js theme
   A from-scratch dark theme (not Prism's stock "prism.css",
   which is a light theme meant for white backgrounds) that maps
   token colors onto the site's existing CSS variables, so
   highlighted code automatically matches whichever of the two
   site themes (Terminal / VS Code) is active — same mechanism
   already used everywhere else in assets/styles.css.
   ============================================================ */

code[class*="language-"],
pre[class*="language-"] {
  color: var(--fg);
  background: none;
  font-family: var(--font-mono);
  font-size: 1em;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
  background: var(--accent);
  color: var(--accent-fg);
}

/* Prism sets its own padding/margin/background on <pre> — since our
   .code-block already provides all of that (border, radius, padding),
   strip Prism's own box styling back out so the two don't double up. */
pre[class*="language-"] {
  padding: 0;
  margin: 0;
  overflow: visible;
  background: none;
}
:not(pre) > code[class*="language-"] {
  padding: 0.15em 0.3em;
  border-radius: var(--radius);
  background: var(--surface-2);
  white-space: normal;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--fg-dim);
}

.token.punctuation {
  color: var(--fg-dim);
}

.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--accent);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted,
.token.triple-quoted-string {
  color: var(--success);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: var(--fg);
}

.token.atrule,
.token.attr-value,
.token.keyword,
.token.macro.property,
.token.directive {
  color: var(--accent);
}

.token.function,
.token.class-name {
  color: var(--danger);
}

.token.regex,
.token.important,
.token.variable,
.token.decorator {
  color: var(--success);
}

.token.important,
.token.bold {
  font-weight: 700;
}
.token.italic {
  font-style: italic;
}
.token.entity {
  cursor: help;
}
