/*
 * News: shortcode [mc-news] (news.php). The latest posts: image, title and "Ler mais", a grey line between them.
 * Figma (home page, 778px column at 1920): 325x217 image, 58px gap, title 20px, "LER MAIS" 13px.
 */

/* ul.: the theme's ul:not(.wp-block) margin is more specific than a class alone */
ul.mc-news {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mc-news__item {
	margin: 0;
	padding: 0;
}

.mc-news__item + .mc-news__item {
	margin-top: clamp(20px, 1.667vw, 32px);
	padding-top: clamp(16px, 1.458vw, 28px);
	border-top: 1px solid var(--mc-grey-line);
}

.mc-news__link {
	display: grid;
	grid-template-columns: 41.774% 1fr;
	column-gap: 7.455%;
	color: var(--mc-black);
	text-decoration: none;
}

.mc-news__link:hover {
	color: var(--mc-black);
}

.mc-news__image {
	display: block;
	overflow: hidden;
	aspect-ratio: 325 / 217;
	background: #eee;
}

.mc-news__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s ease;
}

.mc-news__link:hover .mc-news__image img {
	transform: scale(1.03);
}

.mc-news__body {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 12px;
	padding: clamp(8px, 1.042vw, 20px) 0 clamp(8px, 1.406vw, 27px);
}

.mc-news__title {
	margin: 0;
	color: inherit;
	font: 500 clamp(16px, 1.042vw, 20px)/1.22 var(--mc-font);
	letter-spacing: 0;
	text-transform: none;
}

.mc-news__more {
	font: 600 13px/1.22 var(--mc-font);
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: .2em;
}

.mc-news__link:focus-visible {
	outline: 1px solid var(--mc-black);
	outline-offset: 4px;
}

/* desktop: the Figma title width (372px at 20px), so the titles break as in the design */
@media (min-width: 1025px) {
	.mc-news__title {
		max-width: 18.6em;
	}
}

@media (max-width: 1024px) {
	.mc-news__title {
		font-size: 16px;
	}
}

/* mobile: the image on top, the text below it */
@media (max-width: 767px) {
	.mc-news__link {
		grid-template-columns: 1fr;
	}

	.mc-news__body {
		gap: 10px;
		padding: 14px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mc-news__image img {
		transition: none;
	}
}
