/* Public visibility rules. Runtime classes are derived only from saved post meta. */
html:not(.cw-editor-active) [data-cw-section].cw-section-hidden,
html:not(.cw-editor-active) [data-cw-repeat-item].cw-repeat-hidden,
html:not(.cw-editor-active) [data-cw-repeat-item].cw-repeat-deleted {
	display: none !important;
}

.cw-editor-control,
.cw-repeat-toolbar,
.cw-section-toolbar,
.cw-state-badge,
.cw-editor-statusbar {
	display: none;
}

#wpadminbar #wp-admin-bar-cw-inline-editor-toggle.cw-is-active > .ab-item {
	background: #2271b1;
	color: #fff;
}

.cw-editor-active [data-cw-edit],
.cw-editor-active img[data-cw-image],
.cw-editor-active [data-cw-bg-image],
.cw-editor-active [data-cw-video],
.cw-editor-active [data-cw-link],
.cw-editor-active iframe[data-cw-embed] {
	cursor: pointer;
	outline: 2px dashed #2271b1 !important;
	outline-offset: 3px;
}

.cw-editor-active [data-cw-edit]:hover,
.cw-editor-active img[data-cw-image]:hover,
.cw-editor-active [data-cw-bg-image]:hover,
.cw-editor-active [data-cw-video]:hover,
.cw-editor-active [data-cw-link]:hover,
.cw-editor-active iframe[data-cw-embed]:hover {
	outline-color: #d63638 !important;
}

.cw-editor-active .cw-editor-control,
.cw-editor-active .cw-repeat-toolbar,
.cw-editor-active .cw-section-toolbar,
.cw-editor-active .cw-state-badge {
	display: inline-flex;
}

.cw-editor-control,
.cw-mini-button,
.cw-status-reset {
	box-sizing: border-box;
	min-height: 26px;
	padding: 3px 8px;
	border: 1px solid #2271b1;
	border-radius: 3px;
	background: #fff;
	color: #135e96;
	cursor: pointer;
	font: 600 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cw-editor-control {
	position: relative;
	z-index: 9995;
	margin: 2px 4px 2px 0;
	vertical-align: middle;
}

.cw-mini-button:hover,
.cw-editor-control:hover,
.cw-status-reset:hover {
	background: #f0f6fc;
}

.cw-mini-button:disabled {
	border-color: #a7aaad;
	background: #f0f0f1;
	color: #787c82;
	cursor: not-allowed;
}

.cw-repeat-toolbar,
.cw-section-toolbar {
	position: relative;
	z-index: 9994;
	box-sizing: border-box;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px;
	width: auto;
	max-width: 100%;
	margin: 4px;
	padding: 5px;
	border: 1px solid #72aee6;
	border-radius: 4px;
	background: #f0f6fc;
	box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
	color: #1d2327;
	font: 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cw-repeat-group-toolbar,
.cw-section-toolbar {
	display: none;
	width: calc(100% - 8px);
}

.cw-editor-active .cw-repeat-group-toolbar,
.cw-editor-active .cw-section-toolbar {
	display: flex;
}

.cw-repeat-toolbar strong,
.cw-section-toolbar strong {
	margin-right: 4px;
}

.cw-danger {
	border-color: #d63638;
	color: #b32d2e;
}

.cw-order-button {
	display: none;
}

.cw-order-mode .cw-order-button {
	display: inline-flex;
}

.cw-editor-active [data-cw-repeat-group] {
	outline: 2px solid rgb(34 113 177 / 30%);
	outline-offset: 4px;
}

.cw-editor-active [data-cw-repeat-item] {
	position: relative;
}

.cw-editor-active [data-cw-repeat-item].cw-repeat-hidden,
.cw-editor-active [data-cw-repeat-item].cw-repeat-deleted,
.cw-editor-active [data-cw-section].cw-section-hidden {
	opacity: 0.46;
	filter: grayscale(35%);
}

.cw-editor-active [data-cw-repeat-item].cw-repeat-deleted {
	outline: 2px dashed #d63638;
}

.cw-state-badge {
	position: relative;
	z-index: 9995;
	align-items: center;
	margin: 4px;
	padding: 3px 7px;
	border-radius: 3px;
	background: #d63638;
	color: #fff;
	font: 700 11px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cw-editor-statusbar {
	position: fixed;
	z-index: 99990;
	right: 16px;
	bottom: 16px;
	left: 16px;
	box-sizing: border-box;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 5px;
	background: #1d2327;
	box-shadow: 0 5px 25px rgb(0 0 0 / 30%);
	color: #fff;
	font: 600 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cw-editor-statusbar.cw-visible {
	display: flex;
}

.cw-status-reset {
	border-color: #f0b849;
	color: #8a4b00;
}

.cw-editor-modal[hidden] {
	display: none;
}

.cw-editor-modal {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgb(0 0 0 / 55%);
}

.cw-editor-dialog {
	box-sizing: border-box;
	width: min(540px, 100%);
	padding: 22px;
	border-radius: 5px;
	background: #fff;
	box-shadow: 0 12px 45px rgb(0 0 0 / 30%);
	color: #1d2327;
	font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cw-editor-dialog h2 {
	margin: 0 0 14px;
	color: #1d2327;
	font-size: 20px;
}

.cw-editor-input {
	box-sizing: border-box;
	width: 100%;
	min-height: 120px;
	padding: 9px;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	background: #fff;
	color: #2c3338;
	font: 14px/1.5 monospace;
	resize: vertical;
}

.cw-editor-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
}

.cw-target-option {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
}

.cw-editor-status {
	min-height: 21px;
	margin: 8px 0;
	color: #d63638;
}

.cw-editor-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.cw-button {
	min-height: 34px;
	padding: 0 12px;
	border: 1px solid #2271b1;
	border-radius: 3px;
	background: #f6f7f7;
	color: #2271b1;
	cursor: pointer;
	font: inherit;
}

.cw-button:hover {
	background: #f0f0f1;
}

.cw-button-primary {
	background: #2271b1;
	color: #fff;
}

.cw-button-primary:hover {
	background: #135e96;
}

.cw-button-reset {
	margin-right: auto;
	border-color: #d63638;
	color: #b32d2e;
}

@media (max-width: 600px) {
	.cw-editor-statusbar {
		align-items: stretch;
		flex-direction: column;
	}

	.cw-editor-actions {
		flex-direction: column;
	}

	.cw-button-reset {
		margin-right: 0;
	}
}

