/*
 * Página "Notícias" — Figma (4038:70315). Reaproveita page-hero, section-heading, policy-pagination/loading/empty.
 * Mobile-first. Tablet: 744+. Desktop: 1280+.
 */

/* Em destaque */
.news-highlight {
	background: var(--color-neutral-100);
}

.news-highlight__stage {
	display: flex;
	flex-direction: column;
	gap: var(--space-32);
	margin-top: var(--space-48);
}

.news-highlight__slide[hidden] {
	display: none;
}

.news-highlight__slide {
	display: flex;
	flex-direction: column;
	gap: var(--space-20);
}

.news-highlight__media {
	display: block;
	aspect-ratio: 345 / 297;
	overflow: hidden;
	border-radius: var(--radius-16);
	background: #d9d9d9;
}

.news-highlight__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.news-highlight__body {
	padding: 0 var(--space-4);
}

.news-highlight__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-16);
}

.tag--news {
	background: var(--color-secondary-100);
	color: #9ba825;
	font-family: var(--font-family-montserrat);
	font-size: 12px;
	line-height: 1.66;
	letter-spacing: 0.4px;
}

.news-highlight__title {
	margin: 0;
	font-family: var(--font-family-text);
	font-size: 24px;
	font-weight: var(--font-weight-bold);
	line-height: 32px;
	letter-spacing: 0.0001px;
}

.news-highlight__title a {
	color: var(--color-neutral-800);
	text-decoration: none;
}

.news-highlight__excerpt {
	margin: 0;
	color: var(--color-neutral-500);
	font-family: var(--font-family-text);
	font-size: 16px;
	line-height: 24px;
}

.link-arrow--start {
	align-self: flex-start;
	padding: var(--space-8) var(--space-4);
	text-decoration: none;
}

.news-highlight__controls {
	display: flex;
	margin-top: var(--space-32);
	align-items: center;
	gap: var(--space-20);
}

.news-ctrl {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 22px;
	background: var(--color-white);
	cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
	.news-ctrl:hover {
		background: var(--color-primary-50);
	}
}

.news-highlight__count {
	min-width: 42px;
	margin: 0;
	color: var(--color-neutral-950);
	font-family: var(--font-family-montserrat);
	font-weight: var(--font-weight-semibold);
	text-align: center;
}

/* Últimas notícias */
.news-explorer {
	background: var(--color-neutral-50);
}

.news-tools {
	display: flex;
	flex-direction: column;
	gap: var(--space-12);
	margin-top: var(--space-48);
}

.news-search {
	display: flex;
	align-items: center;
	flex: 1;
	height: 50px;
	padding-left: var(--space-24);
	border: 1px solid var(--color-neutral-200);
	border-radius: 60px;
	/* background: var(--color-white); */
}

.news-search:focus-within {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

.news-search input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--color-neutral-950);
	font-family: var(--font-family-text);
	font-size: var(--text-body-s);
	font-weight: var(--font-weight-medium);
}

.news-search input::placeholder {
	color: var(--color-neutral-300);
}

.news-search input:focus-visible {
	outline: 0;
}

.news-search__submit {
	height: 50px;
	margin: -1px;
}

.news-filter {
	position: relative;
	flex: 0 0 auto;
}

.news-filter__button {
	display: flex;
	align-items: center;
	gap: var(--space-12);
	height: 50px;
	padding: 12px var(--space-12);
	border: 1px solid var(--color-neutral-200);
	border-radius: var(--radius-20);
	background: var(--color-neutral-50);
	color: var(--color-neutral-600);
	font-family: var(--font-family-montserrat);
	font-size: var(--text-body-s);
	letter-spacing: 0.15px;
	list-style: none;
	cursor: pointer;
}

.news-filter__button::-webkit-details-marker {
	display: none;
}

.news-filter__button span {
	flex: 1;
}

.news-filter__button img {
	flex: none;
	margin-right: var(--space-4);
}

.news-filter__button:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

.news-filter__list {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 360px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	border-radius: var(--radius-8);
	background: var(--color-neutral-50);
	box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
	list-style: none;
}

.news-filter__option {
	display: block;
	padding: var(--space-12) var(--space-24);
	color: var(--color-neutral-800);
	font-family: var(--font-family-text);
	font-size: var(--text-body-s);
	line-height: 1.5;
	text-decoration: none;
}

.news-filter__option:focus-visible {
	background: var(--color-neutral-100);
}

@media (hover: hover) and (pointer: fine) {
	.news-filter__option:hover {
		background: var(--color-neutral-100);
	}
}

.news-filter__option.is-active {
	background: var(--color-primary-600);
	color: var(--color-white);
	font-weight: var(--font-weight-bold);
}

.news-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-16);
	margin: 0;
	padding: 0;
	list-style: none;
}

.news-cards li {
	display: flex;
}

.news-card {
	display: flex;
	flex-direction: column;
	gap: var(--space-12);
	width: 100%;
	padding: var(--space-12);
	border-radius: var(--radius-16);
	background: var(--color-neutral-100);
	color: inherit;
	text-decoration: none;
}

.news-card:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

.news-card__media {
	display: block;
	height: 180px;
	overflow: hidden;
	border-radius: var(--radius-8);
	background: #d9d9d9;
}

.news-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.news-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-8);
}

