/**
 * AA Image Marquee — the photo sizing. Everything else is the shared engine,
 * assets/css/marquee.css, which this stylesheet is registered as depending on
 * (inc/image-marquee.php), so the two always load in that order.
 *
 * Each photo takes the block's height and its own width, so portrait and
 * landscape sit side by side uncropped. A photo given an aspect ratio in its
 * own settings keeps it: core writes aspect-ratio and object-fit onto the
 * <img>, and with the height fixed that decides the width. The 60vw cap stops a
 * landscape photo outgrowing a phone screen.
 *
 * Captions are core's own figcaption, styled by theme.json like any other. The
 * figure's min-content width is the photo's, so a caption wraps to the photo
 * instead of stretching it.
 *
 * The height is !important because core's image block writes one inline:
 * `height: auto` in the editor whenever none is set, or whatever someone types
 * into the photo's own dimensions. Without it the editor showed every photo at
 * full size while the published page looked right. Here the row sets the
 * height, not the photo.
 */

.aa-marquee--images .wp-block-image {
	flex: none;
	width: min-content;
	margin: 0;
}

.aa-marquee--images .wp-block-image img {
	display: block;
	width: auto;
	max-width: none;
	height: min(var(--aa-marquee-height, 320px), 60vw) !important;
	object-fit: cover;
}

/* An image aligned left/right/centre inside the row would float or turn into a
   table under core's alignment styles; neither means anything here. */
.aa-marquee--images .wp-block-image[class*="align"] {
	display: block;
	float: none;
}

.aa-marquee--images .wp-block-image > .wp-element-caption {
	display: block;
}
