/**
 * Homepage — Notícias (carrossel, 4,5 cards visíveis)
 * @file assets/css/homepage/latest-news.css
 */

.fd-latest-news {
	--theme-headings-color: var(--fd-color-white, #fff);
	--fd-section-blend-h: clamp(5rem, 12vw, 8.5rem);
	--fd-section-between: clamp(3rem, 7vw, 5.5rem);
	--fd-news-inset: 5vw;
	--fd-news-gap: clamp(1.35rem, 2.75vw, 2.1rem);
	--fd-news-visible: 4.5;
	--fd-news-gap-count: 4;
	--fd-news-card-w: calc(
		(100vw - var(--fd-news-inset) - (var(--fd-news-gap-count) * var(--fd-news-gap))) /
			var(--fd-news-visible)
	);
	--fd-news-card-lift: clamp(0.4rem, 1.1vw, 0.65rem);
	position: relative;
	margin-top: calc(-1 * var(--fd-section-blend-h) + var(--fd-section-between));
	padding: calc(clamp(2.25rem, 5vw, 3.75rem) + var(--fd-section-between) * 0.65) 0
		clamp(2.5rem, 6vw, 4rem);
	background-color: var(--fd-color-primary, #123357);
	background-image: linear-gradient(
		180deg,
		var(--fd-color-dark, #051e33) 0%,
		#071f36 28%,
		#0c2944 52%,
		#10304e 72%,
		var(--fd-color-primary, #123357) 100%
	);
	background-repeat: no-repeat;
	background-size: 100% var(--fd-section-blend-h);
	color: var(--fd-color-white, #fff);
	overflow-x: clip;
	overflow-y: visible;
}

.fd-latest-news__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	position: relative;
	z-index: 40;
	width: 90vw;
	max-width: 90vw;
	margin: 0 auto clamp(1.35rem, 3vw, 2rem);
}

.fd-latest-news__title {
	flex: 0 0 auto;
	min-width: 0;
	margin: 0;
	font-family: var(--fd-font-family, "korolev-compressed", sans-serif);
	font-size: clamp(1.5rem, 3.6vw, 2.35rem);
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	color: var(--fd-color-white, #fff);
}

.fd-latest-news__head-actions {
	--fd-news-picker-h: clamp(2.35rem, 7vw, 2.65rem);
	display: flex;
	/* Flexível: fica ao lado do título quando cabe, senão passa para a linha de baixo. */
	flex: 1 1 14rem;
	align-items: stretch;
	gap: 0.45rem;
	max-width: 20rem;
	min-width: 0;
	margin-left: auto;
}

.fd-latest-news__picker {
	flex: 1 1 auto;
	min-width: 0;
}

.fd-latest-news__picker .fcf-news-filter__trigger {
	min-height: var(--fd-news-picker-h);
	padding-top: 0;
	padding-bottom: 0;
}

.fd-latest-news__archive-link {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--fd-news-picker-h);
	height: var(--fd-news-picker-h);
	min-width: var(--fd-news-picker-h);
	border: 0;
	background-color: #edca57;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 5h6M5.5 2.5L8 5l-2.5 2.5' stroke='%23051e33' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 10px 10px;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.fd-latest-news__archive-link:hover,
.fd-latest-news__archive-link:focus-visible {
	background-color: #f5d978;
}

.fd-latest-news__archive-link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.fd-latest-news__carousel {
	position: relative;
	margin-top: calc(-1 * var(--fd-news-card-lift));
}

.fd-latest-news__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	cursor: grab;
	touch-action: pan-y;
	overscroll-behavior-x: contain;
	scroll-behavior: auto;
}

.fd-latest-news__viewport::-webkit-scrollbar {
	display: none;
}

.fd-latest-news__viewport.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.fd-latest-news__track {
	display: flex;
	align-items: flex-start;
	gap: var(--fd-news-gap);
	width: max-content;
	margin: 0;
	padding: var(--fd-news-card-lift) var(--fd-news-inset) 0;
	list-style: none;
	overflow: visible;
}

.fd-latest-news__item {
	display: flex;
	align-items: stretch;
	flex: 0 0 var(--fd-news-card-w);
	width: var(--fd-news-card-w);
	min-width: 0;
	overflow: visible;
}

.fd-latest-news__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	overflow: visible;
}

.fd-latest-news__link {
	--fd-news-panel-overlap: clamp(4.75rem, 10vw, 4.1rem);
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	color: inherit;
	text-decoration: none;
	transform: translateY(0);
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
	-webkit-user-drag: none;
	user-select: none;
}

.fd-latest-news__link:hover,
.fd-latest-news__link:focus-visible {
	transform: translateY(calc(-1 * var(--fd-news-card-lift)));
}

.fd-latest-news__link:focus-visible {
	outline: 2px solid var(--fd-color-white, #fff);
	outline-offset: 4px;
}

.fd-latest-news__media {
	position: relative;
	z-index: 1;
	flex-shrink: 0;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: rgb(18 51 87 / 40%);
}

.fd-latest-news__media::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	opacity: 0;
	background: linear-gradient(
		to top,
		rgb(18 51 87 / 1) 0%,
		rgb(18 51 87 / 0.2) 100%
	);
	transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}

.fd-latest-news__media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgb(0 0 0 / 10%);
	pointer-events: none;
}

.fd-latest-news__link:hover .fd-latest-news__media::before,
.fd-latest-news__link:focus-visible .fd-latest-news__media::before {
	opacity: 1;
}

.fd-latest-news__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	pointer-events: none;
	-webkit-user-drag: none;
	user-drag: none;
}

.fd-latest-news__media--placeholder {
	background: #123357;
}

.fd-latest-news__media--placeholder::after {
	opacity: 0;
}

.fd-latest-news__image--placeholder {
	object-fit: cover;
	object-position: center center;
}

.fd-latest-news__media-badge {
	position: absolute;
	z-index: 3;
	top: 0;
	left: 0;
	max-width: 100%;
	padding: clamp(0.4rem, 0.95vw, 0.58rem) clamp(0.55rem, 1.25vw, 0.82rem);
	background: #edca57;
	color: var(--fd-color-dark, #051e33);
	font-family: var(--fd-font-family, "korolev-compressed", sans-serif);
	font-size: clamp(0.78rem, 1.45vw, 1.02rem);
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.fd-latest-news__panel {
	--fd-news-panel-min-h: clamp(11rem, 22vw, 13.75rem);
	--fd-news-panel-line: #edca57;
	position: relative;
	z-index: 2;
	box-sizing: border-box;
	width: 80%;
	max-width: 80%;
	height: var(--fd-news-panel-min-h);
	min-height: var(--fd-news-panel-min-h);
	margin-top: calc(-1 * var(--fd-news-panel-overlap));
	margin-left: 0;
	margin-right: auto;
	padding: clamp(1.45rem, 2.75vw, 1.9rem) clamp(1.25rem, 2.35vw, 1.65rem)
		clamp(1.25rem, 2.1vw, 1.55rem);
	background: #eef1f4;
	color: var(--fd-color-dark, #051e33);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex-shrink: 0;
	isolation: isolate;
}

.fd-latest-news__panel::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: clamp(3px, 0.35vw, 4px);
	background: var(--fd-news-panel-line);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}

.fd-latest-news__link:hover .fd-latest-news__panel::before,
.fd-latest-news__link:focus-visible .fd-latest-news__panel::before {
	transform: scaleX(1);
}

.fd-latest-news__panel-tag {
	flex-shrink: 0;
	margin: 0 0 0.85em;
	font-family: var(--fd-font-family, "korolev-compressed", sans-serif);
	font-size: clamp(1.08rem, 1.95vw, 1.35rem);
	font-weight: 700;
	line-height: 1.12;
	text-transform: uppercase;
	color: var(--fd-color-muted, #a2bacc);
}

.fd-latest-news__headline {
	flex: 1 1 auto;
	margin: 0;
	font-family: var(--fd-font-family, "korolev-compressed", sans-serif);
	font-size: clamp(1.52rem, 2.85vw, 2.05rem);
	font-weight: 700;
	line-height: 1.08;
	text-transform: uppercase;
	color: var(--fd-color-dark, #051e33);
	display: -webkit-box;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	min-height: calc(2 * 1.08em);
}

.fd-latest-news__link:hover .fd-latest-news__headline,
.fd-latest-news__link:focus-visible .fd-latest-news__headline {
	color: var(--fd-color-dark, #051e33);
	opacity: 0.85;
}

.fd-latest-news__panel .fd-latest-news__arrow {
	flex-shrink: 0;
	display: block;
	width: clamp(2.35rem, 4.15vw, 3.05rem);
	height: auto;
	max-width: none;
	margin-top: clamp(1rem, 2vw, 1.35rem);
	pointer-events: none;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.fd-latest-news__link:hover .fd-latest-news__arrow,
.fd-latest-news__link:focus-visible .fd-latest-news__arrow {
	transform: translateX(clamp(0.25rem, 0.55vw, 0.45rem));
}

.fd-latest-news__arrows {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 90vw;
	max-width: 90vw;
	margin: clamp(1.25rem, 2.5vw, 1.75rem) auto 0;
	padding-left: 0;
}

.fd-latest-news__arrow-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--fd-color-white, #fff);
	cursor: pointer;
	line-height: 0;
}

.fd-latest-news__arrow-btn:hover,
.fd-latest-news__arrow-btn:focus-visible {
	color: var(--fd-color-muted, #a2bacc);
}

.fd-latest-news__arrow-btn:focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: 3px;
}

.fd-latest-news__arrow-btn svg {
	width: clamp(1.5rem, 3.2vw, 2rem);
	height: clamp(1.5rem, 3.2vw, 2rem);
}

@media (max-width: 1699.98px) {
	.fd-latest-news {
		--fd-news-visible: 3.5;
		--fd-news-gap-count: 3;
	}
}

@media (max-width: 767.98px) {
	.fd-latest-news {
		--fd-news-visible: 1.15;
		--fd-news-gap-count: 1;
	}

	.fd-latest-news__link {
		--fd-news-panel-overlap: clamp(3.25rem, 12vw, 4.25rem);
	}

	.fd-latest-news__panel {
		width: 84%;
		max-width: 84%;
		height: auto;
		min-height: clamp(12rem, 48vw, 15.5rem);
		padding: clamp(1.35rem, 5.5vw, 1.75rem) clamp(1.15rem, 4.5vw, 1.45rem)
			clamp(1.25rem, 5vw, 1.6rem);
		gap: clamp(0.75rem, 3.2vw, 1.1rem);
	}

	.fd-latest-news__panel-tag {
		margin: 0;
		font-size: clamp(1rem, 4vw, 1.2rem);
		line-height: 1.15;
	}

	.fd-latest-news__headline {
		flex: 1 1 auto;
		align-self: stretch;
		max-width: 100%;
		font-size: clamp(1.2rem, 5.6vw, 1.55rem);
		line-height: 1.1;
		letter-spacing: 0.015em;
		overflow-wrap: break-word;
		word-break: break-word;
		hyphens: auto;
		-webkit-line-clamp: 4;
		line-clamp: 4;
		min-height: 0;
	}

	.fd-latest-news__panel .fd-latest-news__arrow {
		margin-top: auto;
		width: clamp(2.35rem, 11vw, 3.1rem);
	}
}

@media (min-width: 768px) and (max-width: 1023.98px) {
	.fd-latest-news {
		--fd-news-visible: 2.25;
		--fd-news-gap-count: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fd-latest-news__media::before,
	.fd-latest-news__link,
	.fd-latest-news__panel::before,
	.fd-latest-news__panel .fd-latest-news__arrow {
		transition: none;
	}

	.fd-latest-news__link:hover,
	.fd-latest-news__link:focus-visible {
		transform: none;
	}

	.fd-latest-news__link:hover .fd-latest-news__panel::before,
	.fd-latest-news__link:focus-visible .fd-latest-news__panel::before {
		transform: scaleX(1);
	}

	.fd-latest-news__link:hover .fd-latest-news__arrow,
	.fd-latest-news__link:focus-visible .fd-latest-news__arrow {
		transform: none;
	}
}
