/*
 * Production blog editorial width system.
 * Scoped to the target post: prose keeps a calm reading measure while the approved
 * Blog End Component can use the existing one-column container.
 */
@media (min-width: 992px) {
body.e-reha-blog-detail-v11-active .entry-header,
body.e-reha-blog-detail-v11-active .entry-body,
body.e-reha-blog-detail-v11-active .entry-footer {
		max-width: 840px;
		margin-right: auto;
		margin-left: auto;
	}

	body.e-reha-blog-detail-v11-active .e-reha-blog-end {
		width: 100%;
		max-width: 1110px;
		margin-right: auto;
		margin-left: auto;
	}
}

@media (max-width: 991.98px) {
	body.e-reha-blog-detail-v11-active .entry-header,
	body.e-reha-blog-detail-v11-active .entry-body,
	body.e-reha-blog-detail-v11-active .entry-footer,
	body.e-reha-blog-detail-v11-active .e-reha-blog-end {
		max-width: 100%;
	}
}

/*
 * Editorial heading and vertical-rhythm system.
 *
 * Detail-only colors are intentionally scoped here while the global VK palette
 * remains unchanged during the Blog Ver.1.1 transition.
 */
body.e-reha-blog-detail-v11-active .entry-footer {
	display: none;
}

body.e-reha-blog-detail-v11-active .entry-body {
	--e-reha-detail-navy: #274a6d;
	--e-reha-detail-green: #33865f;
	--e-reha-article-ink: var(--e-reha-detail-navy);
	--e-reha-article-accent: var(--e-reha-detail-green);
	--e-reha-article-rule: color-mix(in srgb, var(--e-reha-article-ink) 14%, transparent);
	--e-reha-article-reference: color-mix(in srgb, var(--e-reha-article-ink) 72%, transparent);
}

/* The template outputs this after H1 and before the entry body. */
body.e-reha-blog-detail-v11-active .e-reha-article-featured-image {
	max-width: 840px;
	margin: 28px auto 34px;
}

body.e-reha-blog-detail-v11-active .e-reha-article-featured-image img {
	display: block;
	width: 100%;
	height: auto;
}

body.e-reha-blog-detail-v11-active .entry-body h2 {
	position: relative;
	margin-top: 72px;
	margin-bottom: 24px;
	padding-bottom: 11px;
	border: 0;
	color: var(--e-reha-article-ink);
	font-size: clamp(1.7rem, 2.25vw, 2rem);
	font-weight: 650;
	line-height: 1.45;
}

body.e-reha-blog-detail-v11-active .entry-body h2::after {
	position: absolute;
	bottom: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 1px;
	background: linear-gradient(
		to right,
		var(--e-reha-article-accent) 0 18%,
		var(--e-reha-article-rule) 18% 100%
	);
	content: "";
}

body.e-reha-blog-detail-v11-active .entry-body h3 {
	margin-top: 64px;
	margin-bottom: 19px;
	padding: 0.46em 0.80em;
	border: 0;
	border-bottom: 0;
	border-left: 3px solid var(--e-reha-article-accent);
	border-radius: 0;
	background: color-mix(in srgb, var(--e-reha-article-accent) 5%, white);
	box-shadow: none;
	color: var(--e-reha-article-ink);
	font-size: clamp(1.25rem, 1.7vw, 1.45rem);
	font-weight: 600;
	line-height: 1.55;
}

/* Lightning's heading ornaments are not part of the editorial H3 system. */
body.e-reha-blog-detail-v11-active .entry-body h3::before,
body.e-reha-blog-detail-v11-active .entry-body h3::after {
	display: none;
	border: 0;
	background: none;
	box-shadow: none;
	content: none;
}

body.e-reha-blog-detail-v11-active .entry-body :where(p) {
	margin-top: 0;
	margin-bottom: 19px;
	line-height: 1.9;
}

body.e-reha-blog-detail-v11-active .entry-body :where(ul, ol) {
	margin-top: 22px;
	margin-bottom: 22px;
	padding-left: 1.45em;
	line-height: 1.85;
}

body.e-reha-blog-detail-v11-active .entry-body :where(li + li) {
	margin-top: 0.35em;
}

