[data-type="coblocks/gallery-stacked"] {

	// Remove selected state.
	&.block-editor-block-list__block::after {
		box-shadow: none !important;
	}

	&[data-align="left"],
	&[data-align="right"] {

		.wp-block-coblocks-gallery-stacked {
			max-width: 305px;
		}
	}

	// Fix issue where selected images are not wider than the viewport.
	.coblocks-gallery--item:not(.is-appender) .coblocks-gallery--figure {
		display: inline-block;
		margin: 0;
	}

	.has-fullwidth-images .coblocks-gallery--figure {
		width: 100% !important;
	}

	// Tweak the position of the figcaption if Custom URL is set.
	.components-coblocks-gallery-item__image-link + img + .block-editor-rich-text {
		margin-bottom: 35px;
	}

	.components-coblocks-gallery-item__image-link ~ .coblocks-gallery--caption {
		bottom: 3em;
		justify-content: center;
		position: absolute;
		width: 100%;
	}
}

[data-type="core/group"] .wp-block-coblocks-gallery-stacked {
	margin-bottom: 40px !important;
	margin-top: 40px !important;
}

// Shim to fix styles in the previewer.
.block-editor-inserter__preview-content {

	.wp-block-coblocks-gallery-stacked {

		.coblocks-gallery--item:last-child {
			display: none;
		}
	}
}

// Needed until GB 6.9 is merged into core or backward support.
// Hide the placeholder when not selected.
.block-editor-block-list__block[data-type="coblocks/gallery-stacked"]:not(.is-selected):not(.is-focused) .coblocks-gallery {

	div.components-form-file-upload {
		display: none;
	}
}
