/**
 * TinyMCE Module - Editor Styles
 *
 * Handles the styling of the TinyMCE toolbar icons and the visualization
 * of custom elements (like grids) inside the editor iframe.
 *
 * @package    Kabook_Editor_Tools
 * @subpackage Kabook_Editor_Tools/modules/tinymce/assets
 * @author     Kabook
 * @license    GPL-2.0+
 */

/* ==========================================================================
   1. Toolbar Icons
   ========================================================================== */

/* Dashicons setup for all Kabook buttons (Shared Styles) */
.mce-i-kabook-styles:before,
.mce-i-kabook-grid:before,
.mce-i-kabook-magic-break:before,
.mce-i-kabook-eraser:before,
.mce-i-kabook-snippets:before {
	font-family: 'dashicons';
	font-weight: 400;
	font-style: normal;
	font-size: 20px;
	line-height: 1;
	color: #005bea; /* Kabook Brand Blue */
	vertical-align: top;
	display: inline-block;
	-webkit-font-smoothing: antialiased;
}

/* Styles Button Icon (Elements & Boxes) */
/* Matches JS icon property: 'kabook-styles' */
.mce-i-kabook-styles:before {
	content: "\f214"; /* dashicons-editor-kitchensink */
}

/* Grid Button Icon */
/* Matches JS icon property: 'kabook-grid' */
.mce-i-kabook-grid:before {
	content: "\f509"; /* dashicons-grid-view */
}

/* Magic Break Button Icon */
/* Matches JS icon property: 'kabook-magic-break' */
.mce-i-kabook-magic-break:before {
	content: "\f474"; /* dashicons-editor-break */
}

/* Eraser / Trash Button Icon */
/* Matches JS icon property: 'kabook-eraser' */
.mce-i-kabook-eraser:before {
	content: "\f182"; /* dashicons-trash */
}

/* Snippets Button Icon */
/* Matches JS icon property: 'kabook-snippets' */
.mce-i-kabook-snippets:before {
	content: "\f475"; /* dashicons-editor-code */
}

/* ==========================================================================
   2. Grid System inside Editor
   ========================================================================== */

/* Ensures correct column rendering inside the editor iframe */
.mce-content-body .kabook-grid {
	display: grid;
	gap: 20px;
	margin-bottom: 20px;
	width: 100%;
	border: 1px dashed #ccc; /* Dashed border for better visibility in editor */
	padding: 10px;
}

/* Column Definitions */
.mce-content-body .kabook-grid-2 {
	grid-template-columns: repeat(2, 1fr);
}

.mce-content-body .kabook-grid-3 {
	grid-template-columns: repeat(3, 1fr);
}

.mce-content-body .kabook-grid-4 {
	grid-template-columns: repeat(4, 1fr);
}

/* Card Styles inside Editor */
.mce-content-body .kabook-card {
	position: relative;
	box-sizing: border-box;
	border: 1px dotted #ddd;
	padding: 10px;
	background: #f9f9f9;
	min-height: 50px;
}

/* Display 'Column' label for user guidance */
.mce-content-body .kabook-card::before {
	content: 'Column';
	position: absolute;
	top: 0;
	right: 0;
	background: #eee;
	color: #999;
	font-size: 9px;
	padding: 2px 5px;
	pointer-events: none;
}

/* Remove margin from the last paragraph to keep spacing tidy */
.mce-content-body .kabook-card p:last-child {
	margin-bottom: 0;
}