$block-inserter-content-height: 250px;
$block-inserter-tabs-height: 38px;

.editor-inserter {
	display: inline-block;
	background: none;
	border: none;
	padding: 0;
	font-family: $default-font;
	font-size: $default-font-size;
	line-height: $default-line-height;

	@include break-medium {
		position: relative;
	}
}

.editor-inserter__toggle {
	display: inline-flex;
	align-items: center;
	color: $dark-gray-500;
	background: none;
	cursor: pointer;
	border: none;
	outline: none;
	transition: color .2s ease;
}

input[type="search"].editor-inserter__search {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 16px;
	position: relative;
	z-index: 1;
	border: none;
	box-shadow: 0 1px 0 0 $light-gray-500;
	@include square-style__neutral;

	// fonts smaller than 16px causes mobile safari to zoom
	font-size: $mobile-text-min-font-size;
	@include break-small {
		font-size: $default-font-size;
	}

	&:focus {
		@include square-style__focus;
	}
}

.editor-inserter__category-blocks {
	display: flex;
	flex-flow: row wrap;
	padding: 8px;
}

.editor-inserter__menu {
	width: auto;
	display: flex;
	flex-direction: column;
	height: 100%;
	@include break-medium {
		width: 350px;
		position: relative;

		.editor-block-preview {
			border: 1px solid $light-gray-500;
			box-shadow: $shadow-popover;
			background: $white;
			position: absolute;
			left: 100%;
			top: -1px;
			bottom: -1px;
			width: 300px;
		}
	}
}

.editor-inserter__menu.is-bottom:after {
	border-bottom-color: $white;
}

.editor-inserter__block {
	display: flex;
	flex-direction: column;
	width: calc( 33% - 8px );
	margin: 4px;
	font-size: $default-font-size;
	color: $dark-gray-500;
	padding: 8px 4px;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: none;
	line-height: 1em;
	background: transparent;
	outline: 1px solid $light-gray-200;
	min-height: 5em;
	overflow: hidden;
	word-break: break-word;

	.dashicon {
		margin-bottom: 3px;
	}

	&:disabled {
		@include button-style__disabled;
	}

	&:not(:disabled) {
		&:hover {
			@include button-style__hover;
		}

		&:focus,
		&:active,
		&.is-active {
			@include button-style__focus-active;
			position: relative;
		}
	}
}

.editor-inserter__separator {
	border-bottom: 1px solid $light-gray-500;
	background: rgba( $white, .8 );
	text-align: center;
	display: block;
	margin: 0;
	padding: 12px 14px;
	font-size: $default-font-size;
	font-weight: 600;
	margin-top: -1px;	// hide the first top border
}

.editor-inserter__search-results {
	flex-grow: 1;
	overflow: auto;

	@include break-medium {
		height: $block-inserter-content-height + $block-inserter-tabs-height;
	}
}

.editor-inserter__no-blocks {
	display: block;
	text-align: center;
	font-style: italic;
	padding: 24px;
}

.editor-inserter__tabs {
	display: flex;
	flex-direction: column;
	height: 100%;
	flex-grow: 1;
	box-shadow: inset 0 -5px 5px -4px rgba( $dark-gray-900, .1 );
	overflow: hidden;

	.components-tab-panel__tab-content {
		overflow: auto;
		@include square-style__neutral();

		&:focus {
			@include square-style__focus()
		}

		&:focus:active {
			outline: none;
		}

		@include break-medium {
			height: $block-inserter-content-height;
		}
	}

	.components-tab-panel__tabs {
		width: 100%;
		display: flex;
		justify-content: space-between;
		position: relative;
		background: $light-gray-100;
		border-bottom: 1px solid $light-gray-500;
		flex-shrink: 0;
		margin-top: 1px;
		@include square-style__neutral;
	}
}

.editor-inserter__tab {
	border: none;
	background: none;
	font-size: $default-font;
	padding: #{ 8px + 3px } 8px; // Use padding to offset the is-active border, this benefits Windows High Contrast mode
	width: 100%;
	border-radius: 0;
	margin: 0;
	color: $dark-gray-500;
	cursor: pointer;
	@include square-style__neutral();

	&.is-active {
		padding-bottom: 8px;
		font-weight: 600;
		border-bottom: 3px solid $blue-medium-500;
		position: relative;
		z-index: z-index( '.editor-inserter__tab.is-active' );
	}

	&:active,
	&:focus {
		z-index: z-index( '.editor-inserter__tab.is-active' );
		@include square-style__focus();
	}
}
