/*
 * Overlay captions on posts that have no picture (T-030).
 *
 * JNews paints three layouts' captions white because they are built to lie over the article's photograph:
 * .jeg_heroblock, .jeg_pl_md_box and .jeg_pl_lg_box. Not one of the recovered posts has a featured image, so
 * the photograph is missing and the white lands on a pale box or on the bare page. These rules cover only the
 * no-picture case, so a post that DOES have an image keeps the theme's white-on-photo design untouched, and
 * the layouts become correct again, article by article, as images are recovered (T-029).
 *
 * "No picture" is spelled two ways by the theme, both handled in :is() below:
 *   - the thumbnail container carries the class .no_thumbnail (the md and lg boxes), or
 *   - the hero's background-image container is emitted with an empty data-src="" (the hero path, which
 *     never adds .no_thumbnail).
 * A post with an image has neither, so none of the rules below can match it.
 *
 * A layout added to JNews later with the same white-on-photo caption needs its class added here; a
 * selector that is not scoped to one of those two markers would break every post that has a picture.
 *
 * Colours are the theme's own body greys, not a new palette: #212121 headline, #555 meta (6.9:1 on #f7f7f7).
 * The category pill keeps its own white-on-blue badge.
 */

/* Hero: the box is the theme's #f7f7f7 thumbnail container. Its black scrim and white wash exist to darken a
 * photograph; with no photograph they only turn the box into a grey gradient the caption cannot sit on. */
.jeg_heroblock .jeg_post:has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) .thumbnail-container::before,
.jeg_heroblock .jeg_post:has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) .thumbnail-container::after {
	background: none;
	content: none;
}

.jeg_heroblock .jeg_post:has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) :is(.jeg_postblock_content, .jeg_post_title a, .jeg_post_excerpt),
.jeg_heroblock .jeg_post:has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) .jeg_post_title a:hover {
	color: #212121;
}

.jeg_heroblock .jeg_post:has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) :is(.jeg_post_meta, .jeg_post_meta a, .jeg_post_meta .fa) {
	color: #555;
}

/* The category pill has its own blue background and inherits the caption colour in the hero, so it is pinned
 * back to white rather than following the headline to dark. */
.jeg_heroblock .jeg_post:has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) .jeg_post_category a {
	color: #fff;
}

/* The md and lg boxes: with the thumbnail hidden the absolutely positioned caption has nothing to sit over, so
 * it returns to normal flow with no photo scrim, and its text takes the dark colours. */
.jeg_postblock .jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box):has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) .jeg_postblock_content,
.jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box).no_thumbnail .jeg_postblock_content {
	position: static;
	background: none;
	padding: 0 0 10px;
}

.jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box):has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) :is(.jeg_post_title a, .jeg_post_excerpt),
.jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box).no_thumbnail :is(.jeg_post_title a, .jeg_post_excerpt),
.jeg_postblock .jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box):has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) .jeg_post_title a:hover {
	color: #212121;
}

.jeg_postblock .jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box):has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) .jeg_post_category a,
.jeg_postblock .jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box).no_thumbnail .jeg_post_category a {
	color: #fff;
}

.jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box):has(.thumbnail-container:is(.no_thumbnail, [data-src=""])) :is(.jeg_post_meta, .jeg_post_meta a, .jeg_post_meta .fa),
.jeg_post:is(.jeg_pl_md_box, .jeg_pl_lg_box).no_thumbnail :is(.jeg_post_meta, .jeg_post_meta a, .jeg_post_meta .fa) {
	color: #555;
}