body.e-reha-blog-detail-v11-active .entry-body :where(figure.wp-block-image, .wp-block-image) {
	margin-top: 34px;
	margin-bottom: 34px;
}

body.e-reha-blog-detail-v11-active .entry-body :where(.wp-block-image img) {
	height: auto;
	max-width: 100%;
}

body.e-reha-blog-detail-v11-active .entry-body h2 + :where(p, ul, ol, figure, .wp-block-image),
body.e-reha-blog-detail-v11-active .entry-body h3 + :where(p, ul, ol, figure, .wp-block-image) {
	margin-top: 0;
}

/* References remain readable without competing with the article's prose. */
body.e-reha-blog-detail-v11-active .entry-body h2:has(+ ol.wp-block-list) + ol.wp-block-list {
	color: var(--e-reha-article-reference);
	font-size: 0.94em;
	line-height: 1.8;
}

@media (max-width: 991.98px) {
	body.e-reha-blog-detail-v11-active .e-reha-article-featured-image {
		margin-top: 24px;
		margin-bottom: 30px;
	}

	body.e-reha-blog-detail-v11-active .entry-body h2 {
		margin-top: 60px;
		margin-bottom: 21px;
	}

	body.e-reha-blog-detail-v11-active .entry-body h3 {
		margin-top: 54px;
		margin-bottom: 18px;
	}

	body.e-reha-blog-detail-v11-active .entry-body :where(p) {
		margin-bottom: 18px;
	}

	body.e-reha-blog-detail-v11-active .entry-body :where(ul, ol) {
		margin-top: 20px;
		margin-bottom: 20px;
	}

	body.e-reha-blog-detail-v11-active .entry-body :where(figure.wp-block-image, .wp-block-image) {
		margin-top: 30px;
		margin-bottom: 30px;
	}
}

@media (max-width: 639px) {
	body.e-reha-blog-detail-v11-active .e-reha-article-featured-image {
		margin-top: 20px;
		margin-bottom: 27px;
	}

	body.e-reha-blog-detail-v11-active .entry-body h2 {
		margin-top: 52px;
		margin-bottom: 19px;
		padding-bottom: 10px;
		font-size: 1.58rem;
	}

	body.e-reha-blog-detail-v11-active .entry-body h3 {
		margin-top: 46px;
		margin-bottom: 17px;
		padding: 0.46em 0.74em;
		font-size: 1.22rem;
	}

	body.e-reha-blog-detail-v11-active .entry-body :where(p) {
		margin-bottom: 17px;
		line-height: 1.85;
	}

	body.e-reha-blog-detail-v11-active .entry-body :where(ul, ol) {
		margin-top: 19px;
		margin-bottom: 19px;
	}

	body.e-reha-blog-detail-v11-active .entry-body :where(figure.wp-block-image, .wp-block-image) {
		margin-top: 27px;
		margin-bottom: 27px;
	}
}

/* Ver.1.2 opt-in Image Block sizes. Existing Image Blocks remain unchanged. */
body.e-reha-blog-detail-v11-active .entry-body figure.wp-block-image.e-reha-image-photo {
	width: 100%;
	max-width: 680px;
	margin-right: auto;
	margin-left: auto;
	text-align: center;
}

body.e-reha-blog-detail-v11-active .entry-body figure.wp-block-image.e-reha-image-photo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	margin-right: auto;
	margin-left: auto;
}

@media (min-width: 992px) {
	body.e-reha-blog-detail-v11-active .entry-body figure.wp-block-image.e-reha-image-wide {
		width: min(1020px, calc(100vw - 60px));
		max-width: none;
		margin-right: 0;
		margin-left: 50%;
		transform: translateX(-50%);
	}

	body.e-reha-blog-detail-v11-active .entry-body figure.wp-block-image.e-reha-image-wide.e-reha-image-wide--xl {
		width: min(1110px, calc(100vw - 60px));
	}

	body.e-reha-blog-detail-v11-active .entry-body figure.wp-block-image.e-reha-image-wide img {
		display: block;
		width: 100%;
		height: auto;
	}
}

@media (max-width: 991.98px) {
	body.e-reha-blog-detail-v11-active .entry-body figure.wp-block-image.e-reha-image-wide {
		width: 100%;
		max-width: 100%;
		margin-right: auto;
		margin-left: auto;
		transform: none;
	}
}
