/* EK code blocks (v1.5.0) — CSP-safe: plain <pre><code> is styled directly, so code
   renders correctly with JS off. No inline styles, no inline handlers. Colors come
   from the theme palette vars, so [data-theme="light"] adapts automatically. */

.prose pre {
	position: relative;
	margin: 1.6em 0;
	padding: 1rem;
	background: var(--bg-inset);
	color: var(--text);
	border: 1px solid var(--hairline);
	border-radius: 10px;
	overflow-x: auto;
	font-size: 0.92rem;
	line-height: 1.55;
}

.prose pre code {
	display: block;
	font-family: var(--font-mono);
	background: none;
	color: inherit;
	padding: 0;
	border: 0;
	white-space: pre;
}

/* Copy affordance: JS wraps the pre in .ek-code and appends the button.
   Without JS the code block still renders cleanly (the button is simply absent). */
.ek-code {
	position: relative;
}

.ek-copy {
	position: absolute;
	top: 0.55rem;
	right: 0.55rem;
	padding: 0.35rem 0.75rem;
	font: 600 0.72rem/1.2 var(--font-sans);
	letter-spacing: 0.02em;
	color: var(--text);
	background: var(--bg-elevated);
	border: 1px solid var(--hairline);
	border-radius: 6px;
	cursor: pointer;
}

.ek-copy:hover {
	border-color: var(--accent);
	color: var(--accent-strong);
}

.ek-copy:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.ek-copy.ek-copied {
	color: var(--ok);
	border-color: var(--ok);
}

/* Offscreen helper for the execCommand clipboard fallback (keeps inline styles out). */
.ek-offscreen {
	position: fixed;
	top: -1000px;
	left: -1000px;
	width: 1px;
	height: 1px;
	opacity: 0;
}
