.atv-news-archive {
	padding-bottom: var(--spacing-layout-l);
}

.atv-news-archive__tools {
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* the chip row scrolls inside; it must not widen the page */
	gap: var(--spacing-m);
	margin-bottom: var(--spacing-layout-s);
}

/* Topic filter: pill chips. Wraps on wide screens; one scrollable row on phones. */
.atv-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-xs);
	list-style: none;
	margin: 0;
	padding: 0;
}

.atv-chip {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 var(--spacing-s);
	border: 1px solid var(--color-black-30);
	border-radius: var(--atv-radius-control);
	background: var(--color-white);
	color: var(--color-black-90);
	font-family: var(--font-heading);
	font-size: var(--fontsize-body-s);
	font-weight: 700;
	white-space: nowrap;
	text-decoration: none;
	transition:
		background-color var(--atv-motion-fast) var(--atv-motion-ease),
		border-color var(--atv-motion-fast) var(--atv-motion-ease);
}

.atv-chip:hover {
	border-color: var(--atv-navy);
	background: var(--color-black-5);
}

.atv-chip:focus-visible {
	outline: var(--atv-focus-width) solid var(--color-focus-outline);
	outline-offset: var(--atv-focus-offset);
}

/* Active: filled navy (white text, AAA). */
.atv-chip--active,
.atv-chip--active:hover {
	border-color: var(--atv-navy);
	background: var(--atv-navy);
	color: var(--color-white);
}

@media (max-width: 767px) {
	.atv-news-topics {
		/* Bleed to the viewport edge so the row scrolls under the gutter, not inside it. */
		margin-inline: calc(-1 * var(--spacing-s));
	}

	.atv-news-topics .atv-chips {
		position: relative; /* offsetParent for the active-chip scroll */
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: var(--spacing-3-xs) var(--spacing-s);
		scroll-padding-inline: var(--spacing-s);
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.atv-news-topics .atv-chips::-webkit-scrollbar {
		display: none;
	}

	.atv-chips > li {
		flex: 0 0 auto;
	}
}

/* Share links keep the plain list (no chips). */
.atv-news-topics__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-s);
	list-style: none;
	margin: 0;
	padding: 0;
}

.atv-news-list {
	display: grid;
	gap: var(--spacing-m);
	list-style: none;
	margin: 0;
	padding: 0;
}

.atv-news-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 0;
	text-decoration: none;
	color: inherit;
}

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

.atv-news-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

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

.atv-news-card .hds-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1;
	padding: var(--spacing-m) var(--spacing-l);
	margin-bottom: 0;
}

.atv-news-card .hds-tag {
	width: auto;
	max-width: 100%;
}

.atv-news-card__date {
	font-size: var(--fontsize-body-s);
	color: var(--color-black-60);
}

.atv-news-card__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--fontsize-heading-s);
	font-weight: 700;
	color: var(--color-black-90);
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0 1px;
	transition: background-size 200ms ease;
}

.atv-news-card:hover .atv-news-card__title,
.atv-news-card:focus-visible .atv-news-card__title {
	background-size: 100% 1px;
}

.atv-news-card__more {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-2-xs);
	margin-top: auto;
	font-family: var(--font-heading);
	font-size: var(--fontsize-body-m);
	font-weight: 700;
	white-space: nowrap;
}

.atv-news-card__more .hds-icon {
	width: var(--spacing-m);
	height: var(--spacing-m);
}

.atv-news-empty {
	margin: 0;
	font-size: var(--fontsize-body-l);
}

.hds-pagination-container {
	margin-top: var(--spacing-layout-s);
}

/* Pagination: plain flex row (Anterior · pages · Seguinte) instead of HDS's float + scaleY trick, which centred the
   pages in leftover space (a wide gap after "Anterior" on page 2) and let "Seguinte" overlap the last page. */
.hds-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-xs);
	transform: none;
}

.hds-pagination::before {
	content: none;
}

.hds-pagination .hds-pagination__button-prev,
.hds-pagination .hds-pagination__button-next,
.hds-pagination__pages {
	position: static;
	float: none;
	margin: 0;
	transform: none;
}

/* Phones: pages on their own row, Anterior / Seguinte below at the edges. */
@media (max-width: 599px) {
	.hds-pagination__pages {
		order: -1;
		flex-basis: 100%;
	}

	/* Compact buttons so Anterior and Seguinte share one row. */
	.hds-pagination .hds-pagination__button-prev,
	.hds-pagination .hds-pagination__button-next {
		min-width: 0;
		padding-inline: var(--spacing-2-xs);
	}

	.hds-pagination:has(.hds-pagination__button-prev):has(.hds-pagination__button-next) {
		justify-content: space-between;
	}
}

.atv-news-hero--photo {
	position: relative;
	min-height: 18rem;
	display: flex;
	align-items: flex-end;
	color: var(--color-white);
	background: var(--atv-scrim);
	margin-bottom: var(--spacing-layout-m);
	border-bottom: var(--spacing-3-xs) solid var(--color-bus);
}

.atv-news-hero--photo .atv-news-hero__media {
	position: absolute;
	inset: 0;
}

.atv-news-hero--photo .atv-news-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Same scrim as the page hero: the crumb and date stay legible on a bright sky. */
.atv-news-hero--photo .atv-news-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, color-mix(in srgb, var(--atv-scrim) 35%, transparent) 0%, color-mix(in srgb, var(--atv-scrim) 55%, transparent) 45%, var(--atv-scrim) 100%);
}

.atv-news-hero--photo .atv-news-hero__content {
	position: relative;
	z-index: 1;
	width: 100%;
	box-sizing: border-box;
	padding-block: var(--spacing-layout-m);
}

