/* ==========================================
   Tokens
   ========================================== */
.af-ns,
.af-ns-list,
.af-ns-progress {
	--af-ns-negro: var(--negro, #000000);
	--af-ns-verde: var(--verde, #79d100);
	--af-ns-blanco: var(--blanco, #f8f8f6);
	--af-ns-borde: #e2e2de;
	--af-ns-suave: #ecece8;
	--af-ns-muted: #6b6b66;
	--af-ns-muted-osc: #a8a8a2;
	--af-ns-lectura: 740px;
	--af-ns-ancho: 1200px;
	--af-ns-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--af-ns-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.af-ns,
.af-ns-list {
	font-family: 'DM Sans', sans-serif;
	color: var(--af-ns-negro);
}

.af-ns,
.af-ns-list--rel {
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.af-ns *,
.af-ns *::before,
.af-ns *::after,
.af-ns-list *,
.af-ns-list *::before,
.af-ns-list *::after {
	box-sizing: border-box;
}

/* ==========================================
   Barra de progreso de lectura
   ========================================== */
.af-ns-progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 9999;
	width: 100%;
	height: 4px;
	pointer-events: none;
}

.admin-bar .af-ns-progress {
	top: 32px;
}

.af-ns-progress__bar {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--af-ns-verde);
	transform: scaleX(0);
	transform-origin: left center;
}

/* ==========================================
   Noticia: encabezado
   ========================================== */
.af-ns__header {
	max-width: 960px;
	margin: 0 0 32px;
}

.af-ns__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	margin-bottom: 20px;
}

.af-ns__date {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px 8px 12px;
	background: var(--af-ns-negro);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	color: var(--af-ns-blanco);
}

.af-ns__date-icon {
	width: 16px;
	height: 16px;
	color: var(--af-ns-verde);
}

.af-ns__reading {
	font-size: 14px;
	color: var(--af-ns-muted);
}

.af-ns__title {
	margin: 0;
	font-family: 'Montserrat', sans-serif;
	font-size: 32px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--af-ns-negro);
	text-wrap: balance;
}

.af-ns__lead {
	max-width: var(--af-ns-lectura);
	margin: 20px 0 0;
	padding-left: 18px;
	border-left: 4px solid var(--af-ns-verde);
	font-size: 18px;
	line-height: 1.55;
	color: var(--af-ns-muted);
}

/* ==========================================
   Noticia: imagen destacada
   ========================================== */
.af-ns__figure {
	margin: 0 0 40px;
}

.af-ns__img-wrap {
	overflow: hidden;
	background: var(--af-ns-suave);
}

.af-ns__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.af-ns__caption {
	margin-top: 10px;
	font-size: 13px;
	color: var(--af-ns-muted);
}

/* ==========================================
   Noticia: columnas (texto + barra lateral)
   ========================================== */
.af-ns__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 48px;
}

.af-ns__main,
.af-ns__aside {
	min-width: 0;
}

.af-ns__aside-inner {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

/* ==========================================
   Noticia: contenido
   ========================================== */

.af-ns__content {
	font-size: 17px;
	line-height: 1.8;
	overflow-wrap: break-word;
}

.af-ns__content > *:first-child {
	margin-top: 0;
}

.af-ns__content > *:last-child {
	margin-bottom: 0;
}

.af-ns__content > p:first-of-type {
	font-size: 1.12em;
	line-height: 1.7;
}

.af-ns__content p,
.af-ns__content ul,
.af-ns__content ol,
.af-ns__content blockquote,
.af-ns__content figure,
.af-ns__content table {
	margin: 0 0 1.4em;
}

.af-ns__content h2,
.af-ns__content h3,
.af-ns__content h4 {
	margin: 1.9em 0 0.6em;
	font-family: 'Montserrat', sans-serif;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--af-ns-negro);
}

.af-ns__content h2 {
	font-size: 24px;
}

.af-ns__content h3 {
	font-size: 20px;
}

.af-ns__content h4 {
	font-size: 17px;
}

.af-ns__content a {
	color: var(--af-ns-negro);
	text-decoration: underline;
	text-decoration-color: var(--af-ns-verde);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: background-color 0.2s linear;
}

.af-ns__content a:hover {
	background: var(--af-ns-verde);
}

.af-ns__content ul,
.af-ns__content ol {
	padding-left: 22px;
}

.af-ns__content li {
	margin-bottom: 0.4em;
}

.af-ns__content ul li::marker {
	color: var(--af-ns-verde);
}

.af-ns__content blockquote {
	padding: 22px 24px;
	border-left: 4px solid var(--af-ns-verde);
	background: var(--af-ns-negro);
	font-family: 'Montserrat', sans-serif;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--af-ns-blanco);
}

