.edit-post-sidebar {
	position: fixed;
	z-index: z-index( '.edit-post-sidebar' );
	top: 0;
	right: 0;
	bottom: 0;
	width: $sidebar-width;
	border-left: 1px solid $light-gray-500;
	background: $light-gray-300;
	color: $dark-gray-500;
	height: 100vh;
	overflow: hidden;

	@include break-small() {
		top: $admin-bar-height-big + $header-height;
		z-index: z-index( '.edit-post-sidebar {greater than small}' );
		height: auto;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}

	@include break-medium() {
		top: $admin-bar-height + $header-height;
	}

	> .components-panel {
		border-left: none;
		border-right: none;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
		height: auto;
		max-height: calc( 100vh - #{ $admin-bar-height-big + $panel-header-height } );
		margin-top: -1px;
		margin-bottom: -1px;

		@include break-small() {
			overflow: inherit;
			height: auto;
			max-height: none;
		}
	}

	> .components-panel .components-panel__header {
		position: fixed;
		z-index: z-index( '.components-panel__header' );
		top: 0;
		left: 0;
		right: 0;
		height: $panel-header-height;

		@include break-small() {
			position: inherit;
			top: auto;
			left: auto;
			right: auto;
		}
	}

	p {
		margin-top: 0;
	}

	h2,
	h3 {
		font-size: $default-font-size;
		color: $dark-gray-500;
		margin-bottom: 1.5em;
	}

	hr {
		border-top: none;
		border-bottom: 1px solid $light-gray-500;
		margin: 1.5em 0;
	}

	div.components-toolbar {
		box-shadow: none;
		margin-bottom: 1.5em;
	}

	p + div.components-toolbar {
		margin-top: -1em;
	}

	.editor-skip-to-selected-block:focus {
		top: auto;
		right: 10px;
		bottom: 10px;
		left: auto;
	}
}

/* Visual and Text editor both */
.edit-post-layout.is-sidebar-opened .edit-post-layout__content {
	@include break-medium() {
		margin-right: $sidebar-width;
	}
}

.edit-post-layout.is-sidebar-opened {
	.edit-post-sidebar,
	.edit-post-plugin-sidebar__sidebar-layout {
		/* Sidebar covers screen on mobile */
		width: 100%;

		/* Sidebar sits on the side on larger breakpoints */
		@include break-medium() {
			width: $sidebar-width;
		}
	}
}

/* Text Editor specific */
.components-panel__header.edit-post-sidebar__header {
	background: $white;
	padding-right: $panel-padding / 2;

	.edit-post-sidebar__title {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		width: 100%;
	}

	@include break-medium() {
		display: none;
	}
}

.components-panel__header.edit-post-sidebar__panel-tabs {
	justify-content: flex-start;
	padding-left: 0;
	padding-right: $panel-padding / 2;
	border-top: 0;
	margin-top: 0;

	.components-icon-button {
		display: none;
		margin-left: auto;

		@include break-medium() {
			display: flex;
		}
	}
}

.edit-post-sidebar__panel-tab {
	background: transparent;
	border: none;
	border-radius: 0;
	cursor: pointer;
	height: 50px;
	padding: 3px 15px; // Use padding to offset the is-active border, this benefits Windows High Contrast mode
	margin-left: 0;
	font-weight: 400;
	@include square-style__neutral;

	&.is-active {
		padding-bottom: 0;
		border-bottom: 3px solid $blue-medium-500;
		font-weight: 600;
	}

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