/*
 * WRL Prism Syntax Highlighting Theme
 * Colors use design system tokens for consistency.
 * --color-text-muted-docs overrides the base token where WCAG AA requires it.
 */

:root {
  /* Inherit accessible muted color from docs.css if loaded; fall back inline */
  --color-text-muted-docs: #5a5650;

  /*
   * --color-accent (#3d7c9a) achieves ~4.1:1 on --color-surface-muted (#f3f2f0),
   * failing WCAG AA (4.5:1). Use this darker shade (~5.5:1) for code tokens.
   */
  --color-accent-code: #2f6a85;
}

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

/* Comments */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--color-text-muted-docs);
  font-style: italic;
}

/* Keywords */
.token.keyword,
.token.selector,
.token.important,
.token.atrule {
  color: var(--color-accent-code);
  font-weight: var(--weight-medium);
}

/* Strings */
.token.string,
.token.attr-value,
.token.char,
.token.regex {
  color: var(--color-success-text);
}

/* Numbers */
.token.number,
.token.boolean,
.token.unit,
.token.constant,
.token.symbol,
.token.inserted {
  color: var(--color-error);
}

/* Properties / keys */
.token.property,
.token.tag,
.token.class-name,
.token.attr-name {
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}

/* Punctuation */
.token.punctuation,
.token.operator {
  color: var(--color-text-muted-docs);
}

/* Functions */
.token.function {
  color: var(--color-accent-code);
}

/* Deleted */
.token.deleted {
  color: var(--color-error-text);
  background: var(--color-error-bg);
}

/* Inserted */
.token.inserted {
  color: var(--color-success-text);
  background: var(--color-success-bg);
}

/* Namespace */
.token.namespace {
  opacity: 0.7;
}
