/*
 * News: the /nouvelles/ page (credi-nf/news-intro, credi-nf/news-archive)
 * and the single-post template. Loaded after style.css in the editor and
 * on the pages that render news markup (inc/news.php). The teasers reuse
 * the credi-teasers rules in style.css; only what differs from them is
 * here. Values follow src/pages/nouvelles and EditorialBlock in the Astro
 * site.
 */

/* Press room: eyebrow and heading beside the body and the contact link,
   45 / 55, stacking below 64rem (credi-split) with a 2rem gap. */
.wp-block-columns.credi-news-intro__columns {
	gap: 2rem 5rem;
}

.credi-news-intro__body > .credi-measure {
	color: var(--wp--custom--color--navy-body);
}

.credi-news-intro__cta {
	padding-top: 0.5rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.credi-news-intro__cta a {
	color: var(--wp--preset--color--navy-800);
	text-decoration: underline;
}

/* Teasers (all credi-teasers lists, home included). Two fixes that only
   show once a list holds longer titles or taller images than the two
   newest posts:
   - core sets the title link to inline-block, an atomic box that the
     two-line clamp cannot cut, so a three-line title showed in full;
   - a flex item with an aspect ratio grows to its content by default, so
     an image taller than 628/385 (760x482, 1600x1067) stretched its frame
     instead of being cropped like the others. */
.credi-teasers .wp-block-post-title a {
	display: inline;
}

.credi-teasers .wp-block-post-featured-image {
	min-height: 0;
}

/* The title link is stretched over the card, so the card takes the focus
   ring, as the whole-card link does on Astro. On the link itself the ring
   would be cut by the clamped title box. Browsers without :has() skip both
   rules and keep the link's own ring. */
.credi-teasers > li:has(.wp-block-post-title a:focus-visible) {
	outline: var(--wp--custom--focus--ring-width) solid var(--wp--custom--focus--ring-color);
	outline-offset: var(--wp--custom--focus--ring-offset);
}

.credi-teasers > li:has(.wp-block-post-title a:focus-visible) .wp-block-post-title a:focus-visible {
	outline: none;
	box-shadow: none;
}

/* All articles: rows sit 3rem apart from two columns up, 2.5rem stacked. */
@media (min-width: 48rem) {
	.wp-block-post-template.credi-news-archive {
		row-gap: 3rem;
	}
}

/* Single article. The band reuses .credi-page-header from style.css. */
.credi-news-lead .wp-block-post-featured-image {
	margin: 0;
}

.credi-news-lead .wp-block-post-featured-image img {
	object-fit: cover;
}

/* The body runs the full column, its blocks 1.25rem apart. The visually
   hidden "Article" heading is out of the flow, so the content takes no
   gap above it. */
.credi-news-body > .wp-block-post-content {
	margin-block-start: 0;
}

.credi-news-body .wp-block-post-content > * {
	margin-block: 0;
}

.credi-news-body .wp-block-post-content > * + * {
	margin-block-start: 1.25rem;
}

/* Resource links: a disc list, 0.75rem apart, with 24px targets. */
.credi-news-body .wp-block-post-content ul {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding-left: 1.25rem;
	list-style: disc;
}

.credi-news-body .wp-block-post-content li > a {
	display: inline-flex;
	align-items: center;
	min-height: 1.5rem;
	color: var(--wp--preset--color--navy-800);
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* As on Astro, a post without a lead image has no image band, and a site
   with a single post has no "Autres nouvelles". Front end only: the editor
   shows placeholders there, and the sections must stay editable. */
:where(body:not(.editor-styles-wrapper)) .credi-news-lead:not(:has(img)),
:where(body:not(.editor-styles-wrapper)) .credi-news-related:not(:has(.wp-block-post-template > li)) {
	display: none;
}
