/* IC News (patterns/ic-news.php).
 * Sibling of ic-two-up: same centred Headline/Section h2 (no class), same white card with a 3:2 photo and a caption
 * panel, same stretched headline link (the whole card is one link named by its headline; the ring moves to the card).
 * The cards row takes any count: one equal column per card on desktop, two per row at 900, one at 600, so editors
 * get 2 or 4 cards by deleting or duplicating a card. Cards in a row share the tallest height (grid stretch plus a
 * flex caption), so uneven headlines don't stagger the row. */
.tt5c-ic-news {
	--tt5c-ic-news-w: 1200px; /* derived — not Figma (matches ic-two-up's 1200 container) */
	--tt5c-ic-news-ratio: 3 / 2;
}
.tt5c-ic-news > * { margin-block: 0; }
.tt5c-ic-news__title { margin: 0 auto var(--wp--preset--spacing--50); }

.tt5c-ic-news__cards {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--35);
	max-width: var(--tt5c-ic-news-w);
	margin-inline: auto;
}
.tt5c-ic-news__cards > * { margin-block: 0; }

.tt5c-ic-news__card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--ico-color-surface);
	color: var(--ico-color-text);
}
.tt5c-ic-news__card > * { margin-block: 0; }
.tt5c-ic-news__img {
	margin: 0;
	aspect-ratio: var(--tt5c-ic-news-ratio);
	overflow: hidden;
	background: var(--ico-color-band-bg);
}
.tt5c-ic-news__img img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tt5c-ic-news__caption {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--15);
	padding: var(--wp--preset--spacing--30);
}
.tt5c-ic-news__caption > * { margin-block: 0; }
.tt5c-ic-news__date { margin: 0; color: var(--ico-color-text-muted); }
.tt5c-ic-news__headline { margin: 0; overflow-wrap: break-word; }

/* Linked headline, stretched over the card. */
.tt5c-ic-news__headline a {
	color: inherit;
	text-decoration: none;
}
.tt5c-ic-news__headline a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.tt5c-ic-news__card:hover .tt5c-ic-news__headline a,
.tt5c-ic-news__headline a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: var(--ico-btn-text-rule-height);
	text-underline-offset: var(--ico-btn-text-rule-gap);
	text-decoration-color: var(--ico-color-link-attention);
}
@supports selector(:has(*)) {
	.tt5c-ic-news__card:has(.tt5c-ic-news__headline a) { cursor: pointer; }
	.tt5c-ic-news .tt5c-ic-news__headline a:focus-visible { outline: none; }
	.tt5c-ic-news__card:has(.tt5c-ic-news__headline a:focus-visible) {
		outline: var(--ico-btn-focus-ring-width) solid var(--ico-btn-focus-ring-color);
		outline-offset: var(--ico-btn-focus-ring-offset);
	}
}

/* Optional "All News" link (button padding and type come from _buttons.css). */
.tt5c-ic-news__actions { margin-top: var(--wp--preset--spacing--50); }

@media (max-width: 900px) {
	.tt5c-ic-news__cards {
		grid-auto-flow: row;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 600px) {
	.tt5c-ic-news__cards { grid-template-columns: minmax(0, 1fr); gap: var(--wp--preset--spacing--30); }
	.tt5c-ic-news__caption { padding: var(--wp--preset--spacing--27); }
	.tt5c-ic-news__actions { margin-top: var(--wp--preset--spacing--40); }
}

/* Editor: the stretched link would cover the card and block selecting its blocks. */
.editor-styles-wrapper .tt5c-ic-news__headline a::after { content: none; }
