/*!
 * a11y-dark theme for KLab Code Syntax & Copy
 *
 * Token colours: PrismJS / prism-themes (MIT)
 *   https://raw.githubusercontent.com/PrismJS/prism-themes/master/themes/prism-a11y-dark.css
 * Line numbers:  PrismJS line-numbers plugin (MIT)
 *   https://raw.githubusercontent.com/PrismJS/prism/master/plugins/line-numbers/prism-line-numbers.css
 * The WordPress integration at the bottom is written for this plugin.
 *
 * Generated by bin/build-themes.sh — do not edit by hand.
 */

/* ── 1. 上游主題（原樣）────────────────────────────────────────────── */
/**
 * a11y-dark theme for JavaScript, CSS, and HTML
 * Based on the okaidia theme: https://github.com/PrismJS/prism/blob/gh-pages/themes/prism-okaidia.css
 * @author ericwbailey
 */

code[class*="language-"],
pre[class*="language-"] {
	color: #f8f8f2;
	background: none;
	font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
	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;
}

/* Code blocks */
pre[class*="language-"] {
	padding: 1em;
	margin: 0.5em 0;
	overflow: auto;
	border-radius: 0.3em;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
	background: #2b2b2b;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
	padding: 0.1em;
	border-radius: 0.3em;
	white-space: normal;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: #d4d0ab;
}

.token.punctuation {
	color: #fefefe;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
	color: #ffa07a;
}

.token.boolean,
.token.number {
	color: #00e0e0;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
	color: #abe338;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
	color: #00e0e0;
}

.token.atrule,
.token.attr-value,
.token.function {
	color: #ffd700;
}

.token.keyword {
	color: #00e0e0;
}

.token.regex,
.token.important {
	color: #ffd700;
}

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

.token.italic {
	font-style: italic;
}

.token.entity {
	cursor: help;
}

@media screen and (-ms-high-contrast: active) {
	code[class*="language-"],
	pre[class*="language-"] {
		color: windowText;
		background: window;
	}

	:not(pre) > code[class*="language-"],
	pre[class*="language-"] {
		background: window;
	}

	.token.important {
		background: highlight;
		color: window;
		font-weight: normal;
	}

	.token.atrule,
	.token.attr-value,
	.token.function,
	.token.keyword,
	.token.operator,
	.token.selector {
		font-weight: bold;
	}

	.token.attr-value,
	.token.comment,
	.token.doctype,
	.token.function,
	.token.keyword,
	.token.operator,
	.token.property,
	.token.string {
		color: highlight;
	}

	.token.attr-value,
	.token.url {
		font-weight: normal;
	}
}

/* ── 2. 上游行號外掛（原樣）────────────────────────────────────────── */
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: 0;
	font-size: 100%;
	left: -3.8em;
	width: 3em; /* works for line-numbers below 1000 lines */
	letter-spacing: -1px;
	border-right: 1px solid #999;

	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;

}

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

		.line-numbers-rows > span:before {
			content: counter(linenumber);
			color: #999;
			display: block;
			padding-right: 0.8em;
			text-align: right;
		}

/* ── 3. WordPress 整合（本外掛自己寫）──────────────────────────────── */

/*
 * WordPress 的區塊產生的是 <pre class="wp-block-code">，**沒有 language-* class**
 * （語言 class 在裡面的 <code> 上）。所以上游那些 pre[class*="language-"] 的規則
 * 一條都接不到它 —— 下面這一段就是補這件事。
 *
 * ⚠ 選擇器前面那個 body 不是裝飾，拿掉會壞：
 *   佈景主題常常有 ".some-class pre { background: #fff }" 這種規則
 *   （實例：moral-magazine 的 ".lite-version pre"），特異性 0,0,1,1 跟
 *   "pre.wp-block-code" **一模一樣**，而佈景主題的 CSS 通常載入在外掛之後
 *   —— 同分時後到的贏，於是深色配色被套上白底、淺色字直接消失。
 *   加上 body 變成 0,0,1,2 才穩定贏過那一類規則。
 *   這種壞法很難看出來：站上只要有任何一條寫死 pre 背景的自訂 CSS
 *   （優先權更後面），畫面就會「看起來正常」，一移掉才爆出來。
 */
body pre.wp-block-code {
	background: #2b2b2b;
	color: #f8f8f2;
	padding: 1em;
	margin: 0.5em auto;
	border-radius: 0.3em;
	overflow: auto;
}

/*
 * 沒有被 Prism 標成 token 的純文字（多數語言裡的一般識別字）要吃主題的前景色。
 * 不設的話它會繼承佈景主題的內文色 —— 在深色背景上常常是看不見的深藍。
 */
body pre.wp-block-code code {
	color: inherit;
	background: none;
	padding-left: 0;
	border: none;
	overflow-x: initial;
}

/* 行號：同樣要自己接上，並拿掉上游那條分隔線。 */
body pre.wp-block-code.line-numbers {
	position: relative;
	padding-left: 3.8em;
	counter-reset: linenumber;
}

body pre.wp-block-code.line-numbers > code {
	position: relative;
	white-space: inherit;
}

body .wp-block-code .line-numbers-rows {
	border-right: 0;
}