.news-card__title {
	display: -webkit-box;
	min-height: 84px;
	overflow: hidden;
	color: var(--color-neutral-800);
	font-family: var(--font-family-text);
	font-size: 18px;
	line-height: 28px;
	letter-spacing: 0.0001px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.news-card__cta {
	margin-top: auto;
	padding: var(--space-12) var(--space-8);
	color: var(--color-primary-400);
	font-family: var(--font-family-text);
	font-weight: var(--font-weight-medium);
}

@media (hover: hover) and (pointer: fine) {
	.news-card:hover .news-card__cta {
		text-decoration: underline;
	}
}

.news-more {
	display: flex;
	justify-content: center;
	margin-top: var(--space-32);
}

.news-pagination {
	display: none;
}

/* Tablet (744+) */
@media (min-width: 744px) {
	.news-highlight__stage {
		gap: var(--space-24);
	}

	.news-tools {
		flex-direction: row;
		align-items: center;
	}

	.news-filter {
		width: 296px;
	}

	.news-cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Desktop (1280+) */
@media (min-width: 1280px) {
	.news-highlight__slide {
		flex-direction: row;
		align-items: stretch;
	}

	.news-highlight__media {
		flex: 0 0 621px;
		aspect-ratio: auto;
		min-height: 298px;
	}

	.news-highlight__body {
		flex: 1;
		min-width: 0;
		padding: var(--space-24);
	}

	.news-cards {
		grid-template-columns: repeat(4, 1fr);
	}

	.news-pagination {
		display: flex;
	}

	.news-more {
		display: none;
	}
}

/* =========================================================================
   Figma QA Desk - Notícias (só desktop, 1280 px ou mais)
   - Busca: a linha é sempre de 1 px (no foco só a cor muda, sem o anel grosso).
   - "Filtrar por tema": o ícone é uma seta para baixo (não uma pasta).
   - Destaque: o texto aparece em no máximo 2 linhas, com "…" no fim.
   ====================================================================== */
@media (min-width: 1280px) {
	.news-search {
		transition: border-color 0.2s ease, box-shadow 0.2s ease;
	}

	.news-search:focus-within {
		outline: 0;
		border-color: var(--color-secondary-500);
		box-shadow: 0 4px 7px rgb(0 0 0 / 0.1);
	}

	.news-filter__button img {
		display: none;
	}

	.news-filter__button::after {
		content: "";
		flex: none;
		width: 24px;
		height: 24px;
		margin-right: var(--space-4);
		background-color: var(--color-neutral-800);
		-webkit-mask: url('../img/icons/chevron-select.svg') center / 24px 24px no-repeat;
		mask: url('../img/icons/chevron-select.svg') center / 24px 24px no-repeat;
	}

	.news-highlight__excerpt {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}
}

/* =========================================================================
   Figma QA Mobile - Notícias (só celular, até 743 px)
   O filtro "Filtrar por tema" abre um painel que sobe de baixo (o mesmo componente de Políticas):
   título e X no topo, "Todos os temas" primeiro e destacado. Fecha no X, fora do painel, no Esc ou ao escolher um tema.
   ====================================================================== */
.news-filter__head {
	display: none;
}

@media (max-width: 743px) {
	/* Botão do filtro com a seta no lugar da pasta. */
	.news-filter__button img {
		display: none;
	}

	.news-filter__button::after {
		content: "";
		flex: none;
		width: 24px;
		height: 24px;
		margin-right: var(--space-4);
		background-color: var(--color-neutral-800);
		-webkit-mask: url('../img/icons/chevron-select.svg') center / 24px 24px no-repeat;
		mask: url('../img/icons/chevron-select.svg') center / 24px 24px no-repeat;
	}

	/* Fundo escuro atrás do painel. */
	.news-filter[open]::before {
		content: "";
		position: fixed;
		inset: 0;
		z-index: 1090;
		background: rgb(0 0 0 / 0.45);
	}

	html:has(.news-filter[open]) {
		overflow: hidden;
	}

	.news-filter__list {
		position: fixed;
		inset: auto 0 0;
		z-index: 1100;
		display: flex;
		flex-direction: column;
		gap: var(--space-8);
		max-height: 85dvh;
		padding: 0 0 var(--space-32);
		border-radius: 30px 30px 0 0;
		background: var(--color-neutral-50);
		box-shadow: none;
		overscroll-behavior: contain;
		animation: news-sheet-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.news-filter__list > li {
		flex: none;
	}

	.news-filter__head {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 62px;
		padding: 0 var(--space-12) 0 var(--space-24);
		background: var(--color-neutral-50);
	}

	.news-filter__title {
		color: var(--color-neutral-800);
		font-family: var(--font-family-text);
		font-size: 14px;
		font-weight: var(--font-weight-bold);
		line-height: 20px;
	}

	.news-filter__close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		background: transparent;
		cursor: pointer;
	}

	.news-filter__close span {
		display: block;
		width: 20px;
		height: 20px;
		background-color: var(--color-neutral-800);
		-webkit-mask: url('../img/icons/close-x.svg') center / contain no-repeat;
		mask: url('../img/icons/close-x.svg') center / contain no-repeat;
	}

	/* Linhas de 55 px, como no painel de Políticas. */
	.news-filter__option {
		display: flex;
		align-items: center;
		min-height: 55px;
		padding: var(--space-8) var(--space-24);
		color: var(--color-neutral-600);
		font-size: 16px;
		line-height: 24px;
	}

	.news-filter__option.is-active {
		background: var(--color-primary-600);
		color: var(--color-primary-50);
		font-family: var(--font-family-montserrat);
		font-size: 14px;
		font-weight: var(--font-weight-bold);
		line-height: 20px;
	}
}

@keyframes news-sheet-in {
	from {
		transform: translateY(100%);
	}

	to {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.news-filter__list {
		animation: none;
	}
}
