/**
 * RSM Editor — TinyMCE toolbar chrome (admin only).
 *
 * @package RSM_Editor
 */

:root {
	--rsmspark-cw-brand-orange: #ff6b35;
	--rsmspark-cw-brand-orange-hover: #e85a24;
	--rsmspark-cw-brand-cream: #fff6f1;
}

/* Profile editor wraps (SiteOrigin + wp_editor). */
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .wp-media-buttons,
.so-tinymce-field:has(textarea.rsmspark-rt-editor) .wp-media-buttons,
.rsmspark-rt-editor-wrap + .wp-editor-tools .wp-media-buttons {
	display: none !important;
}

.wp-editor-wrap:has(.rsmspark-rt-insert-media) .wp-media-buttons,
.so-tinymce-field:has(.rsmspark-rt-insert-media) .wp-media-buttons,
.rsmspark-rt-block-editor-wrap:has(.rsmspark-rt-insert-media) .wp-media-buttons,
body.rsmspark-rt-editor-media-row .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .wp-media-buttons,
body.rsmspark-rt-editor-media-row .so-tinymce-field:has(textarea.rsmspark-rt-editor) .wp-media-buttons,
body.rsmspark-rt-editor-media-row .rsmspark-rt-block-editor-wrap .wp-media-buttons {
	display: flex !important;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 6px;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor),
