
/**
 * Cute Code Copy
 *
 * VS Code-inspired dark Code Blocks.
 *
 * @package CuteCodeCopy
 */

pre.wp-block-code {
	position: relative;
	margin-top: 1.5em;
	margin-bottom: 1.5em;
	padding: 22px 20px;

	border: 1px solid #303030;
	border-radius: 8px;

	background: #1e1e1e;
	color: #d4d4d4;

	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);

	overflow: auto;
}

pre.wp-block-code code {
	display: block;

	margin: 0;
	padding: 0;

	background: transparent;
	color: #d4d4d4;

	font-family:
		"SFMono-Regular",
		Consolas,
		"Liberation Mono",
		Menlo,
		monospace;

	font-size: 14px;
	line-height: 1.7;

	white-space: pre;
	tab-size: 4;
}

/*
 * Copy button.
 */
pre.wp-block-code .cutecopy-button {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;

	min-height: 34px;
	padding: 7px 12px;

	border: 1px solid #454545;
	border-radius: 6px;

	background: #252526;
	color: #d4d4d4;

	font-family:
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		Arial,
		sans-serif;

	font-size: 12px;
	font-weight: 600;
	line-height: 1;

	cursor: pointer;

	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);

	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease,
		transform 0.15s ease;
}

pre.wp-block-code .cutecopy-button:hover {
	background: #333333;
	border-color: #666666;
	color: #ffffff;

	transform: translateY(-1px);
}

pre.wp-block-code .cutecopy-button:focus {
	outline: none;
}

pre.wp-block-code .cutecopy-button:focus-visible {
	outline: 2px solid #3794ff;
	outline-offset: 2px;
}

pre.wp-block-code .cutecopy-button:active {
	transform: translateY(0);
}

pre.wp-block-code .cutecopy-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	font-size: 15px;
	line-height: 1;
}

/*
 * Copied state.
 */
pre.wp-block-code .cutecopy-button.cutecopy-copied {
	background: #16825d;
	border-color: #16825d;
	color: #ffffff;
}

/*
 * Error state.
 */
pre.wp-block-code .cutecopy-button.cutecopy-error {
	background: #c94f4f;
	border-color: #c94f4f;
	color: #ffffff;
}

/*
 * Scrollbar.
 */
pre.wp-block-code::-webkit-scrollbar {
	width: 9px;
	height: 9px;
}

pre.wp-block-code::-webkit-scrollbar-track {
	background: #181818;
}

pre.wp-block-code::-webkit-scrollbar-thumb {
	background: #424242;
	border-radius: 5px;
}

pre.wp-block-code::-webkit-scrollbar-thumb:hover {
	background: #555555;
}

/*
 * Mobile.
 */
@media (max-width: 600px) {
	pre.wp-block-code {
		padding: 18px 15px;
		border-radius: 7px;
	}

	pre.wp-block-code code {
		font-size: 13px;
		line-height: 1.6;
	}

	pre.wp-block-code .cutecopy-button {
		top: 8px;
		right: 8px;
		min-height: 32px;
		padding: 6px 9px;
	}
}

/*
 * Reduced motion.
 */
@media (prefers-reduced-motion: reduce) {
	pre.wp-block-code .cutecopy-button {
		transition: none;
	}
}