.af-ns__content blockquote p:last-child {
	margin-bottom: 0;
}

.af-ns__content blockquote cite {
	display: block;
	margin-top: 10px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	color: var(--af-ns-muted-osc);
}

.af-ns__content img {
	display: block;
	max-width: 100%;
	height: auto;
}

.af-ns__content figcaption {
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--af-ns-muted);
}

.af-ns__content iframe,
.af-ns__content video {
	display: block;
	width: 100%;
	max-width: 100%;
	border: 0;
}

.af-ns__content iframe[src*="youtube"],
.af-ns__content iframe[src*="vimeo"] {
	height: auto;
	aspect-ratio: 16 / 9;
}

.af-ns__content table {
	display: block;
	width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 15px;
}

.af-ns__content th,
.af-ns__content td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--af-ns-borde);
	text-align: left;
}

.af-ns__content th {
	font-weight: 700;
}

.af-ns__content hr {
	height: 1px;
	margin: 2em 0;
	border: 0;
	background: var(--af-ns-borde);
}

/* ==========================================
   Noticia: compartir
   ========================================== */
.af-ns__share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 20px;
	padding: 22px 24px;
	background: var(--af-ns-negro);
	color: var(--af-ns-blanco);
}

.af-ns__share-title {
	margin: 0;
	font-family: 'Montserrat', sans-serif;
	font-size: 16px;
	font-weight: 700;
}

.af-ns__share-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.af-ns__share-list li[hidden] {
	display: none;
}

.af-ns__share-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #3a3a37;
	border-radius: 50%;
	background: transparent;
	color: var(--af-ns-blanco);
	cursor: pointer;
	transition: background-color 0.25s var(--af-ns-ease), border-color 0.25s var(--af-ns-ease), color 0.25s var(--af-ns-ease), transform 0.25s var(--af-ns-ease);
}

.af-ns__share-link:hover,
.af-ns__share-link.is-copied {
	border-color: var(--af-ns-verde);
	background: var(--af-ns-verde);
	color: var(--af-ns-negro);
	transform: translateY(-3px);
}

.af-ns__share-icon {
	width: 18px;
	height: 18px;
}

.af-ns__share-status {
	flex-basis: 100%;
	min-height: 1em;
	font-size: 13px;
	color: var(--af-ns-verde);
}

.af-ns__share-status:empty {
	display: none;
}

/* ==========================================
   Noticia: últimas noticias (barra lateral)
   ========================================== */
.af-ns__latest-title {
	margin: 0 0 6px;
	padding-bottom: 12px;
	border-bottom: 3px solid var(--af-ns-negro);
	font-family: 'Montserrat', sans-serif;
	font-size: 18px;
	font-weight: 800;
}

.af-ns__latest-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.af-ns__latest-item {
	border-bottom: 1px solid var(--af-ns-borde);
}

.af-ns__latest-link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 0;
	text-decoration: none;
	color: var(--af-ns-negro);
}

.af-ns__latest-thumb {
	flex: 0 0 76px;
	width: 76px;
	height: 76px;
	overflow: hidden;
	background: var(--af-ns-suave);
}

.af-ns__latest-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--af-ns-ease-out);
}

.af-ns__latest-link:hover .af-ns__latest-img {
	transform: scale(1.1);
}

.af-ns__latest-text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.af-ns__latest-date {
	font-size: 12px;
	color: var(--af-ns-muted);
}

.af-ns__latest-name {
	display: -webkit-box;
	overflow: hidden;
	font-family: 'Montserrat', sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.25s var(--af-ns-ease);
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.af-ns__latest-link:hover .af-ns__latest-name {
	text-decoration-color: var(--af-ns-verde);
}

/* ==========================================
   Noticia: anterior / siguiente
   ========================================== */
.af-ns__nav {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	margin-top: 48px;
}

.af-ns__nav-link {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 20px 22px;
	overflow: hidden;
	border: 1px solid var(--af-ns-borde);
	text-decoration: none;
	color: var(--af-ns-negro);
	isolation: isolate;
	transition: color 0.35s var(--af-ns-ease), border-color 0.35s var(--af-ns-ease);
}

.af-ns__nav-link::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--af-ns-negro);
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform 0.35s var(--af-ns-ease);
}

.af-ns__nav-link:hover {
	border-color: var(--af-ns-negro);
	color: var(--af-ns-blanco);
}

.af-ns__nav-link:hover::before {
	transform: scaleY(1);
}

.af-ns__nav-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--af-ns-muted);
	transition: color 0.35s var(--af-ns-ease);
}

.af-ns__nav-link:hover .af-ns__nav-label {
	color: var(--af-ns-verde);
}

.af-ns__nav-icon {
	width: 16px;
	height: 16px;
}

