/* Syntax highlighting, dziban palette.
 * Subdued; reads like a printed listing. Inherits `pre` / `code` chrome
 * from tokens.css (border, paper-2 background, mono font).
 */

code[class*="language-"],
pre[class*="language-"] {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82em;
  line-height: 1.55;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  tab-size: 2;
  hyphens: none;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--ink-4);
  font-style: italic;
}

.token.punctuation {
  color: var(--ink-3);
}

.token.namespace {
  opacity: 0.7;
}

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

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin {
  color: var(--link);
}

/* Diff-specific: tint the whole deleted/inserted group.
 * Prism's DOM: <span class="token deleted-sign deleted"><span class="token prefix deleted">-</span><span class="token line">…</span>…</span>
 * Only the outer *-sign span gets the background; inner prefix/line spans
 * stay inline so newlines in the <pre> keep wrapping correctly.
 */
.token.deleted-sign {
  color: #7a1f12;
  background: rgba(192, 64, 48, 0.12);
}
.token.inserted-sign {
  color: #2a5a18;
  background: rgba(90, 154, 58, 0.16);
}
.token.prefix.deleted { color: #c04030; font-weight: 700; }
.token.prefix.inserted { color: #5a9a3a; font-weight: 700; }

[data-theme="dark"] .token.deleted-sign {
  color: #e89080;
  background: rgba(232, 112, 96, 0.18);
}
[data-theme="dark"] .token.inserted-sign {
  color: #b8d898;
  background: rgba(128, 192, 96, 0.18);
}
[data-theme="dark"] .token.prefix.deleted { color: #e87060; }
[data-theme="dark"] .token.prefix.inserted { color: #80c060; }

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

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #3a5a80;
  font-weight: 600;
}
[data-theme="dark"] .token.keyword,
[data-theme="dark"] .token.atrule,
[data-theme="dark"] .token.attr-value {
  color: #8aa9c8;
}

.token.function,
.token.class-name {
  color: var(--ink);
  font-weight: 600;
}

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

.token.important,
.token.bold {
  font-weight: 600;
}
.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

/* Line numbers-ish spacing when used */
pre[class*="language-"] {
  position: relative;
  overflow: auto;
}
