/* Latest News article content uses the complete template rail. This removes
 * legacy Figma-width constraints from post-owned prose at every breakpoint. */
body.single-post .latest-news-single__body > .elementor,
body.single-post .latest-news-single__body > .elementor > .e-con,
body.single-post .latest-news-single__body .e-con:has(> .elementor-widget-text-editor),
body.single-post .latest-news-single__body .elementor-widget-text-editor {
	--width: 100% !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
}

body.single-post .latest-news-single__body > .elementor > .e-con {
	--gap: clamp(12px, 1.5vw, 24px) !important;
	gap: clamp(12px, 1.5vw, 24px) !important;
}

body.single-post .e-con:has(> .latest-news-single__title) + .latest-news-single__body {
	margin-top: clamp(-20px, -1.25vw, -12px) !important;
}

/* Each post uses one image-derived media/prose rail, set from stored attachment
 * dimensions so it remains reliable even when Elementor output is cached. */
body.single-post.mj-news-post-rail-landscape .latest-news-single__body > .elementor > .e-con {
	--width: min(100%, 724px) !important;
	width: min(100%, 724px) !important;
	max-width: 724px !important;
}

body.single-post.mj-news-post-rail-portrait .latest-news-single__body > .elementor > .e-con {
	--width: min(100%, 540px) !important;
	width: min(100%, 540px) !important;
	max-width: 540px !important;
}

body.single-post.mj-news-post-rail-square .latest-news-single__body > .elementor > .e-con {
	--width: min(100%, 680px) !important;
	width: min(100%, 680px) !important;
	max-width: 680px !important;
}

body.single-post[class*="mj-news-post-rail-"] .latest-news-single__body .elementor-widget-image,
body.single-post[class*="mj-news-post-rail-"] .latest-news-single__body .elementor-widget-image :is(.elementor-widget-container, figure, img) {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
}

/* Latest News article media only. Template, footer and inline text images are excluded. */
.latest-news-single__body .mj-news-image,
.latest-news-single__body .mj-news-image .elementor-widget-container {
	width: 100%;
	max-width: 100%;
}

.latest-news-single__body .mj-news-image .elementor-widget-container {
	display: flex;
	justify-content: center;
}

.latest-news-single__body .mj-news-image__asset {
	display: block;
	height: auto;
	max-width: 100%;
	object-fit: contain;
	object-position: center;
}

.latest-news-single__body .mj-news-image--landscape .mj-news-image__asset {
	width: 100%;
}

.latest-news-single__body .mj-news-image--portrait .mj-news-image__asset {
	width: 100%;
	max-width: 100%;
	max-height: none;
}

.latest-news-single__body .mj-news-image--square .mj-news-image__asset {
	width: 100%;
	max-width: 100%;
}

.latest-news-single__body .mj-news-image-group {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	gap: clamp(12px, 1.5vw, 24px);
	width: 100%;
}

.latest-news-single__body .mj-news-image-group--count-3 > .elementor-widget-image:first-child,
.latest-news-single__body .mj-news-image-group--count-5 > .elementor-widget-image:first-child {
	grid-column: 1 / -1;
}

.latest-news-single__body .mj-news-image-group--count-many {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.latest-news-single__body .mj-news-image-group > .elementor-widget-image,
.latest-news-single__body .mj-news-image-group > .elementor-widget-image .elementor-widget-container,
.latest-news-single__body .mj-news-image-group > .elementor-widget-image .mj-news-image__asset {
	width: 100%;
	max-width: 100%;
	max-height: none;
}

@media (max-width: 1023px) {
	.latest-news-single__body .mj-news-image-group--count-many {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.latest-news-single__body .mj-news-image--portrait .mj-news-image__asset,
	.latest-news-single__body .mj-news-image--square .mj-news-image__asset {
		width: 100%;
		max-width: 100%;
		max-height: none;
	}

	.latest-news-single__body .mj-news-image-group,
	.latest-news-single__body .mj-news-image-group--count-many {
		grid-template-columns: minmax(0, 1fr);
	}

	.latest-news-single__body .mj-news-image-group > .elementor-widget-image {
		grid-column: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.latest-news-single__body .mj-news-image,
	.latest-news-single__body .mj-news-image * {
		transition: none !important;
	}
}
