/**
 * This file disables all settings that can't be otherwise turned off with a PHP or JS API.
 *
 * You can use the `mrw_hidden_block_editor_settings` filter to turn change which settings are disables in a backwards-compatible way
 */

/*
 Don't Open Links in New Tabs
 Filter Value: new-tabs
 */
.mrw-block-editor-no-new-tabs .components-popover__content .block-editor-link-control .block-editor-link-control__settings,
.mrw-block-editor-no-new-tabs .block-editor-url-popover__settings .components-toggle-control,
.mrw-block-editor-no-new-tabs .block-editor-link-control__drawer-toggle {
	display: none;
}

/*
 Hide the "Upload" button in the editor because it skips the media library
 Hide the "Image from URL" option to discourage hotlinking and not having alt text
 Filter Value: image-file-upload
 */
.mrw-block-editor-no-image-file-upload .block-editor-media-placeholder__upload-button,
.mrw-block-editor-no-image-url .block-editor-media-placeholder__url-input-container {
	display: none;
}

/*
 Hide the "Text over image" toolbar button when the Cover block is not in the inserter
 Only works for English sites :'(
 */
.mrw-block-editor-no-cover-block .block-editor-block-toolbar .components-button[aria-label="Add text over image"] {
	display: none;
}

/*
 Hide Heading Levels 1, 5, and 6
 Filter values: heading-1, heading-5, heading-6
 */
.mrw-block-editor-no-heading-1 .block-library-heading-level-dropdown .components-button:nth-child(1),
.mrw-block-editor-no-heading-5 .block-library-heading-level-dropdown .components-button:nth-child(5),
.mrw-block-editor-no-heading-6 .block-library-heading-level-dropdown .components-button:nth-child(6) {
	display: none;
}

/* 
 Hide "Default style" select for style variations
 Filter Value: default-style-variation
 */
.mrw-block-editor-no-default-style-variation .block-editor-block-styles + .components-base-control {
	display: none;
}

/*
 Hide the "Content" and "Wide" sizes for Group and Cover blocks
*/
.mrw-block-editor-no-layout-width .block-editor-hooks__layout-controls,
.mrw-block-editor-no-layout-width .block-editor-hooks__layout-controls-helptext {
	display: none;
}

/*
 Hide the Justification settings in the group block
*/
.mrw-block-editor-no-justification-group .block-editor-hooks__layout-controls-helptext + div {
	display: none;
}

/*===========================================
=            "Save draft" Button            =
===========================================*/
/* Styles copied from .is-secondary button class */
.edit-post-header__settings .editor-post-save-draft {
	white-space: nowrap;
	border: 1px solid #a0a5aa;
	background: #f3f5f6;
}

.edit-post-header__settings .editor-post-save-draft:focus:not(:disabled),
.edit-post-header__settings .editor-post-save-draft:hover:not(:disabled) {
	color: #0075af;
	border-color: #0075af;
	border-color: var(--wp-admin-theme-color-darker-10);
	box-shadow: none;
}

/* Selectively copied from .components-button */
.edit-post-header__settings .editor-post-saved-state {
	display: inline-flex;
	color: #a0a5aa;
	background: #f7f7f7;
	border: 1px solid #ddd;
	height: 36px;
	align-items: center;
	padding: 0 8px;
	border-radius: 3px;

	/* not copied */
	cursor: default;
}

.edit-post-header__settings .editor-post-saved-state + .editor-post-preview,
.edit-post-header__settings .editor-post-save-draft + .editor-post-preview {
	margin-left: 6px;
}


/*==============================================
=            Color Contrast Warning            =
==============================================*/
.color-block-support-panel__inner-wrapper.color-block-support-panel__inner-wrapper.color-block-support-panel__inner-wrapper {
	display: flex;
	flex-direction: column;
}

.components-panel__body-title {
	order: -2;
}

.block-editor-contrast-checker.block-editor-contrast-checker {
	order: -1;
	margin-top: 12px;
	margin-bottom: 24px;
}

.block-editor-contrast-checker .components-notice.is-warning {
	border-left-color: #d94f4f;
	background-color: #f9e2e2;
}

.block-editor-color-gradient-control + .block-editor-color-gradient-control {
	margin-bottom: 0;
}