/*
 * Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
 */

:root {
	--ck-color-code-block-label-background: hsl(0, 0%, 46%);
}

.ck.ck-editor__editable pre[data-language]::after {
	content: attr(data-language);
	position: absolute;
	top: -1px;
	right: 10px;
	background: var(--ck-color-code-block-label-background);

	font-size: 10px;
	font-family: var(--ck-font-face);
	line-height: 16px;
	padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);
	color: hsl(0, 0%, 100%);
	white-space: nowrap;
}

.ck.ck-code-block-dropdown .ck-dropdown__panel {
	/* There could be dozens of languages available. Use scroll to prevent a 10e6px dropdown. */
	max-height: 250px;
	overflow-y: auto;
	overflow-x: hidden;
}

.ck-content pre {
	padding: 1em;
	color: hsl(0, 0%, 20.8%);
	background: hsla(0, 0%, 78%, 0.3);
	border: 1px solid hsl(0, 0%, 77%);
	border-radius: 2px;

	/* Code block are language direction–agnostic. */
	text-align: left;
	direction: ltr;

	tab-size: 4;
	white-space: pre-wrap;

	/* Don't inherit the style, e.g. when in a block quote. */
	font-style: normal;

	/* Don't let the code be squashed e.g. when in a table cell. */
	min-width: 200px;

	& code {
		background: unset;
		padding: 0;
		border-radius: 0;
	}
}

.ck.ck-editor__editable pre {
	position: relative;
}
