/**
 * Native syntax-highlighted code blocks.
 *
 * Was deliberately a fixed always-dark "terminal" look (the GitHub/VS
 * Code convention) regardless of the site's light/dark mode -- changed
 * to a light theme on explicit request, matching the sitewide "drop dark
 * mode, light-only" decision made earlier in this build (the same reason
 * the TOC widget's dark-mode variant was removed). Token colors below
 * are a fresh light-appropriate palette, not the old dark-bg colors
 * left in place -- the originals (light blue/green/orange pastels tuned
 * for a near-black background) would have near-invisible contrast on
 * white, so every one was picked and checked against the new background
 * instead.
 */

.nc-code {
	position: relative;
	background: var( --nc-bg-paper );
	border: 1px solid var( --nc-border );
	border-radius: 10px;
	margin: 20px 0;
	overflow-x: auto;
}

.nc-code pre {
	margin: 0;
	padding: 34px 18px 16px;
	background: transparent;
	white-space: pre;
}

.nc-code code {
	font-family: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Consolas, monospace;
	font-size: 13px;
	line-height: 1.6;
	color: var( --nc-ink );
	background: transparent;
	padding: 0;
	white-space: pre;
}

.nc-code__copy {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	gap: 5px;
	background: var( --nc-bg-panel );
	border: 1px solid var( --nc-border-hover );
	color: var( --nc-muted );
	font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
	font-size: 11px;
	padding: 5px 9px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nc-code__copy:hover {
	background: var( --nc-bg-paper );
	color: var( --nc-ink );
	border-color: var( --nc-muted-light );
}

.nc-code__copy.is-copied {
	background: #f0fdf4;
	border-color: #86efac;
	color: #15803d;
}

.nc-code__copy svg {
	flex: 0 0 auto;
}

/* Token colors -- a light, GitHub-style syntax palette. Every hex here
   was picked (not just re-signed from the old dark set) for real
   contrast against --nc-bg-paper. */
.nc-code .tok-keyword { color: #1d4ed8; }
.nc-code .tok-string { color: #15803d; }
.nc-code .tok-comment { color: var( --nc-muted ); font-style: italic; }
.nc-code .tok-number { color: #c2410c; }
.nc-code .tok-placeholder { color: #a21caf; }

@media (max-width: 600px) {
	.nc-code pre {
		padding: 32px 14px 14px;
		font-size: 12.5px;
	}
}
