/* =============================================================
 * Calumet Post Dashboard
 * Modern card + modal UI for the [calumet_post_dashboard] shortcode.
 * ============================================================= */

/* Apply tokens to the dashboard root, modal, and full-page editor shell.
 * The modal is a sibling of .cpd-root; the page editor (.cpd-editor) is used
 * by Content Manager and is neither .cpd-root nor .cpd-modal. */
.cpd-root,
.cpd-modal,
.cpd-editor {
	--cpd-bg: var(--am-color-bg, #f6f7f9);
	--cpd-surface: var(--am-color-surface, #ffffff);
	--cpd-border: var(--am-color-border, #e2e6ec);
	--cpd-border-strong: var(--am-color-border-strong, #c8cfd8);
	--cpd-text: var(--am-color-text, #1d2327);
	--cpd-text-muted: var(--am-color-text-muted, #6b7280);
	--cpd-primary: var(--am-color-primary, #2271b1);
	--cpd-primary-hover: var(--am-color-primary-hover, #135e96);
	--cpd-danger: var(--am-color-danger, #b32d2e);
	--cpd-success: var(--am-color-success, #008a20);
	--cpd-warning: var(--am-color-warning, #b88600);
	--cpd-en: var(--am-color-success, #008a20);
	--cpd-fr: var(--am-color-primary, #2271b1);
	--cpd-shadow-sm: var(--am-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
	--cpd-shadow-md: var(--am-shadow-md, 0 6px 18px rgba(15, 23, 42, 0.10));
	--cpd-radius: 12px;
	--cpd-radius-sm: 6px;
}

.cpd-root {
	box-sizing: border-box;
	color: var(--cpd-text);
	font-size: 14px;
	line-height: 1.45;
	margin-top: 16px;

	/* Constrain the dashboard so it doesn't stretch edge-to-edge on wide admin screens. */
	max-width: 1400px;
	width: 100%;
}

.cpd-root *,
.cpd-root *::before,
.cpd-root *::after {
	box-sizing: inherit;
}

/* ---------- Toolbar ---------- */
.cpd-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	padding: 12px 16px;
	background: var(--cpd-surface);
	border: 1px solid var(--cpd-border);
	border-radius: var(--cpd-radius);
	box-shadow: var(--cpd-shadow-sm);
}

.cpd-toolbar-left,
.cpd-toolbar-right {
	display: flex;
	gap: 8px;
	align-items: center;
}

.cpd-toolbar-left {
	flex: 1;
	min-width: 240px;
}

.cpd-search {
	flex: 1;
	min-width: 200px;
	max-width: 360px;
	padding: 8px 12px;
	border: 1px solid var(--cpd-border-strong);
	border-radius: var(--cpd-radius-sm);
	background: #fff;
	font-size: 14px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cpd-search:focus {
	outline: none;
	border-color: var(--cpd-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

/* ---------- Toolbar category filter (multi-select dropdown) ---------- */
.cpd-cat-filter {
	position: relative;
	display: inline-flex;
}

.cpd-cat-filter-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px 7px 12px;
	background: #fff;
	border: 1px solid var(--cpd-border-strong);
	border-radius: var(--cpd-radius-sm);
	font-size: 14px;
	font-family: inherit;
	color: var(--cpd-text);
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
	max-width: 240px;
}

.cpd-cat-filter-toggle:hover,
.cpd-cat-filter-toggle:focus-visible {
	outline: none;
	border-color: var(--cpd-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cpd-cat-filter.has-selection .cpd-cat-filter-toggle {
	border-color: var(--cpd-primary);
	color: var(--cpd-primary-hover);
}

.cpd-cat-filter.is-muni-locked .cpd-cat-filter-toggle {
	cursor: default;
	opacity: 0.92;
}

.cpd-cat-filter.is-muni-locked .cpd-cat-filter-toggle:hover,
.cpd-cat-filter.is-muni-locked .cpd-cat-filter-toggle:focus-visible {
	border-color: var(--cpd-border-strong);
	box-shadow: none;
}

.cpd-cat-filter.is-muni-locked .cpd-cat-filter-toggle .dashicons {
	display: none;
}

.cpd-cat-filter-toggle .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
	color: var(--cpd-text-muted);
	transition: transform 0.15s ease;
}

.cpd-cat-filter.is-open .cpd-cat-filter-toggle .dashicons {
	transform: rotate(180deg);
}

.cpd-cat-filter-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cpd-cat-filter-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: var(--cpd-primary);
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.cpd-cat-filter-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 50;
	width: 280px;
	max-width: 92vw;
	background: var(--cpd-surface);
	border: 1px solid var(--cpd-border-strong);
	border-radius: var(--cpd-radius-sm);
	box-shadow: var(--cpd-shadow-md);
	display: flex;
	flex-direction: column;
}

.cpd-cat-filter-panel[hidden] {
	display: none;
}

.cpd-cat-filter-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--cpd-border);
	background: #fafbfc;
	border-top-left-radius: var(--cpd-radius-sm);
	border-top-right-radius: var(--cpd-radius-sm);
}

.cpd-cat-filter-panel-title {
	font-size: 11px;
	font-weight: 700;
	color: var(--cpd-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cpd-cat-filter-clear {
	background: transparent;
	border: 0;
	padding: 2px 6px;
	font-size: 12px;
	font-weight: 500;
	color: var(--cpd-primary);
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.15s ease, color 0.15s ease;
}

.cpd-cat-filter-clear:hover,
.cpd-cat-filter-clear:focus-visible {
	outline: none;
	background: rgba(34, 113, 177, 0.10);
	color: var(--cpd-primary-hover);
}

.cpd-cat-filter-list {
	max-height: 320px;
	overflow-y: auto;
	padding: 6px 4px;
}

.cpd-cat-filter-empty {
	padding: 12px;
	font-size: 12px;
	color: var(--cpd-text-muted);
	font-style: italic;
	text-align: center;
}

.cpd-cat-filter-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: var(--cpd-radius-sm);
	cursor: pointer;
	font-size: 13px;
	color: var(--cpd-text);
	user-select: none;
	transition: background 0.12s ease, color 0.12s ease;
}

.cpd-cat-filter-item:hover {
	background: #f1f4f7;
}

.cpd-cat-filter-item.is-checked {
	color: var(--cpd-primary-hover);
	font-weight: 500;
}

.cpd-cat-filter-item input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin: 0;
	border: 1px solid var(--cpd-border-strong);
	border-radius: 4px;
	background: #fff;
	position: relative;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.cpd-cat-filter-item input[type="checkbox"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.25);
}

.cpd-cat-filter-item input[type="checkbox"]:checked {
	background: var(--cpd-primary);
	border-color: var(--cpd-primary);
}

.cpd-cat-filter-item input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	left: 3px;
	top: 0;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.cpd-cat-filter-item-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- Toast ---------- */
.cpd-toast {
	display: none;
	margin-bottom: 12px;
	padding: 10px 14px;
	border-radius: var(--cpd-radius-sm);
	background: #eef6ff;
	border: 1px solid #b6d4f5;
	color: #0c3a66;
	font-weight: 500;
}

.cpd-toast.is-visible {
	display: block;
}

.cpd-toast.is-success {
	background: #ecfaf0;
	border-color: #a8e3bc;
	color: #054e1d;
}

.cpd-toast.is-error {
	background: #fdecea;
	border-color: #f3b9b6;
	color: #6b1110;
}

.cpd-toast.is-warning {
	background: #fff8e1;
	border-color: #f3d27e;
	color: #6b4a00;
}

/* ---------- Card grid ---------- */
.cpd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}

.cpd-empty {
	grid-column: 1 / -1;
	padding: 32px;
	text-align: center;
	color: var(--cpd-text-muted);
	background: var(--cpd-surface);
	border: 1px dashed var(--cpd-border-strong);
	border-radius: var(--cpd-radius);
}

.cpd-card {
	display: flex;
	flex-direction: column;
	padding: 16px;
	background: var(--cpd-surface);
	border: 1px solid var(--cpd-border);
	border-radius: var(--cpd-radius);
	box-shadow: var(--cpd-shadow-sm);
	cursor: default;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
	text-align: left;
	font: inherit;
	color: inherit;
}

.cpd-card.is-viewable {
	cursor: pointer;
}

.cpd-card:hover,
.cpd-card:focus-visible {
	transform: translateY(-2px);
	box-shadow: var(--cpd-shadow-md);
	border-color: var(--cpd-border-strong);
	outline: none;
}

/* ---------- Card View + Edit actions ---------- */
.cpd-card-badge-actions {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

.cpd-card-view-btn,
.cpd-card-preview-btn,
.cpd-card-edit-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 0;
	padding: 3px 10px 3px 8px;
	background: #fff;
	border: 1px solid var(--cpd-border-strong);
	border-radius: 999px;
	color: var(--cpd-primary);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cpd-card-view-btn:hover,
.cpd-card-view-btn:focus-visible,
.cpd-card-preview-btn:hover,
.cpd-card-preview-btn:focus-visible,
.cpd-card-edit-btn:hover,
.cpd-card-edit-btn:focus-visible {
	background: var(--cpd-primary);
	border-color: var(--cpd-primary);
	color: #fff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cpd-card-view-btn .dashicons,
.cpd-card-preview-btn .dashicons,
.cpd-card-edit-btn .dashicons {
	width: 14px;
	height: 14px;
	font-size: 14px;
	line-height: 1;
}

/* Icon-only View / Edit buttons: square hit area, no text-side padding. */
.cpd-card-view-btn.is-icon-only,
.cpd-card-preview-btn.is-icon-only,
.cpd-card-edit-btn.is-icon-only {
	gap: 0;
	padding: 4px;
	width: 26px;
	height: 26px;
	justify-content: center;
}

.cpd-card-view-btn.is-icon-only .dashicons,
.cpd-card-preview-btn.is-icon-only .dashicons,
.cpd-card-edit-btn.is-icon-only .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

.cpd-card-edit-label {
	text-transform: uppercase;
}

#cpd-view .dashicons,
#cpd-preview .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
	margin-right: 2px;
}

/* ---------- Card action row (translation + EN/FR audio) ---------- */
.cpd-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed var(--cpd-border);
	cursor: auto;
}

.cpd-card-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	background: #f6f8fb;
	border: 1px solid var(--cpd-border);
	border-radius: 999px;
	font-size: 11px;
	color: var(--cpd-text-muted);
	line-height: 1;
}

.cpd-card-action-label {
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	font-size: 10px;
	color: var(--cpd-text-muted);
}

.cpd-card-action-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
}

.cpd-card-action-mark .dashicons {
	width: 14px;
	height: 14px;
	font-size: 14px;
	line-height: 1;
}

.cpd-card-action-mark.is-present {
	background: rgba(0, 138, 32, 0.12);
	color: var(--cpd-success);
}

.cpd-card-action-mark.is-missing {
	background: #eef0f3;
	color: var(--cpd-text-muted);
}

.cpd-card-action-btn,
.cpd-card-action-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	background: #fff;
	border: 1px solid var(--cpd-border-strong);
	border-radius: 50%;
	color: var(--cpd-primary);
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cpd-card-action-btn .dashicons,
.cpd-card-action-link .dashicons {
	width: 14px;
	height: 14px;
	font-size: 14px;
	line-height: 1;
}

.cpd-card-action-btn:hover:not(:disabled),
.cpd-card-action-btn:focus-visible:not(:disabled),
.cpd-card-action-link:hover,
.cpd-card-action-link:focus-visible {
	background: var(--cpd-primary);
	border-color: var(--cpd-primary);
	color: #fff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cpd-card-action-link {
	color: var(--cpd-success);
	border-color: rgba(0, 138, 32, 0.45);
	background: rgba(0, 138, 32, 0.08);
}

.cpd-card-action-link:hover,
.cpd-card-action-link:focus-visible {
	background: var(--cpd-success);
	border-color: var(--cpd-success);
	box-shadow: 0 0 0 3px rgba(0, 138, 32, 0.15);
}

.cpd-card-action-btn:disabled,
.cpd-card-action-btn[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.cpd-card-action-btn.is-loading .cpd-spinner {
	color: var(--cpd-primary);
	width: 12px;
	height: 12px;
	border-width: 2px;
}

.cpd-card-action-status {
	flex-basis: 100%;
	font-size: 11px;
	color: var(--cpd-text-muted);
	min-height: 14px;
}

.cpd-card-action-status.is-success {
	color: var(--cpd-success);
	font-weight: 500;
}

.cpd-card-action-status.is-error {
	color: var(--cpd-danger);
	font-weight: 500;
}

.cpd-card-badges {
	display: flex;
	gap: 6px;
	margin-bottom: 10px;
}

.cpd-card-title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--cpd-text);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cpd-card-fr-title {
	margin: 0 0 12px;
	font-size: 13px;
	color: var(--cpd-text-muted);
	font-style: italic;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cpd-card-meta {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
	color: var(--cpd-text-muted);
	align-items: center;
}

/* Audience / visibility badge on post cards */
.cpd-audience-badge {
	display: inline-flex !important;
	align-items: center;
	height: 20px;
	padding: 0 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1;
	white-space: nowrap;
}

.cpd-audience-badge.is-private {
	color: #6b5b00;
	background: rgba(214, 176, 0, 0.16);
	border: 1px solid rgba(214, 176, 0, 0.45);
}

.cpd-audience-badge.is-team {
	color: #0b4f8a;
	background: rgba(34, 113, 177, 0.12);
	border: 1px solid rgba(34, 113, 177, 0.35);
}

.cpd-modal-audience-picker {
	display: inline-flex;
	align-items: center;
}

.cpd-modal-audience-select {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	max-width: 200px;
	padding: 6px 28px 6px 12px;
	background: #fff;
	border: 1px solid var(--cpd-border, #e2e6ec);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	color: var(--cpd-text, #1d2327);
	line-height: 1.4;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='%2350575e' d='M5 7l5 6 5-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
}

.cpd-modal-audience-select:focus {
	outline: none;
	border-color: var(--cpd-primary, #2271b1);
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Compact "View" badge in card meta — not the green action-button treatment */
.cpd-view-badge,
.cpd-card-meta .cpd-card-action-link {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	height: 22px;
	padding: 0 10px !important;
	border-radius: 999px !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	letter-spacing: 0.02em;
	line-height: 1;
	text-decoration: none !important;
	color: var(--cpd-primary, #2271b1) !important;
	background: rgba(34, 113, 177, 0.08) !important;
	border: 1px solid rgba(34, 113, 177, 0.35) !important;
	box-shadow: none !important;
	white-space: nowrap;
}

.cpd-view-badge:hover,
.cpd-view-badge:focus-visible,
.cpd-card-meta .cpd-card-action-link:hover,
.cpd-card-meta .cpd-card-action-link:focus-visible {
	color: #fff !important;
	background: var(--cpd-primary, #2271b1) !important;
	border-color: var(--cpd-primary, #2271b1) !important;
	outline: none;
}

.cpd-card-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.cpd-card-cat {
	padding: 2px 8px;
	background: #eef2f7;
	border-radius: 999px;
	font-size: 11px;
	color: #2d3748;
}

/* ---------- Badges ---------- */
.cpd-lang-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 20px;
	padding: 0 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #fff;
	text-transform: uppercase;
}

.cpd-lang-en {
	background: var(--cpd-en);
}

.cpd-lang-fr {
	background: var(--cpd-fr);
}

.cpd-lang-fr.is-missing {
	background: #e2e5ea;
	color: #6b7280;
}

.cpd-lang-fr.is-draft {
	background: #6b7280;
}

.cpd-status-badge {
	display: inline-flex;
	align-items: center;
	height: 20px;
	padding: 0 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	background: #eef2f7;
	color: #2d3748;
	text-transform: capitalize;
}

.cpd-status-badge.is-publish {
	background: #ecfaf0;
	color: #054e1d;
}

.cpd-status-badge.is-draft {
	background: #f1f4f7;
	color: #4b5563;
}

.cpd-status-badge.is-pending {
	background: #fff4d6;
	color: #6b4a00;
}

.cpd-status-badge.is-future {
	background: #e3edff;
	color: #1d3a8a;
}

.cpd-status-badge.is-trash {
	background: #f3f4f6;
	color: #4b5563;
}

.cpd-card.is-trashed {
	opacity: 0.92;
	border-style: dashed;
}

.cpd-card-restore-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 1px solid var(--cpd-border-strong, #c8cfd8);
	border-radius: 8px;
	background: #fff;
	color: #1d2327;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	line-height: 1.2;
}

.cpd-card-restore-btn:hover,
.cpd-card-restore-btn:focus {
	border-color: #2271b1;
	color: #135e96;
}

.cpd-card-restore-btn .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

.cpd-card-restore-btn:disabled {
	opacity: 0.65;
	cursor: wait;
}

.cpd-card-purge-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 1px solid #d63638;
	border-radius: 8px;
	background: #fff;
	color: #b32d2e;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	line-height: 1.2;
}

.cpd-card-purge-btn:hover,
.cpd-card-purge-btn:focus {
	background: #fef2f2;
	border-color: #b32d2e;
	color: #8a2424;
}

.cpd-card-purge-btn .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

.cpd-card-purge-btn:disabled {
	opacity: 0.65;
	cursor: wait;
}

/* ---------- Pagination ---------- */
.cpd-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 20px;
}

.cpd-page-info {
	font-size: 13px;
	color: var(--cpd-text-muted);
}

/* ---------- Buttons ---------- */
.cpd-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: var(--cpd-radius-sm);
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
	line-height: 1.2;
	text-decoration: none;
}

.cpd-btn .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

.cpd-btn:disabled,
.cpd-btn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.cpd-btn-primary {
	background: #2271b1;
	background: var(--cpd-primary, #2271b1);
	color: #fff;
	border-color: #2271b1;
	border-color: var(--cpd-primary, #2271b1);
}

.cpd-btn-primary:hover:not(:disabled),
.cpd-btn-primary:focus-visible:not(:disabled) {
	background: #135e96;
	background: var(--cpd-primary-hover, #135e96);
	border-color: #135e96;
	border-color: var(--cpd-primary-hover, #135e96);
}

.cpd-btn-ghost {
	background: var(--cpd-surface, #fff);
	color: var(--cpd-text);
	border-color: var(--cpd-border-strong);
}

.cpd-btn-ghost:hover:not(:disabled),
.cpd-btn-ghost:focus-visible:not(:disabled) {
	border-color: var(--cpd-primary);
	color: var(--cpd-primary);
}

.cpd-btn-danger {
	background: #dc3545;
	color: #fff;
	border-color: #dc3545;
}

.cpd-btn-danger:hover:not(:disabled),
.cpd-btn-danger:focus-visible:not(:disabled) {
	background: #bb2d3b;
	border-color: #bb2d3b;
	color: #fff;
}

.cpd-btn-success {
	background: #008a20;
	background: var(--cpd-success, #008a20);
	color: #fff;
	border-color: #008a20;
	border-color: var(--cpd-success, #008a20);
}

.cpd-btn-success:hover:not(:disabled),
.cpd-btn-success:focus-visible:not(:disabled) {
	background: #00701a;
	border-color: #00701a;
	color: #fff;
}

.cpd-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	border-radius: var(--cpd-radius-sm);
	cursor: pointer;
	color: var(--cpd-text-muted);
}

.cpd-icon-btn:hover,
.cpd-icon-btn:focus-visible {
	background: #f1f4f7;
	color: var(--cpd-text);
	outline: none;
}

/* ---------- Modal ---------- */
.cpd-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.cpd-modal[hidden] {
	display: none;
}

.cpd-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(2px);
}

.cpd-modal-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1200px;
	max-height: calc(100vh - 48px);
	display: flex;
	flex-direction: column;
	background: #ffffff;
	background: var(--cpd-surface, #ffffff);
	border: 1px solid var(--cpd-border, #e2e6ec);
	border-radius: var(--cpd-radius, 12px);
	box-shadow: 0 25px 60px rgba(15, 23, 42, 0.30);
	overflow: hidden;
}

.cpd-modal-header {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--cpd-border, #e2e6ec);
	background: #fafbfc;
	color: var(--cpd-text, #1d2327);
}

.cpd-modal-header-row {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.cpd-modal-header-row-top {
	flex-wrap: nowrap;
	align-items: center;
	gap: 12px;
}

.cpd-modal-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	flex-shrink: 0;
	min-width: 0;
}

.cpd-modal-header-controls {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	flex-shrink: 0;
}

.cpd-modal-close {
	flex-shrink: 0;
	margin-left: 4px;
}

.cpd-header-eyebrow {
	font-size: 11px;
	font-weight: 700;
	color: var(--cpd-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cpd-header-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.cpd-modal-status-picker.has-selection .cpd-modal-cat-toggle,
.cpd-modal-status-picker.is-open .cpd-modal-cat-toggle {
	border-color: var(--cpd-primary);
	color: var(--cpd-primary-hover);
}

.cpd-modal-status-list {
	display: flex;
	flex-direction: column;
	padding: 6px;
	max-height: 240px;
	overflow-y: auto;
}

.cpd-modal-status-option {
	display: block;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--cpd-text);
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}

.cpd-modal-status-option:hover,
.cpd-modal-status-option:focus-visible {
	outline: none;
	background: #f3f4f6;
}

.cpd-modal-status-option.is-active {
	background: rgba(34, 113, 177, 0.10);
	color: var(--cpd-primary-hover);
}

/* Modal category picker (dropdown beside status) */
.cpd-modal-cat-picker {
	position: relative;
	display: inline-flex;
}

.cpd-modal-cat-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px 6px 12px;
	background: #fff;
	border: 1px solid var(--cpd-border, #e2e6ec);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	color: var(--cpd-text);
	line-height: 1.4;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
	max-width: 200px;
}

.cpd-modal-cat-toggle:hover,
.cpd-modal-cat-toggle:focus-visible {
	outline: none;
	border-color: #c8cfd8;
}

.cpd-modal-cat-picker.has-selection .cpd-modal-cat-toggle,
.cpd-modal-cat-picker.is-open .cpd-modal-cat-toggle {
	border-color: var(--cpd-primary);
	color: var(--cpd-primary-hover);
}

.cpd-modal-cat-toggle .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
	color: var(--cpd-text-muted);
	transition: transform 0.15s ease;
}

.cpd-modal-cat-picker.is-open .cpd-modal-cat-toggle .dashicons {
	transform: rotate(180deg);
}

.cpd-modal-cat-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cpd-modal-cat-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: var(--cpd-primary);
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

.cpd-modal-cat-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 10060;
	width: 280px;
	max-width: 92vw;
	background: #ffffff;
	background-color: #ffffff;
	border: 1px solid var(--cpd-border-strong, #c8cfd8);
	border-radius: var(--cpd-radius-sm, 8px);
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
	display: flex;
	flex-direction: column;
	opacity: 1;
	color: var(--cpd-text, #1d2327);
}

.cpd-modal-cat-panel[hidden] {
	display: none;
}

.cpd-modal-cat-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--cpd-border);
	background: #fafbfc;
	border-top-left-radius: var(--cpd-radius-sm);
	border-top-right-radius: var(--cpd-radius-sm);
}

.cpd-modal-cat-panel-title {
	font-size: 11px;
	font-weight: 700;
	color: var(--cpd-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cpd-modal-cat-clear {
	border: 0;
	background: transparent;
	color: var(--cpd-primary);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 4px;
}

.cpd-modal-cat-clear:hover,
.cpd-modal-cat-clear:focus-visible {
	outline: none;
	background: rgba(34, 113, 177, 0.08);
}

.cpd-modal-cat-list {
	max-height: 260px;
	overflow-y: auto;
	padding: 6px;
}

.cpd-modal-cat-empty {
	padding: 12px;
	font-size: 13px;
	color: var(--cpd-text-muted);
	text-align: center;
}

.cpd-modal-cat-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	color: var(--cpd-text);
	transition: background 0.12s ease;
}

.cpd-modal-cat-item:hover {
	background: #f3f4f6;
}

.cpd-modal-cat-item.is-checked {
	background: rgba(34, 113, 177, 0.08);
}

.cpd-modal-cat-item input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	margin: 0;
	border: 1px solid var(--cpd-border-strong);
	border-radius: 4px;
	background: #fff;
	flex-shrink: 0;
	cursor: pointer;
	position: relative;
}

.cpd-modal-cat-item input[type="checkbox"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cpd-modal-cat-item input[type="checkbox"]:checked {
	background: var(--cpd-primary);
	border-color: var(--cpd-primary);
}

.cpd-modal-cat-item input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 2px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.cpd-modal-cat-item-name {
	line-height: 1.35;
}

.cpd-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	background: #ffffff;
	color: var(--cpd-text, #1d2327);
}

/* Media row — legacy 3-col (kept for any residual markup) */
.cpd-media-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 18px;
	padding-bottom: 16px;
	border-bottom: 1px dashed var(--cpd-border);
}

@media (max-width: 900px) {
	.cpd-media-row {
		grid-template-columns: 1fr;
	}
}

/* Editor layout — sidebar media + main editor (modal stacks; page uses 30/70) */
.cpd-editor-layout {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cpd-editor-sidebar {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.cpd-editor-main {
	min-width: 0;
}

.cpd-editor-card {
	padding: 14px;
	border: 1px solid var(--cpd-border, #e2e8f0);
	border-radius: 10px;
	background: #fff;
	min-width: 0;
}

.cpd-editor-card--editor {
	padding: 12px 14px 14px;
}

.cpd-editor-card--author,
.cpd-editor-card--excerpt {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cpd-excerpt-input {
	display: block;
	width: 100%;
	min-height: 88px;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid var(--cpd-border, #e2e6ec);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 400;
	font-family: inherit;
	color: var(--cpd-text, #1d2327);
	line-height: 1.45;
	resize: vertical;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cpd-excerpt-input:focus {
	outline: none;
	border-color: var(--cpd-primary, #2271b1);
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.cpd-excerpt-hint {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--cpd-muted, #64748b);
}

.cpd-author-select {
	display: block;
	width: 100%;
	min-height: 36px;
	padding: 6px 28px 6px 12px;
	background: #fff;
	border: 1px solid var(--cpd-border, #e2e6ec);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	color: var(--cpd-text, #1d2327);
	line-height: 1.4;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='%2350575e' d='M5 7l5 6 5-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
}

.cpd-author-select:focus {
	outline: none;
	border-color: var(--cpd-primary, #2271b1);
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.cpd-editor-card--syndication {
	width: 100%;
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cpd-syndication-empty {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--cpd-muted, #64748b);
}

.cpd-syndication-sites {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.cpd-syndication-site {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--cpd-border, #e2e8f0);
	border-radius: 8px;
	background: #fff;
	color: var(--cpd-text, #1e293b);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cpd-syndication-site:hover {
	border-color: var(--cpd-border-strong, #cbd5e1);
}

.cpd-syndication-site:focus-visible {
	outline: 2px solid var(--cpd-primary, #2271b1);
	outline-offset: 2px;
}

.cpd-syndication-site.is-selected {
	background: var(--cpd-success, #008a20);
	border-color: var(--cpd-success, #008a20);
	color: #fff;
}

.cpd-syndication-site.is-selected:hover {
	border-color: var(--cpd-success, #008a20);
	filter: brightness(0.95);
}

.cpd-syndication-site__label {
	display: block;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cpd-media-block {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.cpd-media-preview {
	width: 100%;
	height: 100px;
	border-radius: var(--cpd-radius-sm);
	border: 1px solid var(--cpd-border);
	background: #f6f7f9;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.cpd-editor-card--featured .cpd-media-preview {
	height: 160px;
}

.cpd-media-preview img,
.cpd-media-preview audio {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cpd-media-preview audio {
	object-fit: contain;
	padding: 8px;
	box-sizing: border-box;
	background: #fff;
}

.cpd-media-placeholder .dashicons {
	width: 32px;
	height: 32px;
	font-size: 32px;
	color: var(--cpd-border-strong);
}

.cpd-media-input {
	width: 100%;
	padding: 7px 10px;
	font-size: 12px;
}

.cpd-media-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.cpd-btn--sm {
	padding: 5px 10px;
	font-size: 12px;
}

.cpd-media-block.is-set .cpd-media-preview {
	border-color: var(--cpd-border-strong);
	background: #fff;
}

.cpd-featured {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.cpd-editor-card--bylaw-pdfs {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.cpd-editor-card--bylaw-pdfs[hidden] {
	display: none !important;
}

.cpd-bylaw-pdf-label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 600;
	color: var(--cpd-muted, #646970);
}

.cpd-editor-card--bylaw-pdfs .cpd-media-preview {
	min-height: 88px;
}

.cpd-modal-cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 900px) {
	.cpd-modal-cols {
		grid-template-columns: 1fr;
	}
}

.cpd-modal-primary-lang {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cpd-modal-primary-select {
	display: inline-flex;
	align-items: center;
	min-width: 140px;
	max-width: 200px;
	min-height: 34px;
	padding: 6px 28px 6px 12px;
	background: #fff;
	border: 1px solid var(--cpd-border, #e2e6ec);
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	color: var(--cpd-text, #1d2327);
	line-height: 1.4;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='%2350575e' d='M5 7l5 6 5-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
}

.cpd-modal-primary-select:focus {
	outline: none;
	border-color: var(--cpd-primary, #2271b1);
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.cpd-lang-editor {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: 8px;
}

.cpd-lang-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border-bottom: 1px solid var(--cpd-border, #dcdcde);
	padding: 0 2px;
}

.cpd-lang-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid transparent;
	border-bottom: 0;
	border-radius: 6px 6px 0 0;
	background: transparent;
	color: #50575e;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
}

.cpd-lang-tab:hover,
.cpd-lang-tab:focus {
	color: #1d2327;
	background: #f6f7f7;
	outline: none;
}

.cpd-lang-tab.is-active {
	background: #fafbfc;
	border-color: var(--cpd-border, #dcdcde);
	color: #1d2327;
	position: relative;
	bottom: -1px;
}

.cpd-lang-tab .cpd-lang-badge {
	font-size: 11px;
	letter-spacing: 0.03em;
	/* Fallback when a language has no .cpd-lang-{code} color rule */
	background: #6b7280;
	color: #fff;
}

.cpd-lang-tab .cpd-lang-badge.cpd-lang-en {
	background: var(--cpd-en);
}

.cpd-lang-tab .cpd-lang-badge.cpd-lang-fr {
	background: var(--cpd-fr);
}

.cpd-lang-panels {
	position: relative;
	background: #fafbfc;
	border: 1px solid var(--cpd-border, #dcdcde);
	border-radius: 0 6px 6px 6px;
	padding: 16px;
}

/*
 * Keep inactive language editors in the layout (no display:none). TinyMCE
 * loses/returns empty content when initialized or queried inside [hidden].
 */
.cpd-lang-panel.is-inactive {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 0;
}

.cpd-lang-panel.is-active {
	position: relative;
	visibility: visible;
	pointer-events: auto;
	z-index: 1;
}

/* Legacy safety if anything still sets [hidden] on a language panel. */
.cpd-lang-panel[hidden] {
	display: block !important;
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	visibility: hidden;
	pointer-events: none;
}

.cpd-lang-panel-header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.cpd-lang-panel-title {
	margin: 0;
	margin-right: auto;
	font-size: 14px;
	font-weight: 600;
}

.cpd-lang-panel .cpd-field {
	margin-bottom: 12px;
}

.cpd-lang-panel .wp-editor-wrap,
.cpd-lang-panel .wp-media-buttons {
	margin-bottom: 0;
}

.cpd-col {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: #fafbfc;
	border: 1px solid var(--cpd-border);
	border-radius: var(--cpd-radius-sm);
}

.cpd-col-header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.cpd-col-header h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	flex: 1;
}

.cpd-translate-btn {
	font-size: 12px;
	padding: 6px 10px;
}

.cpd-translate-btn.is-loading {
	pointer-events: none;
	opacity: 0.7;
}

.cpd-translate-wrap {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.cpd-translate-wrap[hidden] {
	display: none !important;
}

.cpd-translate-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
	padding: 8px;
	border: 1px solid var(--cpd-border, #e2e8f0);
	border-radius: 8px;
	background: var(--cpd-surface, #fff);
	box-shadow: var(--cpd-shadow-sm, 0 4px 14px rgba(15, 23, 42, 0.08));
	z-index: 5;
}

.cpd-translate-menu[hidden] {
	display: none !important;
}

.cpd-translate-menu button {
	margin: 0;
}

.cpd-generate-btn {
	font-size: 12px;
	padding: 6px 10px;
}

.cpd-generate-btn .dashicons {
	color: var(--cpd-primary);
}

.cpd-generate-btn.is-loading {
	pointer-events: none;
	opacity: 0.7;
}

.cpd-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cpd-field label {
	font-size: 12px;
	font-weight: 600;
	color: var(--cpd-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.cpd-input,
.cpd-select {
	padding: 8px 10px;
	border: 1px solid var(--cpd-border-strong);
	border-radius: var(--cpd-radius-sm);
	background: #fff;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cpd-input:focus,
.cpd-select:focus {
	outline: none;
	border-color: var(--cpd-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cpd-select[multiple] {
	min-height: 96px;
}

.cpd-editor-textarea {
	min-height: 360px;
	resize: vertical;
}

/* TinyMCE wrapper alignment */
.cpd-col .wp-editor-wrap, .cpd-lang-panel .wp-editor-wrap{
	border: 1px solid var(--cpd-border-strong);
	border-radius: var(--cpd-radius-sm);
	overflow: hidden;
	background: #fff;
}

.cpd-col .wp-editor-container, .cpd-lang-panel .wp-editor-container{
	border: 0;
}

.cpd-col .wp-editor-container textarea.wp-editor-area, .cpd-lang-panel .wp-editor-container textarea.wp-editor-area{
	min-height: 360px;
}

.cpd-col .mce-edit-area iframe, .cpd-lang-panel .mce-edit-area iframe{
	min-height: 360px !important;
}

.cpd-col .wp-editor-tabs, .cpd-lang-panel .wp-editor-tabs{
	background: #f6f7f9;
}

.cpd-modal-footer {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--cpd-border, #e2e6ec);
	background: #fafbfc;
	overflow: visible;
}

/* Content blocks stack (per language, after primary TinyMCE) */
.cpd-blocks-stack {
	margin-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cpd-blocks-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cpd-block-card {
	border: 1px solid var(--cpd-border, #e2e8f0);
	border-radius: 10px;
	background: #fafbfc;
	padding: 12px;
}

.cpd-block-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.cpd-block-card-label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--cpd-text-muted, #64748b);
}

.cpd-block-card-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.cpd-block-preview {
	width: 100%;
	min-height: 100px;
	max-height: 180px;
	border-radius: 8px;
	border: 1px solid var(--cpd-border, #e2e8f0);
	background: #f6f7f9;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cpd-block-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cpd-block-preview audio {
	width: 100%;
	padding: 8px;
	box-sizing: border-box;
}

.cpd-pdf-preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

.cpd-pdf-preview .cpd-media-placeholder {
	margin: 0;
}

.cpd-pdf-filename {
	display: block;
	max-width: 100%;
	font-size: 13px;
	font-weight: 600;
	color: var(--cpd-text, #1e293b);
	word-break: break-word;
}

.cpd-pdf-open-link {
	font-size: 12px;
}

.cpd-facebook-preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

.cpd-facebook-preview .cpd-media-placeholder {
	margin: 0;
}

.cpd-facebook-url-label {
	display: block;
	max-width: 100%;
	font-size: 12px;
	line-height: 1.4;
	color: var(--cpd-muted, #64748b);
	word-break: break-all;
}

.cpd-block-facebook-hint {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: #b32d2e;
}

.cpd-block-gallery-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.cpd-block-gallery-thumbs img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--cpd-border, #e2e8f0);
}

.cpd-add-block-wrap {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

.cpd-add-block {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cpd-add-block-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px;
	border: 1px solid var(--cpd-border, #e2e8f0);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.cpd-add-block-menu[hidden] {
	display: none !important;
}

.cpd-add-block-menu button {
	margin: 0;
}

.cpd-modal-footer-left {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.cpd-modal-status {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	color: var(--cpd-text-muted);
}

.cpd-modal-status.is-error {
	color: var(--cpd-danger);
	font-weight: 500;
}

.cpd-modal-status.is-success {
	color: var(--cpd-success);
	font-weight: 500;
}

.cpd-modal-status.is-warning {
	color: #6b4a00;
	font-weight: 500;
}

.cpd-modal-actions {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-width: 0;
}

.cpd-modal-actions-leading {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-right: auto;
	min-width: 0;
	flex: 1 1 auto;
}

.cpd-muni-type-buttons {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.cpd-muni-type-btn {
	min-height: 44px;
	padding: 10px 18px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	border-radius: 10px !important;
	border: 1px solid var(--cpd-border, #c8cfd8) !important;
	background: #fff !important;
	color: var(--cpd-text, #1e293b) !important;
	box-shadow: none !important;
}

.cpd-muni-type-btn:hover,
.cpd-muni-type-btn:focus {
	border-color: var(--cpd-primary, #2271b1) !important;
	color: var(--cpd-primary, #2271b1) !important;
	background: #f0f6fc !important;
}

.cpd-muni-type-btn.is-active,
.cpd-muni-type-btn[aria-pressed="true"] {
	background: var(--cpd-primary, #2271b1) !important;
	border-color: var(--cpd-primary, #2271b1) !important;
	color: #fff !important;
}

.cpd-muni-type-btn.is-active:hover,
.cpd-muni-type-btn.is-active:focus,
.cpd-muni-type-btn[aria-pressed="true"]:hover,
.cpd-muni-type-btn[aria-pressed="true"]:focus {
	background: #135e96 !important;
	border-color: #135e96 !important;
	color: #fff !important;
}

/* Loading skeleton */
.cpd-root[data-loading="1"] .cpd-grid {
	opacity: 0.55;
	pointer-events: none;
}

/* Tiny spinner */
.cpd-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: cpd-spin 0.7s linear infinite;
	vertical-align: middle;
}

@keyframes cpd-spin {
	to {
		transform: rotate(360deg);
	}
}

/* =============================================================
 * Schedule popover (action bar)
 * Opens below the footer Schedule button over the editor body.
 * ============================================================= */
.cpd-schedule {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	width: auto;
	z-index: 10040;
}

.cpd-schedule[hidden] {
	display: none !important;
}

.cpd-schedule--footer {
	position: relative;
}

.cpd-schedule-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: min(280px, 42vw);
}

.cpd-schedule-toggle .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

.cpd-schedule-toggle-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Keep the primary button look when a date is set; the label shows the schedule. */
.cpd-schedule--footer.is-set .cpd-schedule-toggle {
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.cpd-schedule-popover {
	position: absolute;
	/* Action bar sits above the editor body — open the calendar downward. */
	top: calc(100% + 8px);
	bottom: auto;
	right: 0;
	min-width: 300px;
	max-width: min(380px, calc(100vw - 24px));
	padding: 14px;
	background: #ffffff;
	background-color: #ffffff;
	border: 1px solid var(--cpd-border-strong, #c8cfd8);
	border-radius: var(--cpd-radius, 12px);
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
	z-index: 10070;
	opacity: 1;
	color: var(--cpd-text, #1d2327);
}

.cpd-schedule-popover[hidden] {
	display: none;
}

.cpd-schedule-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--cpd-text-muted, #6b7280);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.cpd-schedule-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--cpd-border-strong, #c8cfd8);
	border-radius: var(--cpd-radius-sm, 6px);
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	color: var(--cpd-text, #1d2327);
}

.cpd-schedule-input:focus {
	outline: none;
	border-color: var(--cpd-primary, #2271b1);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cpd-schedule-help {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--cpd-text-muted, #6b7280);
}

.cpd-schedule-help.is-error {
	color: var(--cpd-danger, #b32d2e);
	font-weight: 500;
}

.cpd-schedule-popover-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 12px;
}

/* =============================================================
 * Auto-trash / Remove after (header control)
 * ============================================================= */
.cpd-expire {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
}

.cpd-expire-toggle .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
	color: var(--cpd-text-muted, #6b7280);
}

.cpd-expire.is-set .cpd-expire-toggle,
.cpd-expire.is-open .cpd-expire-toggle {
	border-color: #b32d2e;
	color: #8a2424;
}

.cpd-expire.is-set .cpd-expire-toggle .dashicons,
.cpd-expire.is-open .cpd-expire-toggle .dashicons {
	color: #b32d2e;
}

.cpd-expire-popover {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: auto;
	min-width: 300px;
	max-width: min(320px, calc(100vw - 24px));
	width: 320px;
	padding: 14px;
	background: #ffffff;
	background-color: #ffffff;
	border: 1px solid var(--cpd-border-strong, #c8cfd8);
	border-radius: var(--cpd-radius, 12px);
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
	z-index: 10070;
	opacity: 1;
	color: var(--cpd-text, #1d2327);
}

.cpd-expire-popover[hidden] {
	display: none;
}

.cpd-status-badge.is-expire {
	background: #fef2f2;
	color: #991b1b;
	border-color: #fecaca;
}

/* =============================================================
 * Generate-with-AI prompt modal
 * Reuses .cpd-modal / .cpd-modal-dialog tokens; overrides the
 * dialog max-width so the lighter prompt-only modal feels right.
 * ============================================================= */
.cpd-generate-modal {
	z-index: 100001;
}

.cpd-generate-dialog {
	max-width: 640px;
}

.cpd-generate-prompt {
	width: 100%;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
	min-height: 140px;
}

.cpd-generate-help {
	margin: 6px 0 0;
	color: var(--cpd-text-muted);
	font-size: 12px;
	line-height: 1.4;
}

/* =============================================================
 * Front-end hardening (Elementor / page-builder defence)
 *
 * The dashboard is also exposed via [calumet_post_dashboard] on
 * public pages. Page builders (Elementor in particular) inject
 * VERY high-specificity rules with !important onto every `button`
 * inside a page they own:
 *
 *   body.elementor-page button {
 *       background-color: var(--e-global-color-primary) !important;
 *       color: var(--e-global-color-accent) !important;
 *   }
 *
 * Three consequences we defend against here:
 *
 *   1. Theme rules like `.entry-content button { display: inline-flex !important }`
 *      override the [hidden] HTML attribute, which is how this dashboard
 *      hides the Translate / Generate buttons when Gemini isn't configured.
 *      The buttons then appear visible but their click handlers silently
 *      bail out — looking exactly like "the button doesn't work".
 *   2. Page builders force-paint every `<button>` in their brand color,
 *      including the TinyMCE toolbar icons (B / I / U / lists / link),
 *      the modal action buttons (Save / Cancel / Schedule / Trash), the
 *      featured-image controls, and the X close icon.
 *   3. Theme colors / fonts bleed into inputs, selects, and the TinyMCE
 *      toolbar chrome.
 *
 * Strategy: every rule below uses !important AND a selector that includes
 * `.cpd-root` or `.cpd-modal` so its specificity matches Elementor's
 * `body.elementor-page button` (1 class + 1 tag) and its origin (author
 * stylesheet, both with !important → last-loaded wins, which is us).
 *
 * Keep this block LAST in the file.
 * ============================================================= */

/* ---- (1) Force [hidden] to actually hide, regardless of theme rules. ---- */
.cpd-root [hidden],
.cpd-modal [hidden],
.cpd-editor [hidden],
#cpd-page-editor [hidden],
body.cm-article-editor-active [hidden] {
	display: none !important;
}

#cpd-view[hidden],
#cpd-preview[hidden],
#cpd-save[hidden],
#cpd-publish[hidden],
#cpd-page-editor #cpd-view[hidden],
#cpd-page-editor #cpd-preview[hidden],
#cpd-page-editor #cpd-save[hidden],
#cpd-page-editor #cpd-publish[hidden],
body.cm-article-editor-active #cpd-view[hidden],
body.cm-article-editor-active #cpd-preview[hidden],
body.cm-article-editor-active #cpd-save[hidden],
body.cm-article-editor-active #cpd-publish[hidden] {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/*
 * Language panels must NOT use display:none — TinyMCE returns empty content
 * for editors inside display:none, so inactive tabs would save blank.
 */
.cpd-root .cpd-lang-panel[hidden],
.cpd-modal .cpd-lang-panel[hidden],
.cpd-editor .cpd-lang-panel[hidden],
.cpd-lang-panel.is-inactive {
	display: block !important;
	position: absolute !important;
	left: 0 !important;
	right: 0 !important;
	top: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	z-index: 0 !important;
}

.cpd-lang-panel.is-active {
	display: block !important;
	position: relative !important;
	visibility: visible !important;
	pointer-events: auto !important;
	z-index: 1 !important;
}

/* ---- (2) Typography reset so the theme doesn't change inherited fonts/text.
 *
 * Elementor's typography pipeline forces a font-family with !important onto
 * every element inside an Elementor-owned page (often via
 * `body.elementor-page` + per-widget overrides). Inheritance from .cpd-root
 * alone isn't enough — we need to restate font-family with !important on
 * every descendant, with two carve-outs:
 *   - Dashicons (`.dashicons*`)   — must keep `dashicons` webfont or icons
 *     render as the unicode escape characters.
 *   - TinyMCE icons (`.mce-ico`)  — TinyMCE ships its own icon webfont. */
.cpd-root,
.cpd-modal,
.cpd-editor {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
	color: var(--cpd-text) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

.cpd-root *:not([class*="dashicons"]):not(.mce-ico):not(.mce-i-resize),
.cpd-modal *:not([class*="dashicons"]):not(.mce-ico):not(.mce-i-resize),
.cpd-editor *:not([class*="dashicons"]):not(.mce-ico):not(.mce-i-resize) {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

/* Restore the few intentionally-uppercased eyebrows / labels after the reset
 * above blanket-removed text-transform from every descendant. */
.cpd-root .cpd-header-eyebrow,
.cpd-modal .cpd-header-eyebrow,
.cpd-editor .cpd-header-eyebrow,
.cpd-root .cpd-card-action-label,
.cpd-modal .cpd-card-action-label,
.cpd-editor .cpd-card-action-label,
.cpd-root .cpd-card-edit-label,
.cpd-modal .cpd-card-edit-label,
.cpd-editor .cpd-card-edit-label {
	text-transform: uppercase !important;
	letter-spacing: 0.04em !important;
}

.cpd-root .cpd-input,
.cpd-root .cpd-select,
.cpd-modal .cpd-input,
.cpd-modal .cpd-select,
.cpd-modal .cpd-editor-textarea,
.cpd-editor .cpd-input,
.cpd-editor .cpd-select,
.cpd-editor .cpd-editor-textarea {
	background-color: #fff !important;
	color: var(--cpd-text) !important;
}

/* ---- (3) Button color overrides.
 * Each variant restates background / color / border with !important so
 * Elementor's `body.elementor-page button { background: ... !important }`
 * cannot win. Repeated with `.cpd-root`, `.cpd-modal`, and `.cpd-editor`
 * because the modal and page editor sit outside the dashboard wrapper. ---- */
.cpd-root .cpd-btn,
.cpd-modal .cpd-btn,
.cpd-editor .cpd-btn {
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none;
}

.cpd-root .cpd-btn-primary,
.cpd-modal .cpd-btn-primary,
.cpd-editor .cpd-btn-primary {
	background-color: #2271b1 !important;
	background-color: var(--cpd-primary, #2271b1) !important;
	background-image: none !important;
	color: #fff !important;
	border: 1px solid #2271b1 !important;
	border-color: var(--cpd-primary, #2271b1) !important;
}

.cpd-root .cpd-btn-primary:hover:not(:disabled),
.cpd-root .cpd-btn-primary:focus-visible:not(:disabled),
.cpd-modal .cpd-btn-primary:hover:not(:disabled),
.cpd-modal .cpd-btn-primary:focus-visible:not(:disabled),
.cpd-editor .cpd-btn-primary:hover:not(:disabled),
.cpd-editor .cpd-btn-primary:focus-visible:not(:disabled) {
	background-color: #135e96 !important;
	background-color: var(--cpd-primary-hover, #135e96) !important;
	border-color: #135e96 !important;
	border-color: var(--cpd-primary-hover, #135e96) !important;
	color: #fff !important;
}

/* Disabled primary: soft grey + dark text (never white-on-white). */
.cpd-root .cpd-btn-primary:disabled,
.cpd-root .cpd-btn-primary[disabled],
.cpd-modal .cpd-btn-primary:disabled,
.cpd-modal .cpd-btn-primary[disabled],
.cpd-editor .cpd-btn-primary:disabled,
.cpd-editor .cpd-btn-primary[disabled] {
	background-color: #e8eaed !important;
	background-image: none !important;
	color: #6b7280 !important;
	border: 1px solid #c8cfd8 !important;
	opacity: 1;
	cursor: not-allowed;
}

.cpd-root .cpd-btn-ghost,
.cpd-modal .cpd-btn-ghost,
.cpd-editor .cpd-btn-ghost {
	background-color: var(--cpd-surface, #fff) !important;
	background-image: none !important;
	color: var(--cpd-text) !important;
	border: 1px solid var(--cpd-border-strong) !important;
}

.cpd-root .cpd-btn-ghost:hover:not(:disabled),
.cpd-root .cpd-btn-ghost:focus-visible:not(:disabled),
.cpd-modal .cpd-btn-ghost:hover:not(:disabled),
.cpd-modal .cpd-btn-ghost:focus-visible:not(:disabled),
.cpd-editor .cpd-btn-ghost:hover:not(:disabled),
.cpd-editor .cpd-btn-ghost:focus-visible:not(:disabled) {
	background-color: var(--cpd-surface, #fff) !important;
	border-color: var(--cpd-primary) !important;
	color: var(--cpd-primary) !important;
}

.cpd-root .cpd-btn-danger,
.cpd-modal .cpd-btn-danger,
.cpd-editor .cpd-btn-danger {
	background-color: #dc3545 !important;
	background-image: none !important;
	color: #ffffff !important;
	border: 1px solid #dc3545 !important;
}

.cpd-root .cpd-btn-danger:hover:not(:disabled),
.cpd-root .cpd-btn-danger:focus-visible:not(:disabled),
.cpd-modal .cpd-btn-danger:hover:not(:disabled),
.cpd-modal .cpd-btn-danger:focus-visible:not(:disabled),
.cpd-editor .cpd-btn-danger:hover:not(:disabled),
.cpd-editor .cpd-btn-danger:focus-visible:not(:disabled) {
	background-color: #bb2d3b !important;
	border-color: #bb2d3b !important;
	color: #fff !important;
}

/* Move to Trash — students + teachers + admins; hide only via .is-cpd-trash-hidden. */
#cpd-page-editor #cpd-delete-post-btn,
#cpd-page-editor #cpd-delete,
.cpd-editor #cpd-delete-post-btn,
.cpd-editor #cpd-delete,
.cpd-modal #cpd-delete-post-btn,
.cpd-modal #cpd-delete,
.cpd-modal-actions #cpd-delete-post-btn,
body.cm-article-editor-active #cpd-delete-post-btn,
body.cm-article-editor-active #cpd-delete,
[data-cpd-delete="1"] {
	display: inline-flex !important;
	align-items: center !important;
	visibility: visible !important;
	pointer-events: auto !important;
	opacity: 1 !important;
	background: #dc3545 !important;
	background-color: #dc3545 !important;
	color: #ffffff !important;
	border: none !important;
	margin-right: 0 !important;
}

#cpd-page-editor #cpd-delete-post-btn.is-cpd-trash-hidden,
#cpd-page-editor #cpd-delete.is-cpd-trash-hidden,
.cpd-editor #cpd-delete-post-btn.is-cpd-trash-hidden,
.cpd-editor #cpd-delete.is-cpd-trash-hidden,
.cpd-modal #cpd-delete-post-btn.is-cpd-trash-hidden,
.cpd-modal #cpd-delete.is-cpd-trash-hidden,
.cpd-modal-actions #cpd-delete-post-btn.is-cpd-trash-hidden,
body.cm-article-editor-active #cpd-delete-post-btn.is-cpd-trash-hidden,
body.cm-article-editor-active #cpd-delete.is-cpd-trash-hidden,
[data-cpd-delete="1"].is-cpd-trash-hidden {
	display: none !important;
}

#cpd-page-editor #cpd-delete-post-btn:hover,
#cpd-page-editor #cpd-delete-post-btn:focus,
#cpd-page-editor #cpd-delete:hover,
#cpd-page-editor #cpd-delete:focus,
.cpd-editor #cpd-delete-post-btn:hover,
.cpd-editor #cpd-delete-post-btn:focus,
.cpd-editor #cpd-delete:hover,
.cpd-editor #cpd-delete:focus,
.cpd-modal #cpd-delete-post-btn:hover,
.cpd-modal #cpd-delete-post-btn:focus,
.cpd-modal #cpd-delete:hover,
.cpd-modal #cpd-delete:focus,
body.cm-article-editor-active #cpd-delete-post-btn:hover,
body.cm-article-editor-active #cpd-delete-post-btn:focus,
body.cm-article-editor-active #cpd-delete:hover,
body.cm-article-editor-active #cpd-delete:focus {
	background: #bb2d3b !important;
	background-color: #bb2d3b !important;
	border-color: #bb2d3b !important;
	color: #ffffff !important;
}

.cpd-root .cpd-btn-success,
.cpd-modal .cpd-btn-success,
.cpd-editor .cpd-btn-success {
	background-color: #008a20 !important;
	background-image: none !important;
	color: #fff !important;
	border: 1px solid #008a20 !important;
}

.cpd-root .cpd-btn-success:hover:not(:disabled),
.cpd-root .cpd-btn-success:focus-visible:not(:disabled),
.cpd-modal .cpd-btn-success:hover:not(:disabled),
.cpd-modal .cpd-btn-success:focus-visible:not(:disabled),
.cpd-editor .cpd-btn-success:hover:not(:disabled),
.cpd-editor .cpd-btn-success:focus-visible:not(:disabled) {
	background-color: #00701a !important;
	border-color: #00701a !important;
	color: #fff !important;
}

/* Submit for Review — match primary Save (blue). Never caught by Publish hide rules. */
#cpd-page-editor #cpd-submit-review,
.cpd-editor #cpd-submit-review,
body.cm-article-editor-active #cpd-submit-review {
	background: #2271b1 !important;
	background-color: #2271b1 !important;
	background-image: none !important;
	color: #ffffff !important;
	border: 1px solid #2271b1 !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

/* Force-show whenever JS clears the hidden attribute (draft + pending). */
#cpd-page-editor #cpd-submit-review:not([hidden]),
.cpd-editor #cpd-submit-review:not([hidden]),
body.cm-article-editor-active #cpd-submit-review:not([hidden]),
.cpd-editor #cpd-submit-review.cpd-btn-primary:not([hidden]) {
	display: inline-flex !important;
	align-items: center !important;
}

#cpd-page-editor #cpd-submit-review[hidden],
.cpd-editor #cpd-submit-review[hidden],
body.cm-article-editor-active #cpd-submit-review[hidden] {
	display: none !important;
}

#cpd-page-editor #cpd-submit-review:hover,
#cpd-page-editor #cpd-submit-review:focus,
.cpd-editor #cpd-submit-review:hover,
.cpd-editor #cpd-submit-review:focus,
body.cm-article-editor-active #cpd-submit-review:hover,
body.cm-article-editor-active #cpd-submit-review:focus {
	background: #135e96 !important;
	background-color: #135e96 !important;
	border-color: #135e96 !important;
	color: #ffffff !important;
}

.cpd-root .cpd-icon-btn,
.cpd-modal .cpd-icon-btn,
.cpd-editor .cpd-icon-btn {
	background-color: transparent !important;
	background-image: none !important;
	color: var(--cpd-text-muted) !important;
	border: none !important;
}

.cpd-root .cpd-icon-btn:hover,
.cpd-root .cpd-icon-btn:focus-visible,
.cpd-modal .cpd-icon-btn:hover,
.cpd-modal .cpd-icon-btn:focus-visible,
.cpd-editor .cpd-icon-btn:hover,
.cpd-editor .cpd-icon-btn:focus-visible {
	background-color: #f1f4f7 !important;
	color: var(--cpd-text) !important;
}

/* Dashicons inside buttons sometimes inherit theme color overrides. */
.cpd-root .cpd-btn .dashicons,
.cpd-modal .cpd-btn .dashicons,
.cpd-editor .cpd-btn .dashicons,
.cpd-modal .cpd-icon-btn .dashicons,
.cpd-editor .cpd-icon-btn .dashicons {
	color: inherit !important;
	background: transparent !important;
}

/* ---- (3b) Card buttons (Edit pencil + translate/audio circular actions).
 * These use a different class family than the modal's `.cpd-btn-*`, so they
 * weren't covered by the previous block. ---- */
.cpd-root .cpd-card-view-btn,
.cpd-root .cpd-card-preview-btn,
.cpd-root .cpd-card-edit-btn {
	background-color: #fff !important;
	background-image: none !important;
	color: var(--cpd-primary) !important;
	border: 1px solid var(--cpd-border-strong) !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

.cpd-root .cpd-card-view-btn:hover,
.cpd-root .cpd-card-view-btn:focus-visible,
.cpd-root .cpd-card-preview-btn:hover,
.cpd-root .cpd-card-preview-btn:focus-visible,
.cpd-root .cpd-card-edit-btn:hover,
.cpd-root .cpd-card-edit-btn:focus-visible {
	background-color: var(--cpd-primary) !important;
	border-color: var(--cpd-primary) !important;
	color: #fff !important;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15) !important;
}

.cpd-root .cpd-card-view-btn .dashicons,
.cpd-root .cpd-card-preview-btn .dashicons,
.cpd-root .cpd-card-edit-btn .dashicons {
	color: inherit !important;
	background: transparent !important;
}

.cpd-root .cpd-card-action-btn {
	background-color: #fff !important;
	background-image: none !important;
	color: var(--cpd-primary) !important;
	border: 1px solid var(--cpd-border-strong) !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

.cpd-root .cpd-card-action-btn:hover:not(:disabled),
.cpd-root .cpd-card-action-btn:focus-visible:not(:disabled) {
	background-color: var(--cpd-primary) !important;
	border-color: var(--cpd-primary) !important;
	color: #fff !important;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15) !important;
}

.cpd-root .cpd-card-action-link {
	background-color: rgba(0, 138, 32, 0.08) !important;
	background-image: none !important;
	color: var(--cpd-success) !important;
	border: 1px solid rgba(0, 138, 32, 0.45) !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

.cpd-root .cpd-card-action-link:hover,
.cpd-root .cpd-card-action-link:focus-visible {
	background-color: var(--cpd-success) !important;
	border-color: var(--cpd-success) !important;
	color: #fff !important;
	box-shadow: 0 0 0 3px rgba(0, 138, 32, 0.15) !important;
}

.cpd-root .cpd-card-action-btn .dashicons,
.cpd-root .cpd-card-action-link .dashicons {
	color: inherit !important;
	background: transparent !important;
}

/* Card category chips + status badges — themes that add background to every
 * `span` can repaint these. Keep the design tokens. */
.cpd-root .cpd-card-cat {
	background-color: #f1f4f7 !important;
	color: var(--cpd-text) !important;
	border: 1px solid var(--cpd-border) !important;
}

.cpd-root .cpd-status-badge {
	background-color: #f1f4f7 !important;
	color: var(--cpd-text) !important;
}

.cpd-root .cpd-lang-badge.cpd-lang-en,
.cpd-modal .cpd-lang-badge.cpd-lang-en {
	background-color: var(--cpd-en) !important;
	color: #fff !important;
}

.cpd-root .cpd-lang-badge.cpd-lang-fr,
.cpd-modal .cpd-lang-badge.cpd-lang-fr {
	background-color: var(--cpd-fr) !important;
	color: #fff !important;
}

/* ---- (4) TinyMCE chrome — toolbar background, toolbar buttons, tabs.
 * The iframe content area is sandboxed by TinyMCE so we only defend the
 * surrounding chrome. Elementor's `body.elementor-page button` selector
 * is the main offender for the B / I / U toolbar icons. ---- */
.cpd-col .wp-editor-wrap, .cpd-lang-panel .wp-editor-wrap,
.cpd-col .wp-editor-container, .cpd-lang-panel .wp-editor-container,
.cpd-col .wp-editor-tools, .cpd-lang-panel .wp-editor-tools,
.cpd-col .mce-toolbar-grp, .cpd-lang-panel .mce-toolbar-grp,
.cpd-col .mce-toolbar, .cpd-lang-panel .mce-toolbar,
.cpd-col .mce-statusbar, .cpd-lang-panel .mce-statusbar,
.cpd-col .mce-panel, .cpd-lang-panel .mce-panel{
	background-color: #f6f7f9 !important;
	background-image: none !important;
	color: var(--cpd-text) !important;
}

.cpd-col .wp-editor-container textarea.wp-editor-area, .cpd-lang-panel .wp-editor-container textarea.wp-editor-area{
	background-color: #fff !important;
	color: var(--cpd-text) !important;
	font-family: Consolas, Monaco, monospace !important;
}

/* The actual toolbar buttons — these are `<button>` elements that get
 * Elementor's brand color forced onto them. Reset everything to TinyMCE's
 * default look. */
.cpd-col .mce-btn, .cpd-lang-panel .mce-btn,
.cpd-col .mce-btn button, .cpd-lang-panel .mce-btn button,
.cpd-col .mce-toolbar .mce-btn button, .cpd-lang-panel .mce-toolbar .mce-btn button,
.cpd-col .mce-menubtn, .cpd-lang-panel .mce-menubtn,
.cpd-col .mce-menubtn button, .cpd-lang-panel .mce-menubtn button{
	background-color: transparent !important;
	background-image: none !important;
	color: var(--cpd-text) !important;
	border: 1px solid transparent !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

.cpd-col .mce-btn:hover, .cpd-lang-panel .mce-btn:hover,
.cpd-col .mce-btn:hover button, .cpd-lang-panel .mce-btn:hover button,
.cpd-col .mce-btn.mce-active, .cpd-lang-panel .mce-btn.mce-active,
.cpd-col .mce-btn.mce-active button, .cpd-lang-panel .mce-btn.mce-active button{
	background-color: #e9ecef !important;
	color: var(--cpd-text) !important;
	border-color: #c8cfd8 !important;
}

.cpd-col .mce-btn.mce-disabled, .cpd-lang-panel .mce-btn.mce-disabled,
.cpd-col .mce-btn.mce-disabled button, .cpd-lang-panel .mce-btn.mce-disabled button{
	background-color: transparent !important;
	opacity: 0.45 !important;
}

.cpd-col .mce-ico, .cpd-lang-panel .mce-ico,
.cpd-col .mce-menubtn span, .cpd-lang-panel .mce-menubtn span,
.cpd-col .mce-btn span, .cpd-lang-panel .mce-btn span{
	color: var(--cpd-text) !important;
	text-shadow: none !important;
}

/* Visual / Code editor tabs above the toolbar. */
.cpd-col .wp-switch-editor, .cpd-lang-panel .wp-switch-editor{
	background-color: #f6f7f9 !important;
	background-image: none !important;
	border: 1px solid var(--cpd-border) !important;
	color: var(--cpd-text) !important;
	text-shadow: none !important;
}

.cpd-col .wp-editor-tabs .wp-switch-editor:hover, .cpd-lang-panel .wp-editor-tabs .wp-switch-editor:hover,
.cpd-col .wp-editor-tabs .wp-switch-editor:focus, .cpd-lang-panel .wp-editor-tabs .wp-switch-editor:focus{
	color: var(--cpd-primary) !important;
	background-color: #fff !important;
}

.cpd-col .wp-editor-wrap.tmce-active .switch-tmce, .cpd-lang-panel .wp-editor-wrap.tmce-active .switch-tmce,
.cpd-col .wp-editor-wrap.html-active .switch-html, .cpd-lang-panel .wp-editor-wrap.html-active .switch-html{
	background-color: #fff !important;
	border-bottom-color: #fff !important;
	color: var(--cpd-text) !important;
}

/* =============================================================
 * Page-editor footer action nuclear overrides (Content Manager).
 * ID selectors + hex-only colors so theme/admin CSS cannot wash out Save.
 * ============================================================= */
#cpd-page-editor #cpd-save,
#cpd-page-editor #cpd-publish,
#cpd-page-editor #cpd-schedule-toggle,
#cpd-page-editor #cpd-submit-review,
#cpd-page-editor .cpd-modal-actions button.cpd-btn-primary,
.cpd-editor .cpd-modal-footer button.cpd-btn-primary,
.cpd-editor button.cpd-btn.cpd-btn-primary,
body.cm-article-editor-active #cpd-save,
body.cm-article-editor-active #cpd-publish,
body.cm-article-editor-active #cpd-schedule-toggle,
body.cm-article-editor-active #cpd-submit-review {
	background: #2271b1 !important;
	background-color: #2271b1 !important;
	background-image: none !important;
	color: #ffffff !important;
	border: 1px solid #2271b1 !important;
	opacity: 1 !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

#cpd-page-editor #cpd-save:hover,
#cpd-page-editor #cpd-save:focus,
#cpd-page-editor #cpd-publish:hover,
#cpd-page-editor #cpd-publish:focus,
#cpd-page-editor #cpd-schedule-toggle:hover,
#cpd-page-editor #cpd-schedule-toggle:focus,
#cpd-page-editor #cpd-submit-review:hover,
#cpd-page-editor #cpd-submit-review:focus,
#cpd-page-editor .cpd-modal-actions button.cpd-btn-primary:hover,
#cpd-page-editor .cpd-modal-actions button.cpd-btn-primary:focus,
.cpd-editor .cpd-modal-footer button.cpd-btn-primary:hover,
.cpd-editor .cpd-modal-footer button.cpd-btn-primary:focus,
body.cm-article-editor-active #cpd-save:hover,
body.cm-article-editor-active #cpd-save:focus,
body.cm-article-editor-active #cpd-schedule-toggle:hover,
body.cm-article-editor-active #cpd-schedule-toggle:focus,
body.cm-article-editor-active #cpd-submit-review:hover,
body.cm-article-editor-active #cpd-submit-review:focus {
	background: #135e96 !important;
	background-color: #135e96 !important;
	border-color: #135e96 !important;
	color: #ffffff !important;
}
