/**
 * JDB shared featured-image integrity.
 * Every WordPress featured-image surface uses the approved 1200 x 630 frame.
 */

#body_wrap :where(
	.p-articleThumb,
	.p-articleThumb__figure,
	.c-postThumb__figure,
	.jdb-related-posts__thumb,
	.jdb-v3-card__media,
	.jdb-archive-hub-card__image,
	.jdb-unsolved-featured-card figure,
	.jdb-unsolved-record-card figure,
	.jdb-v2-card__image
) {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	height: auto;
	aspect-ratio: 1200 / 630 !important;
	overflow: hidden;
}

/* SWELL creates thumbnail height with a pseudo-element. Keep it at 630 / 1200. */
#body_wrap .c-postThumb__figure::before {
	padding-top: 52.5% !important;
}

#body_wrap :where(
	.p-articleThumb,
	.p-articleThumb__figure,
	.c-postThumb__figure,
	.jdb-related-posts__thumb,
	.jdb-v3-card__media,
	.jdb-archive-hub-card__image,
	.jdb-unsolved-featured-card figure,
	.jdb-unsolved-record-card figure,
	.jdb-v2-card__image
) img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	object-position: center;
}

/* Match the existing V3 selectors so their earlier contain rules cannot win. */
#body_wrap.single-post.jdb-v3-single-enabled .p-articleThumb img,
#body_wrap.single-post.jdb-v3-single-enabled .p-articleThumb__img,
#body_wrap.single-post.jdb-v3-single-enabled .post_content .jdb-related-posts__thumb img {
	object-fit: cover !important;
	object-position: center;
}

/* Archive-list styles can return thumbnails to normal flow on narrow screens. */
#body_wrap .c-postThumb__figure > .c-postThumb__img {
	position: absolute !important;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
}

#body_wrap .c-postThumb__figure {
	align-self: start !important;
	block-size: auto !important;
}

#body_wrap :where(
	.p-postList__item,
	.p-postList__link,
	.p-postList__body,
	.p-postList__title,
	.jdb-v3-card,
	.jdb-v3-card__link,
	.jdb-v3-card__content,
	.jdb-archive-hub-card,
	.jdb-archive-hub-card__body,
	.jdb-related-posts__item,
	.jdb-related-posts__body
) {
	min-width: 0;
}

#body_wrap :where(
	.p-postList__title,
	.jdb-v3-card__title,
	.jdb-archive-hub-card strong,
	.jdb-related-posts__body strong
) {
	line-break: strict;
	word-break: normal;
	overflow-wrap: break-word;
}
