/* PrismJS 1.30.0 – dark mode scoped */

body[data-theme="dark"] code[class*="language-"],
body[data-theme="dark"] pre[class*="language-"] {
	color: var(--highlight-default-color);
	background: none;
	font-family: var(--monospace-font-family);
	font-size: 1em;
	font-weight: 300;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	word-wrap: normal;
	line-height: 1.5;
	tab-size: 4;
	hyphens: none;
	font-variant-ligatures: none;
}

body[data-theme="dark"] pre[class*="language-"] {
	padding: 1em;
	margin: 0.5em 0;
	overflow: auto;
	border-radius: 6px;
}

body[data-theme="dark"] :not(pre) > code[class*="language-"],
body[data-theme="dark"] pre[class*="language-"] {
	background: var(--code-background-color);
}

body[data-theme="dark"] :not(pre) > code[class*="language-"] {
	padding: 3px 5px;
	border-radius: 4px;
	white-space: normal;
}

/* Comments */
body[data-theme="dark"] .token.comment,
body[data-theme="dark"] .token.block-comment,
body[data-theme="dark"] .token.prolog,
body[data-theme="dark"] .token.doctype,
body[data-theme="dark"] .token.cdata {
	color: var(--highlight-comment-color);
	font-style: normal;
}

/* Punctuation + operators */
body[data-theme="dark"] .token.punctuation {
	color: var(--highlight-operator-color);
}

body[data-theme="dark"] .token.operator,
body[data-theme="dark"] .token.entity,
body[data-theme="dark"] .token.url {
	color: var(--highlight-operator-color);
}

/* Keywords (and close equivalents) */
body[data-theme="dark"] .token.keyword,
body[data-theme="dark"] .token.atrule,
body[data-theme="dark"] .token.important {
	color: var(--highlight-keyword-color);
	font-weight: 400;
}

/* “Keyword2” bucket (preprocessor-ish in the Pygments sheet) */
body[data-theme="dark"] .token.directive,
body[data-theme="dark"] .token.macro,
body[data-theme="dark"] .token.property-access {
	color: var(--highlight-keyword2-color);
}

/* Numbers / booleans */
body[data-theme="dark"] .token.number,
body[data-theme="dark"] .token.boolean {
	color: var(--highlight-number-color);
}

/* Strings */
body[data-theme="dark"] .token.string,
body[data-theme="dark"] .token.char,
body[data-theme="dark"] .token.attr-value {
	color: var(--highlight-string-color);
}

/* Regex (Pygments grouped these with operator-ish tokens) */
body[data-theme="dark"] .token.regex {
	color: var(--highlight-operator-color);
}

/* Functions */
body[data-theme="dark"] .token.function,
body[data-theme="dark"] .token.function-name {
	color: var(--highlight-function-color);
}

/* Tags / attributes (HTML etc) */
body[data-theme="dark"] .token.tag {
	color: var(--highlight-function-color);
}

body[data-theme="dark"] .token.attr-name {
	color: var(--highlight-decorator-color);
}

/* Builtins / types / classes (Prism can’t split these like Pygments does) */
body[data-theme="dark"] .token.builtin {
	color: var(--highlight-engine-type-color);
}

body[data-theme="dark"] .token.class-name,
body[data-theme="dark"] .token.namespace {
	color: var(--highlight-user-type-color);
}

/* Constants / symbols / properties / variables */
body[data-theme="dark"] .token.constant,
body[data-theme="dark"] .token.symbol {
	color: var(--highlight-user-type-color);
}

body[data-theme="dark"] .token.property,
body[data-theme="dark"] .token.variable {
	color: var(--highlight-member-variable-color);
}

/* Decorators / annotations (language dependent) */
body[data-theme="dark"] .token.annotation,
body[data-theme="dark"] .token.decorator {
	color: var(--highlight-decorator-color);
}

/* “Deleted/inserted” (keep sane defaults) */
body[data-theme="dark"] .token.deleted {
	color: var(--highlight-decorator-color);
}

body[data-theme="dark"] .token.inserted {
	color: var(--highlight-number-color);
}

/* Bold/italic tokens (Prism plugins sometimes emit these) */
body[data-theme="dark"] .token.bold {
	font-weight: 700;
}

body[data-theme="dark"] .token.italic {
	font-style: italic;
}

/* Prism error token (closest equivalent to Pygments .err) */
body[data-theme="dark"] .token.error {
	border: none;
}

/* Line numbers: use comment color for the chrome */
body[data-theme="dark"] pre[class*="language-"].line-numbers {
	position: relative;
	padding-left: 3.8em;
	counter-reset: linenumber;
}

body[data-theme="dark"] pre[class*="language-"].line-numbers > code {
	position: relative;
	white-space: inherit;
}

body[data-theme="dark"] .line-numbers .line-numbers-rows {
	position: absolute;
	pointer-events: none;
	top: 0;
	font-size: 100%;
	left: -3.8em;
	width: 3em;
	letter-spacing: -1px;
	border-right: 1px solid var(--highlight-comment-color);
	user-select: none;
}

body[data-theme="dark"] .line-numbers-rows > span {
	display: block;
	counter-increment: linenumber;
}

body[data-theme="dark"] .line-numbers-rows > span:before {
	content: counter(linenumber);
	color: var(--highlight-comment-color);
	display: block;
	padding-right: 0.8em;
	text-align: right;
}

body[data-theme="dark"] {
	/* Code block font */
	--monospace-font-family:
		JetBrains Mono, Consolas, Monaco, "Andale Mono", "Ubuntu Mono",
		monospace;
	/* Code block background */
	--code-background-color: var(--global-palette8);
	--highlight-background-color: #1d1d1d;
	--highlight-background-emph-color: #2d2d2d;

	/* Default text */
	--highlight-default-color: rgba(255, 255, 255, 0.85);

	/* Comments */
	--highlight-comment-color: rgba(255, 255, 255, 0.5);
	--highlight-doc-comment-color: rgba(153, 179, 204, 0.8);
	--highlight-region-comment-color: rgba(173, 117, 196, 0.2);

	/* Keywords */
	--highlight-keyword-color: #ff7085;
	--highlight-literal-color: var(--highlight-keyword-color);
	--highlight-keyword2-color: #42ffc2;
	--highlight-control-flow-keyword-color: #ff8ccc;

	/* Numbers */
	--highlight-number-color: #a1ffe0;

	/* Decorators / annotations */
	--highlight-decorator-color: #ffb373;

	/* Types */
	--highlight-base-type-color: #42ffc2;
	--highlight-engine-type-color: #8fffdb;
	--highlight-user-type-color: #c7ffed;

	/* Variables */
	--highlight-member-variable-color: #bce0ff;

	/* Functions */
	--highlight-function-color: #57b3ff;
	--highlight-function-declaration-color: #66e6ff;
	--highlight-global-function-color: #a3a3f5;

	/* Operators / punctuation */
	--highlight-operator-color: #abc8ff;

	/* Strings */
	--highlight-string-color: #ffeca1;
	--highlight-get-node-shorthand-color: #63c259;
	--highlight-node-path-color: #b8c47d;
	--highlight-string-name-color: #ffc2a6;
}
