/*
 * uRadical Prism theme — dark, brand-aligned
 *
 * Palette mapping:
 *   navy    #0C1A50  background
 *   sky     #5DB1FF  functions, class-names, variables
 *   purple  #9F72E1  numbers, constants, attr-name
 *   pink    #F659A8  keywords, regex, properties, tags
 *   gold    #E1C631  strings, attr-value, inserted
 *   slate   rgb(140,160,175)  comments, line-numbers
 *
 * Tuned for light-theme article bodies — code blocks read as a clear
 * visual departure from prose, brand colours pop against navy.
 */

code[class*="language-"],
pre[class*="language-"] {
	color: rgba(244, 246, 252, 0.92);
	background: none;
	font-family: 'IBM Plex Mono', 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
	font-size: 0.9em;
	line-height: 1.65;
	direction: ltr;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	tab-size: 4;
	hyphens: none;
	-moz-tab-size: 4;
	-o-tab-size: 4;
}

/* Block code */
pre[class*="language-"] {
	padding: 1.4em 1.6em;
	margin: 1.5em 0;
	overflow: auto;
	background: #0C1A50;
	border: 1px solid rgba(93, 177, 255, 0.18);
	border-radius: 8px;
	position: relative;
}

pre[class*="language-"]::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 2px;
	background: linear-gradient(to right, #5DB1FF, #9F72E1, #F659A8, #E1C631);
	border-radius: 8px 8px 0 0;
}

/* Inline code — gentle sky-tinted slug to match raw <code> in prose */
:not(pre) > code[class*="language-"] {
	padding: 0.12em 0.4em;
	border-radius: 3px;
	background: rgba(93, 177, 255, 0.10);
	color: #2178d4;
	white-space: normal;
	border: 1px solid rgba(93, 177, 255, 0.18);
	font-size: 0.88em;
}

/* Selection */
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
	background: rgba(93, 177, 255, 0.28);
	text-shadow: none;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
	background: rgba(93, 177, 255, 0.28);
	text-shadow: none;
}

/* ── TOKEN COLOURS ───────────────────────────────────────────── */

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: rgb(140, 160, 175);
	font-style: italic;
}

.token.punctuation {
	color: rgba(244, 246, 252, 0.75);
}

.namespace {
	opacity: 0.7;
}

/* Pink — keywords, control flow, properties, tags */
.token.keyword,
.token.tag,
.token.property,
.token.selector,
.token.symbol,
.token.deleted,
.token.important {
	color: #F659A8;
}

/* Gold — strings, attribute values, inserted */
.token.string,
.token.char,
.token.attr-value,
.token.inserted,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
	color: #E1C631;
}

/* Sky — functions, class names, variables, builtins */
.token.function,
.token.class-name,
.token.variable,
.token.builtin {
	color: #5DB1FF;
}

/* Purple — numbers, booleans, constants, attribute names */
.token.number,
.token.boolean,
.token.constant,
.token.attr-name,
.token.atrule {
	color: #9F72E1;
}

/* Operators in muted slate so they recede */
.token.operator {
	color: rgba(244, 246, 252, 0.65);
}

/* Regex — pink with subtle gold-tinted background to flag literal */
.token.regex {
	color: #F659A8;
	background: rgba(225, 198, 49, 0.08);
	padding: 0 0.15em;
	border-radius: 2px;
}

/* Bold / italic emphasis preserved */
.token.bold,
.token.important {
	font-weight: 700;
}
.token.italic {
	font-style: italic;
}

.token.entity {
	cursor: help;
}

/* ── LANGUAGE-SPECIFIC FINE-TUNING ───────────────────────────── */

/* Bash / shell — make commands distinct from arguments */
.language-bash .token.function,
.language-shell .token.function,
.language-sh .token.function {
	color: #5DB1FF;
	font-weight: 600;
}

/* JSON — keys in pink, values in gold (default), brace/bracket muted */
.language-json .token.property {
	color: #F659A8;
}

/* YAML / TOML — keys distinct from values */
.language-yaml .token.atrule,
.language-yaml .token.key,
.language-toml .token.key {
	color: #F659A8;
}

/* Go — types and built-ins in sky, struct fields default */
.language-go .token.builtin {
	color: #5DB1FF;
}

/* Diff — added gold, removed pink */
.language-diff .token.inserted,
.token.prefix.inserted {
	color: #E1C631;
	background: rgba(225, 198, 49, 0.08);
}
.language-diff .token.deleted,
.token.prefix.deleted {
	color: #F659A8;
	background: rgba(246, 89, 168, 0.08);
}

/* ── LINE-NUMBERS PLUGIN (if used) ───────────────────────────── */

pre[class*="language-"].line-numbers {
	position: relative;
	padding-left: 3.8em;
	counter-reset: linenumber;
}

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

.line-numbers .line-numbers-rows {
	position: absolute;
	pointer-events: none;
	top: 1.4em;
	left: 0;
	width: 3em;
	letter-spacing: -1px;
	border-right: 1px solid rgba(93, 177, 255, 0.18);
	user-select: none;
}

.line-numbers-rows > span {
	display: block;
	counter-increment: linenumber;
	pointer-events: none;
}

.line-numbers-rows > span::before {
	content: counter(linenumber);
	color: rgba(140, 160, 175, 0.6);
	display: block;
	padding-right: 0.8em;
	text-align: right;
	font-size: 0.85em;
}

/* ── TOOLBAR PLUGIN (if used) ────────────────────────────────── */

div.code-toolbar {
	position: relative;
}

div.code-toolbar > .toolbar {
	position: absolute;
	top: 0.5em;
	right: 0.6em;
	opacity: 0;
	transition: opacity 0.2s;
}

div.code-toolbar:hover > .toolbar {
	opacity: 1;
}

div.code-toolbar > .toolbar > .toolbar-item > a,
div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > span {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(244, 246, 252, 0.6);
	background: rgba(93, 177, 255, 0.12);
	border: 1px solid rgba(93, 177, 255, 0.2);
	padding: 0.2em 0.6em;
	border-radius: 3px;
	cursor: pointer;
}

div.code-toolbar > .toolbar > .toolbar-item > a:hover,
div.code-toolbar > .toolbar > .toolbar-item > button:hover {
	color: #5DB1FF;
	border-color: rgba(93, 177, 255, 0.5);
}
