/**
 * Smart portrait layout for single-column Gutenberg galleries.
 * Classes are added server-side by inc/gallery-portrait-layout.php.
 *
 * - Portraits move to the end of the gallery (flex order).
 * - Portraits sit two per row at 50% width.
 * - Paired (and solo) portraits share the same height via aspect-ratio + cover.
 * - An unpaired last portrait is centered at 50% width.
 */

.wp-block-gallery.stabilizer-gallery-smart figure.wp-block-image.stabilizer-img-portrait {
	order: 10;
	width: calc(50% - (var(--wp--style--unstable-gallery-gap, 16px) / 2)) !important;
	/* Most Detale interiors are ~2:3; equalizes height when two portraits sit side by side. */
	aspect-ratio: 2 / 3;
	overflow: hidden;
	align-self: stretch;
}

.wp-block-gallery.stabilizer-gallery-smart figure.wp-block-image.stabilizer-img-portrait > a,
.wp-block-gallery.stabilizer-gallery-smart figure.wp-block-image.stabilizer-img-portrait > img {
	display: block;
	width: 100%;
	height: 100%;
}

.wp-block-gallery.stabilizer-gallery-smart figure.wp-block-image.stabilizer-img-portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

.wp-block-gallery.stabilizer-gallery-smart figure.wp-block-image.stabilizer-img-portrait-solo {
	margin-inline: auto;
}
