/* NHR Blocks — Core Block Extensions: shared styles (front end + editor) */

/*
 * Group block with "Floating / stacked children" enabled: every direct
 * child occupies the same grid cell. Each child's justify-self /
 * align-self / z-index (base + any breakpoints) is generated per
 * instance and shipped as its own <style> tag right next to the block
 * (see src/core-extensions/index.js, buildPositionCss) rather than
 * here, since breakpoint pixel values are user-defined and a static
 * stylesheet can't contain a dynamic value.
 */
.nhr-grid-floating {
	position: relative;
	overflow: hidden;
}

.nhr-grid-floating > * {
	grid-column: 1 / -1;
	grid-row: 1 / -1;
}

/*
 * Video block with Height/Width/Object-fit set. Values are baked in as
 * CSS custom properties, normally right on the block's own <figure>
 * wrapper (front end) -- but in the editor, `wrapperProps` (see
 * `withNhrWrapperStyle` in src/core-extensions/index.js) can only reach
 * Gutenberg's own outer chrome wrapper around the block, one level
 * above the <figure> itself, so `nhr-video-sized` and `wp-block-video`
 * end up on two different elements there instead of the same one.
 * Custom properties inherit either way, so the `.nhr-video-sized
 * .wp-block-video` (descendant) form covers that case; the compound
 * form still covers the front end, where they're on the same element.
 */
.wp-block-video.nhr-video-sized,
.nhr-video-sized .wp-block-video {
	height: var( --nhr-video-height, auto );
	width: var( --nhr-video-width, 100% );
}

.wp-block-video.nhr-video-sized video,
.nhr-video-sized .wp-block-video video {
	width: 100%;
	height: 100%;
	object-fit: var( --nhr-video-object-fit, initial );
	display: block;
}
