/*
 * What you're currently looking at is the source code of a legally protected, proprietary software.
 * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
 * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
 *
 * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
 */

@import "@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css";

:root {
	/* Keep the editor as big as possible within the limits of the dialog system geometry. */
	--ck-source-editing-enhanced-height: calc(
		var(--ck-dialog-max-height)            /* ─▶   Total max height of the dialog     */
		- var(--ck-form-header-height)         /* ─▶   Height of the dialog header        */
		- 2 * var(--ck-spacing-large)          /* ─┐                                       */
		- var(--ck-ui-component-min-height)    /*  ├─▶ Height of the dialog actions bar   */
		- 2 * var(--ck-spacing-tiny)           /* ─┘                                       */
	);
	--ck-source-editing-enhanced-width: min(80vw, 1200px);
}

.ck.ck-code-editor {
	display: flex;
	align-items: stretch;
	flex-direction: row;
	justify-content: flex-start;
	white-space: initial;
	margin: 0 auto;
	border-bottom: 1px solid var(--ck-color-base-border);
	height: var(--ck-source-editing-enhanced-height);
	width: var(--ck-source-editing-enhanced-width);

	/* Styles of the CodeMirror editor */
	& .cm-editor {
		flex-grow: 1;
		width: 100%;

		&.cm-focused {
			outline: var(--ck-focus-ring);
		}
	}
}
