.gutenberg .wp-block-gallery:not( .components-placeholder ) {
	// allow gallery items to go edge to edge
	margin-left: -8px;
	margin-right: -8px;
}

.blocks-gallery-item {

	.is-selected {
		outline: 4px solid $blue-medium-500;
		outline-offset: -4px;
	}

	&.is-transient img {
		@include loading_fade;
	}

	.blocks-rich-text {
		position: absolute;
		width: 100%;
		max-height: 100%;
		overflow-y: auto;
	}

	.blocks-rich-text figcaption:not( [data-is-placeholder-visible="true"] ) {
		position: relative;
		overflow: hidden;
	}

	.is-selected .blocks-rich-text {
		width: calc( 100% - 8px );
		left: 4px;
		margin-top: -4px;
	}

	.components-form-file-upload,
	.button.blocks-gallery-add-item-button {
		width: 100%;
		height: 100%;
	}

	.button.blocks-gallery-add-item-button {
		display: flex;
		flex-direction: column;
		justify-content: center;
		box-shadow: none;
		border: none;
		border-radius: 0;
		min-height: 100px;

		& .dashicon {
			margin-top: 10px;
		}

		&:hover,
		&:focus {
			border: 1px solid #999;
		}
	}
}

.blocks-gallery-item__inline-menu {
	padding: 2px;
	position: absolute;
	top: 0;
	right: 0;
	background-color: $blue-medium-500;
	display: inline-flex;
	z-index: z-index( '.blocks-gallery-item__inline-menu' );

	.components-button {
		color: $white;
		&:hover,
		&:focus {
			color: $white;
		}
	}
}

.blocks-gallery-item__remove {
	padding: 0;
}

.blocks-gallery-item .spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
}