.af-ns__nav-title {
	font-family: 'Montserrat', sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

.af-ns__nav-link--next {
	align-items: flex-end;
	text-align: right;
}

/* ==========================================
   Tarjetas (listado y otras noticias)
   ========================================== */
.af-ns-list__title {
	margin: 0 0 28px;
	font-family: 'Montserrat', sans-serif;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--af-ns-negro);
}

.af-ns-list__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 40px 28px;
}

.af-ns-list__empty {
	margin: 0;
	font-size: 16px;
	color: var(--af-ns-muted);
}

.af-ns-card {
	position: relative;
	display: flex;
	flex-direction: column;
}

.af-ns-card::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 3px;
	background: var(--af-ns-verde);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.45s var(--af-ns-ease);
}

.af-ns-card:hover::after,
.af-ns-card:focus-within::after {
	transform: scaleX(1);
}

.af-ns-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--af-ns-suave);
}

.af-ns-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s var(--af-ns-ease-out);
}

.af-ns-card:hover .af-ns-card__img {
	transform: scale(1.07);
}

/* Fecha sobre la imagen */
.af-ns-card__date {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 64px;
	padding: 10px 12px 9px;
	background: var(--af-ns-negro);
	color: var(--af-ns-blanco);
	line-height: 1;
	text-align: center;
}

.af-ns-card__day {
	font-family: 'Montserrat', sans-serif;
	font-size: 26px;
	font-weight: 800;
	color: var(--af-ns-verde);
}

.af-ns-card__month {
	margin-top: 5px;
	font-family: 'Montserrat', sans-serif;
	font-size: 12px;
	font-weight: 700;
	text-transform: capitalize;
}

.af-ns-card__year {
	margin-top: 3px;
	font-size: 11px;
	color: var(--af-ns-muted-osc);
}

.af-ns-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 20px 0 22px;
}

.af-ns-card__meta {
	margin: 0;
	font-size: 13px;
	color: var(--af-ns-muted);
}

.af-ns-card__title {
	margin: 0;
	font-family: 'Montserrat', sans-serif;
	font-size: 19px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.af-ns-card__link {
	color: var(--af-ns-negro);
	text-decoration: none;
	transition: color 0.25s var(--af-ns-ease);
}

/* Toda la tarjeta clickeable */
.af-ns-card__link::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 2;
}

.af-ns-card__link:focus-visible {
	outline: none;
}

.af-ns-card:focus-within {
	outline: 2px solid var(--af-ns-verde);
	outline-offset: 4px;
}

.af-ns-card__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	font-size: 15px;
	line-height: 1.6;
	color: var(--af-ns-muted);
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.af-ns-card__more {
	background-color: #79d100;
	position: relative;
	align-self: flex-start;
	margin-top: auto;
	padding: 5px 10px 5px 10px;
	border-radius: 5px;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: var(--af-ns-negro);
}

/* Destacada (primera del listado) */
.af-ns-card--destacada {
	background: var(--af-ns-negro);
}

.af-ns-card--destacada .af-ns-card__body {
	padding: 24px 22px 28px;
}

.af-ns-card--destacada .af-ns-card__date {
	background: var(--af-ns-verde);
	color: var(--af-ns-negro);
}

.af-ns-card--destacada .af-ns-card__day {
	color: var(--af-ns-negro);
}

.af-ns-card--destacada .af-ns-card__year {
	color: var(--af-ns-negro);
}

.af-ns-card--destacada .af-ns-card__meta,
.af-ns-card--destacada .af-ns-card__excerpt {
	color: var(--af-ns-muted-osc);
}

.af-ns-card--destacada .af-ns-card__link {
	color: var(--af-ns-blanco);
}

.af-ns-card--destacada .af-ns-card__title {
	font-size: 24px;
}

.af-ns-card--destacada .af-ns-card__excerpt {
	-webkit-line-clamp: 4;
}

/* ==========================================
   Paginación
   ========================================== */
.af-ns-pag {
	margin-top: 48px;
}

.af-ns-pag__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.af-ns-pag .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--af-ns-borde);
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	color: var(--af-ns-negro);
	transition: background-color 0.25s var(--af-ns-ease), border-color 0.25s var(--af-ns-ease), color 0.25s var(--af-ns-ease);
}

.af-ns-pag a.page-numbers:hover {
	border-color: var(--af-ns-negro);
	background: var(--af-ns-negro);
	color: var(--af-ns-blanco);
}

.af-ns-pag .page-numbers.current {
	border-color: var(--af-ns-verde);
	background: var(--af-ns-verde);
}

.af-ns-pag .page-numbers.dots {
	border-color: transparent;
}

.af-ns-pag__icon {
	width: 18px;
	height: 18px;
}

