/* Shared rules for editorial, static page and product-description media only. */
:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) {
	min-width: 0;
}

:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) :is(figure, .wp-caption, .wp-block-image, .wp-block-video, .wp-block-embed, .alignleft, .alignright, .aligncenter, .video, .video-fit, .fluid-width-video-wrapper, .wp-block-embed__wrapper) {
	float: none !important;
	width: auto;
	max-width: 100% !important;
	margin-inline: auto !important;
	box-sizing: border-box;
}

:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) :is(img, video, iframe) {
	display: block;
	float: none !important;
	width: auto;
	max-width: 100% !important;
	height: auto !important;
	margin-inline: auto !important;
	box-sizing: border-box;
}

:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) iframe.nbd-content-embed {
	position: static !important;
	inset: auto !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	aspect-ratio: var(--nbd-embed-ratio, 16 / 9) !important;
	margin: 18px auto !important;
}

/* Google Maps keep the compact width and fixed maximum height requested. */
:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) iframe.nbd-content-embed--map {
	width: 90% !important;
	max-width: 90% !important;
	height: 450px !important;
	max-height: 450px !important;
	aspect-ratio: auto !important;
	margin-inline: auto !important;
}

/* Portrait videos retain their source ratio and a readable phone-like width. */
:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) iframe.nbd-content-embed--portrait {
	width: min(100%, var(--nbd-embed-width, 420px)) !important;
	max-width: 100% !important;
	aspect-ratio: var(--nbd-embed-ratio, 9 / 16) !important;
}

/* Flatsome's product-description rules are more specific than the shared rules. */
body.nbd-product-ui.single-product #tab-description :is(figure, .wp-caption, .wp-block-image, .wp-block-video, .wp-block-embed, .alignleft, .alignright, .aligncenter, .img, .img-inner, .video, .video-fit, .fluid-width-video-wrapper, .wp-block-embed__wrapper) {
	float: none !important;
	width: auto !important;
	max-width: 100% !important;
	margin-inline: auto !important;
}
body.nbd-product-ui.single-product #tab-description :is(img, video, iframe):not(iframe.nbd-content-embed--portrait) {
	max-width: 100% !important;
}
body.nbd-product-ui.single-product #tab-description iframe.nbd-content-embed:not(.nbd-content-embed--portrait, .nbd-content-embed--map) {
	width: auto !important;
	max-width: 100% !important;
}
body.nbd-product-ui.single-product #tab-description iframe.nbd-content-embed--map {
	width: 90% !important;
	max-width: 90% !important;
	height: 450px !important;
	max-height: 450px !important;
	aspect-ratio: auto !important;
}
body.nbd-product-ui.single-product #tab-description :is(figure, .wp-caption, .wp-block-image, .wp-block-video, .wp-block-embed, .alignleft, .alignright, .aligncenter, .img, .img-inner, .video, .video-fit, .fluid-width-video-wrapper, .wp-block-embed__wrapper):has(iframe.nbd-content-embed--portrait) {
	width: 100% !important;
	max-width: 100% !important;
}

/* Remove decorative wrappers around product-detail photos. */
body.nbd-product-ui.single-product #tab-description :is(figure, .wp-caption, .wp-block-image, .wp-block-video, .wp-block-embed, .img, .img-inner, .video, .video-fit, .fluid-width-video-wrapper, .wp-block-embed__wrapper) {
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: 0 !important;
}
body.nbd-product-ui.single-product #tab-description img {
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) :is(.video, .video-fit, .fluid-width-video-wrapper, .wp-block-embed__wrapper):has(> iframe.nbd-content-embed) {
	position: static !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	padding: 0 !important;
	margin-inline: auto !important;
}

:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description) :is(.video, .video-fit, .fluid-width-video-wrapper, .wp-block-embed__wrapper):has(> iframe.nbd-content-embed)::before {
	display: none !important;
	content: none !important;
}

@media (max-width: 549px) {
	:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) :is(figure, .wp-caption, .wp-block-image, .wp-block-video, .wp-block-embed, .video, .video-fit, .fluid-width-video-wrapper, .wp-block-embed__wrapper) {
		max-width: 100% !important;
	}

	:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) :is(img, video, iframe) {
		max-width: 100% !important;
	}

	body.nbd-product-ui.single-product #tab-description iframe.nbd-content-embed:not(.nbd-content-embed--map, .nbd-content-embed--portrait) {
		width: auto !important;
		max-width: 100% !important;
		height: auto !important;
		aspect-ratio: var(--nbd-embed-ratio, 16 / 9) !important;
	}

	:is(body.single-post .entry-content, body.page .entry-content, body.single-product #tab-description, .nbd-news-article__content) iframe.nbd-content-embed--map {
		width: 90% !important;
		max-width: 90% !important;
		height: 450px !important;
		max-height: 450px !important;
	}

	body.nbd-product-ui.single-product #tab-description iframe.nbd-content-embed--portrait {
		width: min(100%, var(--nbd-embed-width, 420px)) !important;
		max-width: 100% !important;
		aspect-ratio: var(--nbd-embed-ratio, 9 / 16) !important;
	}
}
