/* texs code blocks — see ../texs-code.php */
.entry-content pre.wp-block-code {
	--tx-code-bg: rgba(40, 48, 61, 0.05);
	--tx-code-edge: rgba(40, 48, 61, 0.09);
	--tx-code-ink: #28303d;
	--tx-code-btn: #f6f0eb;
	position: relative;
	margin: 1.4em 0;
	padding: 1em 1.15em;
	background: var(--tx-code-bg);
	border: 1px solid var(--tx-code-edge);
	border-radius: 10px;
	color: var(--tx-code-ink);
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.74em;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	overflow: visible;
	tab-size: 2;
}
.entry-content pre.wp-block-code code {
	all: unset;
	font: inherit;
	white-space: inherit;
	overflow-wrap: inherit;
}
html.is-dark-theme .entry-content pre.wp-block-code {
	--tx-code-bg: rgba(255, 255, 255, 0.05);
	--tx-code-edge: rgba(255, 255, 255, 0.1);
	--tx-code-ink: #e4e4e4;
	--tx-code-btn: #11151b;
}

/* Copy button: fades in on hover, always shown on touch screens. */
.tx-code-copy {
	position: absolute;
	top: 0.55em;
	right: 0.55em;
	padding: 0.3em 0.75em;
	border: 1px solid var(--tx-code-edge);
	border-radius: 999px;
	background: var(--tx-code-btn);
	color: var(--tx-code-ink);
	font: 600 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	letter-spacing: 0.02em;
	cursor: pointer;
	user-select: none;
	opacity: 0;
	transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}
pre.wp-block-code:hover .tx-code-copy,
.tx-code-copy:focus-visible,
.tx-code-copy.is-copied {
	opacity: 1;
}
@media (hover: none) {
	.tx-code-copy { opacity: 0.85; }
}
.tx-code-copy:hover { background: var(--tx-code-ink); color: var(--tx-code-btn); }
.tx-code-copy.is-copied,
.tx-code-copy.is-copied:hover { background: #aafc73; border-color: #aafc73; color: #1d2a12; }
