/*
 * 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
 */

:root {
	--ck-color-selector-focused-cell-background: hsla(212, 90%, 80%, .3);
	--ck-table-content-default-border-color: hsl(0, 0%, 83%);
}

.ck-widget.table {
	/* Dashed outline for table without any border. */
	& table[style*="border:none"],
	& table[style*="border-style:none"] {
		outline: var(--ck-table-content-default-border-color) 1px dashed;
	}

	& td,
	& th {
		/**
		 * While setting outline is fine, the border should not be modified here
		 * because it overrides the default table cell border color which is not expected.
		 * So do not use `@mixin ck-focus-ring;` here, or any other border styles.
		 * See more: https://github.com/ckeditor/ckeditor5/issues/16979
		 */
		&.ck-editor__nested-editable {
			outline: unset;

			&:not(.ck-editor__editable_selected) {
				&.ck-editor__nested-editable_focused,
				&:focus {
					/* A very slight background to highlight the focused cell */
					background: var(--ck-color-selector-focused-cell-background);
					outline: 1px solid var(--ck-color-focus-border);
					outline-offset: -1px; /* progressive enhancement - no IE support */
				}
			}
		}
	}
}