.atv-news-hero--photo h1 {
	margin: 0;
	color: var(--color-white);
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: var(--fontsize-heading-l);
	text-wrap: balance;
}

/* Breadcrumb on the photo: white on the scrim, links underlined (not colour alone). */
.atv-news-hero--photo .hds-breadcrumb,
.atv-news-hero--photo .hds-breadcrumb__link,
.atv-news-hero--photo .hds-breadcrumb__list-item,
.atv-news-hero--photo .hds-breadcrumb__list-item span {
	--breadcrumb-link-color: var(--color-white);
	color: var(--color-white);
}

.atv-news-hero--photo .hds-breadcrumb__link {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.atv-news-hero--photo .hds-breadcrumb__link:focus-visible {
	outline: var(--atv-focus-width) solid var(--atv-focus-dark);
	outline-offset: var(--atv-focus-offset);
}

.atv-news-hero .hds-breadcrumb {
	margin-bottom: var(--spacing-m);
}

/* The hero sits flush under the sticky header (no block-gap strip). */
.wp-site-blocks > .atv-main:has(> .atv-news-hero:first-child) {
	margin-block-start: 0;
}

.atv-news-hero--text {
	padding-block: var(--spacing-layout-m) var(--spacing-s);
}

.atv-news-hero--text h1 {
	margin: 0;
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: var(--fontsize-heading-l);
	color: var(--color-black-90);
}

.atv-news-hero__date {
	display: block;
	margin-bottom: var(--spacing-s);
	font-size: var(--fontsize-body-m);
}

/* Same container as the hero and the related news; the reading column is capped inside it, left-aligned. */
.atv-news-article {
	padding-bottom: var(--spacing-layout-m);
}

.atv-news-article > * {
	max-width: var(--wp--custom--measure--prose, 48rem);
}

.atv-news-article > .atv-news-adjacent {
	max-width: none;
}

.atv-news-meta {
	display: grid;
	gap: var(--spacing-s);
	margin-bottom: var(--spacing-l);
}

/* Tags inline, wrapping. */
.atv-news-meta__tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-2-xs);
	list-style: none;
	margin: 0;
	padding: 0;
}

.atv-news-meta .hds-tag {
	width: auto;
	text-decoration: none;
}

/* Subtitle as the article's lead (size from .atv-lead). */
.atv-news-subtitle {
	margin: 0;
	font-family: var(--font-heading);
	font-weight: 500;
	color: var(--color-black-90);
}

.atv-news-body {
	font-size: var(--fontsize-body-l);
}

.atv-news-share {
	margin: var(--spacing-layout-m) 0 0;
}

/* Share: compact round icon buttons (name in a visually hidden span), not underlined text links. */
.atv-share {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-2-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.atv-share li {
	max-width: none;
}

.atv-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--color-black-20);
	border-radius: 50%;
	color: var(--atv-navy);
	background: var(--color-white);
	text-decoration: none;
	transition: background-color var(--atv-motion-fast) var(--atv-motion-ease), border-color var(--atv-motion-fast) var(--atv-motion-ease), color var(--atv-motion-fast) var(--atv-motion-ease);
}

.atv-share__link:hover {
	border-color: var(--atv-navy);
	background: var(--atv-navy);
	color: var(--color-white);
}

.atv-share__link:focus-visible {
	outline: var(--atv-focus-width, 3px) solid var(--color-focus-outline);
	outline-offset: var(--atv-focus-offset, 2px);
}

.atv-share__icon {
	display: block;
	flex: none;
}

@media (prefers-reduced-motion: reduce) {
	.atv-share__link {
		transition: none;
	}
}

/* Archive notice (news older than five years). */
.atv-news-archive-notice {
	display: flex;
	gap: var(--spacing-2-xs);
	align-items: flex-start;
	margin: var(--spacing-m) 0 0;
	padding: var(--spacing-s);
	border-inline-start: var(--spacing-3-xs) solid var(--color-info);
	background: var(--color-info-light);
	color: var(--color-black-90);
	font-size: var(--fontsize-body-m);
}

.atv-news-archive-notice .hds-icon {
	flex: none;
	color: var(--color-info);
}

.atv-news-adjacent {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--spacing-m);
	margin-top: var(--spacing-layout-m);
	padding-top: var(--spacing-m);
	border-top: 1px solid var(--color-black-10);
}

.atv-news-adjacent__item {
	display: grid;
	gap: var(--spacing-2-xs);
	max-width: 20rem;
	text-decoration: none;
	color: var(--color-black-90);
}

.atv-news-adjacent__item--next {
	margin-inline-start: auto;
	text-align: end;
}

.atv-news-adjacent__label {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-2-xs);
	font-family: var(--font-heading);
	font-size: var(--fontsize-body-s);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--atv-green-text); /* lima puro falha como texto (2,24:1) */
}

.atv-news-adjacent__title {
	font-size: var(--fontsize-body-m);
}

.atv-news-related {
	padding-block: var(--spacing-layout-m);
	background: var(--color-black-5);
}

@media (min-width: 768px) {
	.atv-news-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.atv-news-hero--photo {
		min-height: 28rem;
	}

	.atv-news-hero--photo h1,
	.atv-news-hero--text h1 {
		font-size: var(--fontsize-heading-xl);
	}
}

@media (min-width: 1024px) {
	.atv-news-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.atv-news-card__title,
	.atv-chip {
		transition: none;
	}
}

@media (forced-colors: active) {
	.atv-chip--active {
		forced-color-adjust: none;
		background: Highlight;
		color: HighlightText;
	}
}
