/* Redsite 360 Image – front end. Height comes from --r360-h set per panorama. */

/* Block editor + shortcode: the <figure> is the host. */
figure.wp-block-image.r360 {
	--r360-h: 450px;
	display: block;
	width: 100%;
}

figure.wp-block-image.r360 > figcaption {
	display: block; /* Core renders centred captions as table captions. */
}

/* Fallback image before the viewer mounts (or without JS): same size, no layout shift. */
figure.wp-block-image.r360 > img,
figure.wp-block-image.r360 > a > img,
img.r360[data-r360] {
	display: block;
	width: 100%;
	height: min(var(--r360-h, 450px), 80vh);
	object-fit: cover;
}

.r360__stage {
	width: 100%;
	height: min(var(--r360-h, 450px), 80vh);
	overflow: hidden;
}

.r360__stage:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Floated panoramas have no intrinsic width, so give them one. */
figure.wp-block-image.r360.alignleft,
figure.wp-block-image.r360.alignright,
img.r360[data-r360].alignleft,
img.r360[data-r360].alignright,
.r360__stage.alignleft,
.r360__stage.alignright {
	width: min(50%, 480px);
}

figure.wp-block-image.r360.aligncenter,
.r360__stage.aligncenter {
	margin-inline: auto;
}