.rsmspark-rt-block-editor-wrap .wp-editor-wrap {
	border-color: #c3c4c7;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .wp-editor-tools,
.rsmspark-rt-block-editor-wrap .wp-editor-tools {
	background: #f6f7f7;
	border-bottom: 1px solid #dcdcde;
	padding: 6px 8px;
}

body.rsmspark-rt-editor-media-row .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .wp-media-buttons,
body.rsmspark-rt-editor-media-row .rsmspark-rt-block-editor-wrap .wp-media-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 6px;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .wp-media-buttons .button,
.rsmspark-rt-block-editor-wrap .wp-media-buttons .button,
.wp-editor-wrap:has(.rsmspark-rt-editor) .rsmspark-rt-insert-media,
.rsmspark-rt-block-editor-wrap .rsmspark-rt-insert-media,
.wp-editor-wrap:has(.rsmspark-rt-editor) .insert-media.add_media {
	background: var(--rsmspark-cw-brand-orange, #ff6b35) !important;
	border: 1px solid var(--rsmspark-cw-brand-orange, #ff6b35) !important;
	border-radius: 4px;
	box-shadow: none !important;
	color: #fff !important;
	font-weight: 500;
	height: auto;
	line-height: 1.4;
	padding: 4px 10px;
}

.wp-editor-wrap:has(.rsmspark-rt-editor) .wp-media-buttons .button:hover,
.rsmspark-rt-block-editor-wrap .wp-media-buttons .button:hover,
.wp-editor-wrap:has(.rsmspark-rt-editor) .rsmspark-rt-insert-media:hover,
.rsmspark-rt-block-editor-wrap .rsmspark-rt-insert-media:hover,
.wp-editor-wrap:has(.rsmspark-rt-editor) .insert-media.add_media:hover {
	background: var(--rsmspark-cw-brand-orange-hover, #e85a24) !important;
	border-color: var(--rsmspark-cw-brand-orange-hover, #e85a24) !important;
	color: #fff !important;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-toolbar-grp,
.rsmspark-rt-block-editor-wrap .mce-toolbar-grp {
	background: #fff;
	border-bottom: 1px solid #dcdcde;
	padding: 6px 8px;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn,
.rsmspark-rt-block-editor-wrap .mce-btn {
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
	margin: 1px 2px;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-ico {
	color: #1d2327;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-size,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-font,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-list-color,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-section,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-media,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-ico.mce-i-rsmspark-rt-size,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-ico.mce-i-rsmspark-rt-font,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-ico.mce-i-rsmspark-rt-list-color,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-ico.mce-i-rsmspark-rt-section,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-ico.mce-i-rsmspark-rt-media,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.rsmspark-rt-painted-icon:before,
.rsmspark-rt-block-editor-wrap .mce-ico.rsmspark-rt-painted-icon:before {
	color: var(--rsmspark-cw-brand-orange, #ff6b35) !important;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn:hover,
.rsmspark-rt-block-editor-wrap .mce-btn:hover,
.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-btn:focus,
.rsmspark-rt-block-editor-wrap .mce-btn:focus {
	background: var(--rsmspark-cw-brand-cream, #fff6f1);
	border-color: var(--rsmspark-cw-brand-orange, #ff6b35);
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn.mce-active,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active,
.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-btn.mce-active:hover,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active:hover {
	background: var(--rsmspark-cw-brand-orange, #ff6b35);
	border-color: var(--rsmspark-cw-brand-orange-hover, #e85a24);
	color: #fff;
}

.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-btn.mce-active .mce-ico,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active .mce-ico,
.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-btn.mce-active .mce-txt,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active .mce-txt {
	color: #fff;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-txt,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-txt {
	display: none;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico,
.rsmspark-rt-block-editor-wrap .mce-btn .mce-ico {
	color: #1d2327;
}

/* Custom RSM toolbar glyphs — inline SVG (dashicons unavailable in block editor TinyMCE chrome). */
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-size,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-font,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-list-color,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-section,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-size,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-font,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-list-color,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-section {
	width: 18px;
	height: 18px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 18px 18px;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-size:before,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-font:before,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-list-color:before,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-section:before,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-size:before,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-font:before,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-list-color:before,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-section:before {
	content: '' !important;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-size,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-size {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath fill='%231d2327' d='M5 4h8v1.5H5V4zm0 8.5h8V14H5v-1.5zM9 6.5l2 2H7l2-2zm0 3l-2 2h4l-2-2z'/%3E%3C/svg%3E");
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-font,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-font {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Ctext x='2' y='13' font-family='Georgia,serif' font-size='11' fill='%231d2327'%3EA%3C/text%3E%3Ctext x='10' y='13' font-family='Georgia,serif' font-size='8' fill='%231d2327'%3Ea%3C/text%3E%3C/svg%3E");
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-list-color,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-list-color {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Ccircle cx='4' cy='5' r='2' fill='%23ff6b35'/%3E%3Crect x='8' y='4' width='8' height='2' fill='%231d2327'/%3E%3Ccircle cx='4' cy='9' r='2' fill='%23cbd5e1'/%3E%3Crect x='8' y='8' width='8' height='2' fill='%231d2327'/%3E%3Ccircle cx='4' cy='13' r='2' fill='%23cbd5e1'/%3E%3Crect x='8' y='12' width='8' height='2' fill='%231d2327'/%3E%3C/svg%3E");
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.mce-i-rsmspark-rt-section,
.rsmspark-rt-block-editor-wrap .mce-ico.mce-i-rsmspark-rt-section {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath fill='%231d2327' d='M3 4h12v2.5H3V4zm0 5h8v2.5H3V9z'/%3E%3C/svg%3E");
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-size,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-font,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-list-color,
.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-section,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-size,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-font,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-list-color,
.rsmspark-rt-block-editor-wrap .mce-btn.mce-active .mce-ico.mce-i-rsmspark-rt-section {
	filter: brightness(0) invert(1);
}

.mce-ico.rsmspark-rt-painted-icon:before {
	content: '' !important;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-panel.mce-menu,
.rsmspark-rt-block-editor-wrap .mce-panel.mce-menu {
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
	overflow: hidden;
}

.wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-menu-item,
.rsmspark-rt-block-editor-wrap .mce-menu-item {
	padding: 4px 0;
}

.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-menu-item .mce-text,
.rsmspark-rt-block-editor-wrap .mce-menu-item .mce-text {
	font-size: 13px;
}

.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-menu-item:hover,
.rsmspark-rt-block-editor-wrap .mce-menu-item:hover,
.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-menu-item.mce-active,
.rsmspark-rt-block-editor-wrap .mce-menu-item.mce-active {
	background: #f0f6fc;
}

/* Color token menu swatches */
.mce-menu-item.rsmspark-rt-color-item .mce-text::before {
	border-radius: 999px;
	content: "";
	display: inline-block;
	height: 12px;
	margin-right: 8px;
	vertical-align: -1px;
	width: 12px;
}

.mce-menu-item.rsmspark-rt-color-item--default .mce-text::before {
	background: #0f172a;
	border: 1px solid #cbd5e1;
}

.mce-menu-item.rsmspark-rt-color-item--muted .mce-text::before {
	background: #64748b;
}

.mce-menu-item.rsmspark-rt-color-item--accent .mce-text::before {
	background: #ff6b35;
}

.mce-menu-item.rsmspark-rt-color-item--primary .mce-text::before {
	background: #2563eb;
}

.mce-menu-item.rsmspark-rt-color-item--inverse .mce-text::before {
	background: #ffffff;
	border: 1px solid #334155;
}

.mce-menu-item.rsmspark-rt-color-item--success .mce-text::before {
	background: #16a34a;
}

.mce-menu-item.rsmspark-rt-color-item--danger .mce-text::before {
	background: #dc2626;
}

.mce-menu-item.rsmspark-rt-color-item--warning .mce-text::before {
	background: #ca8a04;
}

.mce-menu-item.rsmspark-rt-color-item--default .mce-text,
.mce-menu-item.rsmspark-rt-color-item--muted .mce-text,
.mce-menu-item.rsmspark-rt-color-item--accent .mce-text,
.mce-menu-item.rsmspark-rt-color-item--primary .mce-text,
.mce-menu-item.rsmspark-rt-color-item--inverse .mce-text,
.mce-menu-item.rsmspark-rt-color-item--success .mce-text,
.mce-menu-item.rsmspark-rt-color-item--danger .mce-text,
.mce-menu-item.rsmspark-rt-color-item--warning .mce-text {
	color: #1d2327;
}

.mce-menu-item.rsmspark-rt-hex-swatch .mce-text::before {
	background: var(--rsm-swatch, #cbd5e1);
	border: 1px solid rgba(15, 23, 42, 0.15);
	border-radius: 4px;
	content: "";
	display: inline-block;
	height: 16px;
	margin-right: 10px;
	vertical-align: -3px;
	width: 16px;
}

.mce-menu-item.rsmspark-rt-hex-swatch .mce-text {
	color: #1d2327 !important;
}

.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-menu-item.rsmspark-rt-color-item .mce-text,
.rsmspark-rt-block-editor-wrap .mce-menu-item.rsmspark-rt-color-item .mce-text,
.wp-editor-wrap:has(.rsmspark-rt-editor) .mce-menu-item.rsmspark-rt-hex-swatch .mce-text,
.rsmspark-rt-block-editor-wrap .mce-menu-item.rsmspark-rt-hex-swatch .mce-text {
	color: #1d2327 !important;
}

.mce-menu-item.rsmspark-rt-size-item .mce-text {
	color: #1d2327;
}

/* Late cascade: SiteOrigin / SOWB widget forms (wins over suite button skins). */
.siteorigin-widget-form button.rsmspark-rt-insert-media,
.so-tinymce-field button.rsmspark-rt-insert-media,
.sowb-block-editor button.rsmspark-rt-insert-media,
button.rsmspark-rt-insert-media.button,
button.rsmspark-rt-insert-media.rsmspark-cw-button--brand {
	background: var(--rsmspark-cw-brand-orange, #ff6b35) !important;
	border: 1px solid var(--rsmspark-cw-brand-orange, #ff6b35) !important;
	border-radius: 4px;
	box-shadow: none !important;
	color: #fff !important;
	font-weight: 500;
	height: auto;
	line-height: 1.4;
	padding: 4px 10px;
}

.siteorigin-widget-form button.rsmspark-rt-insert-media:hover,
.so-tinymce-field button.rsmspark-rt-insert-media:hover,
.sowb-block-editor button.rsmspark-rt-insert-media:hover,
button.rsmspark-rt-insert-media.button:hover,
button.rsmspark-rt-insert-media.rsmspark-cw-button--brand:hover {
	background: var(--rsmspark-cw-brand-orange-hover, #e85a24) !important;
	border-color: var(--rsmspark-cw-brand-orange-hover, #e85a24) !important;
	color: #fff !important;
}

.siteorigin-widget-form .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-size,
.siteorigin-widget-form .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-font,
.siteorigin-widget-form .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-list-color,
.siteorigin-widget-form .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-section,
.siteorigin-widget-form .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.rsmspark-rt-painted-icon:before,
.so-tinymce-field .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-size,
.so-tinymce-field .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-font,
.so-tinymce-field .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-list-color,
.so-tinymce-field .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-btn .mce-ico.mce-i-rsmspark-rt-section,
.so-tinymce-field .wp-editor-wrap:has(textarea.rsmspark-rt-editor) .mce-ico.rsmspark-rt-painted-icon:before {
	color: var(--rsmspark-cw-brand-orange, #ff6b35) !important;
}