.af-ns-pag .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ==========================================
   Foco visible
   ========================================== */
.af-ns a:focus-visible,
.af-ns button:focus-visible,
.af-ns-pag a:focus-visible {
	outline: 2px solid var(--af-ns-verde);
	outline-offset: 3px;
}

/* ==========================================
   Animaciones de entrada
   Solo se activan si el JS corre (clase is-anim),
   así en el editor de Bricks todo se ve sin depender del script.
   ========================================== */
.is-anim [data-af-ns-reveal] {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.8s var(--af-ns-ease-out), transform 0.8s var(--af-ns-ease-out);
}

.is-anim [data-af-ns-reveal].is-visible {
	opacity: 1;
	transform: none;
}

.is-anim .af-ns__figure[data-af-ns-reveal] {
	transform: none;
}

.is-anim .af-ns__figure .af-ns__img-wrap {
	clip-path: inset(0 0 100% 0);
	transition: clip-path 1.1s var(--af-ns-ease-out);
}

.is-anim .af-ns__figure .af-ns__img {
	transform: scale(1.12);
	transition: transform 1.4s var(--af-ns-ease-out);
}

.is-anim .af-ns__figure.is-visible .af-ns__img-wrap {
	clip-path: inset(0 0 0 0);
}

.is-anim .af-ns__figure.is-visible .af-ns__img {
	transform: none;
}

.is-anim .af-ns-card {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity 0.7s var(--af-ns-ease-out), transform 0.7s var(--af-ns-ease-out);
}

.is-anim .af-ns-card .af-ns-card__media {
	clip-path: inset(100% 0 0 0);
	transition: clip-path 0.9s var(--af-ns-ease-out);
	transition-delay: inherit;
}

.is-anim .af-ns-card.is-visible {
	opacity: 1;
	transform: none;
}

.is-anim .af-ns-card.is-visible .af-ns-card__media {
	clip-path: inset(0 0 0 0);
}

/* ==========================================
   Desktop
   ========================================== */
@media (min-width: 721px) {
	.af-ns__title {
		font-size: 48px;
	}

	.af-ns__lead {
		font-size: 20px;
	}

	.af-ns__figure {
		margin-bottom: 56px;
	}

	.af-ns__content {
		font-size: 18px;
	}

	.af-ns__content h2 {
		font-size: 28px;
	}

	.af-ns__content h3 {
		font-size: 22px;
	}

	.af-ns__content blockquote {
		padding: 28px 32px;
		font-size: 22px;
	}

	.af-ns__layout {
		grid-template-columns: minmax(0, 1fr) 260px;
		column-gap: 40px;
		align-items: start;
	}

	.af-ns__aside {
		position: sticky;
		top: 32px;
	}

	.admin-bar .af-ns__aside {
		top: 64px;
	}

	.af-ns__nav {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.af-ns__nav-link--next:only-child {
		grid-column: 2;
	}

	.af-ns-list__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.af-ns-list__title {
		font-size: 30px;
	}

	.af-ns-card--destacada {
		display: grid;
		grid-column: 1 / -1;
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	}

	.af-ns-card--destacada .af-ns-card__media {
		aspect-ratio: auto;
		min-height: 360px;
	}

	.af-ns-card--destacada .af-ns-card__body {
		justify-content: center;
		gap: 14px;
		padding: 40px 36px;
	}

	.af-ns-card--destacada .af-ns-card__title {
		font-size: 30px;
	}

	.af-ns-card--destacada .af-ns-card__more {
		margin-top: 10px;
	}

	.af-ns-card--destacada .af-ns-card__date {
		min-width: 80px;
		padding: 14px 16px 12px;
	}

	.af-ns-card--destacada .af-ns-card__day {
		font-size: 34px;
	}
}

@media (min-width: 1024px) {
	.af-ns__layout {
		grid-template-columns: minmax(0, 1fr) 360px;
		column-gap: 56px;
	}

	.af-ns-list__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.af-ns__title {
		font-size: 56px;
	}

	.af-ns-card--destacada .af-ns-card__media {
		min-height: 440px;
	}

	.af-ns-card--destacada .af-ns-card__body {
		padding: 48px 44px;
	}

	.af-ns-card--destacada .af-ns-card__title {
		font-size: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.af-ns *,
	.af-ns-list *,
	.af-ns-list *::after,
	.af-ns-progress__bar {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
	}

	.is-anim [data-af-ns-reveal],
	.is-anim .af-ns-card {
		opacity: 1;
		transform: none;
	}

	.is-anim .af-ns__figure .af-ns__img-wrap,
	.is-anim .af-ns-card .af-ns-card__media {
		clip-path: none;
	}

	.is-anim .af-ns__figure .af-ns__img {
		transform: none;
	}
}
