/* ==========================================================================
   Toscano – Noticias (listado de entradas)
   Categoría de noticias / cualquier página. Prefijo .tnw.
   ========================================================================== */

.tnw {
	--tnw-bg: #ffffff;
	--tnw-accent: var(--toscano-brand-teal, #009a9d);
	--tnw-accent-2: #2fc4c7;
	--tnw-deep: var(--toscano-brand-deep, #032d35);
	--tnw-title: var(--tnw-deep);
	--tnw-text: #6f6f6f;
	--tnw-muted: #8a9699;
	--tnw-card: #ffffff;
	--tnw-border: #e3ecee;
	--tnw-cols: 3;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	padding: 90px 0 110px;
	background: var(--tnw-bg);
	color: var(--tnw-text);
	font-family: "Inter", sans-serif;
	-webkit-font-smoothing: antialiased;
	word-break: break-word;
}

.tnw-grid-bg--yes .tnw {
	background:
		linear-gradient(rgba(3, 45, 53, .035) 1px, transparent 1px) 0 0 / 48px 48px,
		linear-gradient(90deg, rgba(3, 45, 53, .035) 1px, transparent 1px) 0 0 / 48px 48px,
		var(--tnw-bg);
}

.tnw *,
.tnw *::before,
.tnw *::after {
	box-sizing: border-box;
}

.tnw .tnw__inner {
	max-width: 1248px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Encabezado ---------- */

.tnw .tnw__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px 40px;
	margin-bottom: 44px;
}

.tnw .tnw__intro {
	max-width: 640px;
}

.tnw .tnw__eyebrow {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--tnw-text);
}

.tnw .tnw__title {
	margin: 0;
	font-family: "Inter", sans-serif;
	font-size: 39px;
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0;
	text-transform: none;
	color: var(--tnw-title);
}

.tnw .tnw__hl {
	color: var(--tnw-accent);
}

.tnw .tnw__text {
	margin: 16px 0 0;
	font-size: 16px;
	line-height: 1.59;
}

/* Fichas de categoría (con indicador de desplazamiento compartido .tk-hs) */
.tnw .tnw__chips-wrap {
	--tk-hs-bg: var(--tnw-bg);
	flex: 0 1 auto;
}

.tnw .tnw__chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.tnw a.tnw__chip {
	display: inline-flex;
	align-items: center;
	padding: 9px 16px;
	border: 1px solid var(--tnw-border);
	border-radius: 999px;
	background: #ffffff;
	color: var(--tnw-deep);
	font-size: 14px;
	font-weight: 600;
	line-height: 18px;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.tnw a.tnw__chip:hover {
	border-color: var(--tnw-accent);
	color: var(--tnw-accent);
}

.tnw a.tnw__chip.is-active {
	border-color: var(--tnw-deep);
	background: var(--tnw-deep);
	color: #ffffff;
}

/* ---------- Tarjeta ---------- */

.tnw .tnw__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--tnw-border);
	border-radius: 16px;
	background: var(--tnw-card);
	transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease, border-color .45s ease;
}

.tnw .tnw__card:hover,
.tnw .tnw__card:focus-within {
	transform: translateY(-4px);
	border-color: color-mix(in srgb, var(--tnw-accent) 35%, var(--tnw-border));
	box-shadow: 0 22px 44px -22px rgba(3, 45, 53, .28);
}

.tnw .tnw__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--tnw-deep);
}

.tnw .tnw__media img,
.tnw .tnw__media .tnw__ph {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.tnw .tnw__card:hover .tnw__media img,
.tnw .tnw__card:hover .tnw__media .tnw__ph {
	transform: scale(1.05);
}

/* Imagen de marca (entrada sin imagen destacada) */
.tnw .tnw__ph-bolt {
	stroke-dasharray: 100;
	stroke-dashoffset: 0;
}

.tnw .tnw__card:hover .tnw__ph-bolt {
	animation: tnw-bolt 1.1s cubic-bezier(.3, .6, .2, 1);
}

@keyframes tnw-bolt {
	from { stroke-dashoffset: 100; }
	to { stroke-dashoffset: 0; }
}

.tnw .tnw__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 22px 24px 24px;
}

.tnw .tnw__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 12px;
	font-size: 13px;
	line-height: 18px;
	color: var(--tnw-muted);
}

.tnw .tnw__cat {
	display: inline-flex;
	padding: 3px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--tnw-accent) 10%, transparent);
	color: var(--toscano-text-accent, #007b7e);
	font-size: 12px;
	font-weight: 700;
	line-height: 18px;
}

.tnw .tnw__info i {
	margin: 0 6px;
	font-style: normal;
	opacity: .7;
}

.tnw .tnw__card-title {
	margin: 0;
	font-family: "Inter", sans-serif;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.32;
	letter-spacing: 0;
	text-transform: none;
	color: var(--tnw-title);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tnw a.tnw__link {
	color: inherit;
	text-decoration: none;
	transition: color .25s ease;
}

/* Toda la tarjeta es clicable */
.tnw a.tnw__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: inherit;
}

.tnw .tnw__card:hover a.tnw__link {
	color: var(--tnw-accent);
}

.tnw a.tnw__link:focus-visible {
	outline: none;
}

.tnw .tnw__card:has(a.tnw__link:focus-visible) {
	outline: 2px solid var(--tnw-accent);
	outline-offset: 3px;
}

.tnw .tnw__excerpt {
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--tnw-text);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tnw .tnw__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 18px;
	color: var(--tnw-accent);
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
}

.tnw .tnw__more svg {
	width: 16px;
	height: 16px;
	transition: transform .3s ease;
}

.tnw .tnw__card:hover .tnw__more svg {
	transform: translateX(5px);
}

/* Filo eléctrico: una corriente recorre el borde superior al pasar */
.tnw .tnw__edge {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 3;
	height: 3px;
	overflow: hidden;
	pointer-events: none;
}

.tnw .tnw__edge::before,
.tnw .tnw__edge::after {
	content: "";
	position: absolute;
	inset: 0;
}

.tnw .tnw__edge::before {
	background: linear-gradient(90deg, var(--tnw-accent), var(--tnw-accent-2));
	transform: scaleX(0);
	transform-origin: 0 50%;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.tnw .tnw__edge::after {
	right: auto;
	left: -100px;
	width: 90px;
	background: linear-gradient(90deg, transparent, #ffffff, transparent);
	opacity: 0;
}

.tnw .tnw__card:hover .tnw__edge::before {
	transform: scaleX(1);
}

.tnw .tnw__card:hover .tnw__edge::after {
	animation: tnw-spark 1.6s .35s ease-in-out infinite;
}

@keyframes tnw-spark {
	0% { opacity: 0; left: -100px; }
	15% { opacity: .9; }
	85% { opacity: .9; }
	100% { opacity: 0; left: 100%; }
}

/* ---------- Destacada ---------- */

.tnw .tnw__card--big {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	margin-bottom: 28px;
}

.tnw .tnw__card--big .tnw__media {
	aspect-ratio: auto;
	min-height: 380px;
}

.tnw .tnw__card--big .tnw__media img,
.tnw .tnw__card--big .tnw__media .tnw__ph {
	position: absolute;
	inset: 0;
}

.tnw .tnw__card--big .tnw__body {
	justify-content: center;
	padding: 44px 48px;
}

.tnw .tnw__card--big .tnw__card-title {
	font-size: 30px;
	font-weight: 500;
	line-height: 1.22;
	-webkit-line-clamp: 4;
}

.tnw .tnw__card--big .tnw__excerpt {
	margin-top: 16px;
	font-size: 16px;
	-webkit-line-clamp: 4;
}

.tnw .tnw__card--big .tnw__more {
	margin-top: 0;
	padding-top: 26px;
}

.tnw .tnw__flag {
	position: absolute;
	top: 18px;
	left: 18px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px 7px 11px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .94);
	color: var(--tnw-deep);
	font-size: 13px;
	font-weight: 700;
	line-height: 16px;
	box-shadow: 0 6px 18px rgba(3, 45, 53, .18);
}

.tnw .tnw__flag svg {
	width: 10px;
	height: 14px;
	color: var(--tnw-accent);
}

/* ---------- Rejilla ---------- */

.tnw .tnw__grid {
	display: grid;
	grid-template-columns: repeat(var(--tnw-cols), minmax(0, 1fr));
	gap: 28px;
}

/* Entrada al hacer scroll (sólo si hay JS) */
.tnw.tnw--js .tnw__card {
	opacity: 0;
	transform: translateY(26px);
}

.tnw.tnw--js .tnw__card.is-in {
	opacity: 1;
	transform: none;
	transition: opacity .7s ease calc(var(--d, 0) * 1ms), transform .7s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * 1ms), box-shadow .45s ease, border-color .45s ease;
}

.tnw.tnw--js .tnw__card.is-in:hover,
.tnw.tnw--js .tnw__card.is-in:focus-within {
	transform: translateY(-4px);
	transition-delay: 0s;
}

/* ---------- Paginación ---------- */

.tnw .tnw__pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 48px;
}

.tnw a.tnw__loadmore {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 28px;
	overflow: hidden;
	border: 1px solid var(--tnw-accent);
	border-radius: 4px;
	background: transparent;
	color: var(--tnw-accent);
	font-size: 14px;
	font-weight: 700;
	line-height: 20px;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}

.tnw a.tnw__loadmore:hover,
.tnw a.tnw__loadmore:focus-visible {
	background: var(--tnw-accent);
	color: #ffffff;
	box-shadow: 0 8px 22px color-mix(in srgb, var(--tnw-accent) 30%, transparent);
}

.tnw .tnw__loadmore-ico {
	width: 16px;
	height: 16px;
	transition: transform .3s ease;
}

.tnw a.tnw__loadmore:hover .tnw__loadmore-ico {
	transform: translateY(3px);
}

/* Cargando: una corriente recorre el botón */
.tnw a.tnw__loadmore.is-loading {
	pointer-events: none;
	background: var(--tnw-accent);
	color: #ffffff;
}

.tnw a.tnw__loadmore.is-loading::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 40%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
	animation: tnw-load 1s linear infinite;
}

.tnw a.tnw__loadmore.is-loading .tnw__loadmore-ico {
	animation: tnw-bob .6s ease-in-out infinite alternate;
}

@keyframes tnw-load {
	from { left: -40%; }
	to { left: 100%; }
}

@keyframes tnw-bob {
	to { transform: translateY(3px); }
}

.tnw .tnw__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 10px;
	border: 1px solid var(--tnw-border);
	border-radius: 999px;
	background: #ffffff;
	color: var(--tnw-deep);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color .25s ease, color .25s ease;
}

.tnw a.tnw__num:hover {
	border-color: var(--tnw-accent);
	color: var(--tnw-accent);
}

.tnw .tnw__num.is-active {
	border-color: var(--tnw-deep);
	background: var(--tnw-deep);
	color: #ffffff;
}

.tnw .tnw__num--gap {
	border-color: transparent;
	background: transparent;
}

.tnw .tnw__empty {
	margin: 0;
	padding: 48px 24px;
	border: 1px dashed var(--tnw-border);
	border-radius: 16px;
	background: #ffffff;
	text-align: center;
	font-size: 16px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
	.tnw .tnw__title {
		font-size: 34px;
	}

	.tnw .tnw__card--big .tnw__body {
		padding: 36px;
	}

	.tnw .tnw__card--big .tnw__card-title {
		font-size: 26px;
	}
}

/* Columnas por defecto por dispositivo (el control de Elementor, más específico, manda) */
@media (max-width: 1024px) {
	.tnw {
		--tnw-cols: 2;
		padding: 70px 0 90px;
	}

	.tnw .tnw__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.tnw .tnw__chips {
		justify-content: flex-start;
	}

	.tnw .tnw__grid {
		gap: 22px;
	}

	.tnw .tnw__card--big .tnw__media {
		min-height: 320px;
	}
}

@media (max-width: 767px) {
	.tnw {
		--tnw-cols: 1;
		padding: 48px 0 70px;
	}

	.tnw .tnw__inner {
		padding: 0 16px;
	}

	.tnw .tnw__head {
		margin-bottom: 28px;
	}

	.tnw .tnw__title {
		font-size: 28px;
	}

	.tnw .tnw__text {
		font-size: 15px;
	}

	/* Las fichas se deslizan en una sola línea, de borde a borde de la pantalla */
	.tnw .tnw__chips-wrap {
		--tk-hs-inset: 8px;
		width: calc(100% + 32px);
		margin: 0 -16px;
	}

	.tnw .tnw__chips {
		flex-wrap: nowrap;
		padding: 0 16px 4px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.tnw .tnw__chips::-webkit-scrollbar {
		display: none;
	}

	.tnw .tnw__card--big {
		grid-template-columns: minmax(0, 1fr);
		margin-bottom: 22px;
	}

	.tnw .tnw__card--big .tnw__media {
		min-height: 0;
		aspect-ratio: 16 / 10;
	}

	.tnw .tnw__card--big .tnw__body {
		padding: 22px 22px 24px;
	}

	.tnw .tnw__card--big .tnw__card-title {
		font-size: 22px;
	}

	.tnw .tnw__card--big .tnw__excerpt {
		font-size: 15px;
		-webkit-line-clamp: 3;
	}

	.tnw .tnw__body {
		padding: 20px 20px 22px;
	}

	.tnw .tnw__card-title {
		font-size: 18px;
	}

	.tnw .tnw__flag {
		top: 12px;
		left: 12px;
	}

	.tnw .tnw__pager {
		margin-top: 36px;
	}

	.tnw a.tnw__loadmore {
		justify-content: center;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tnw.tnw--js .tnw__card {
		opacity: 1;
		transform: none;
	}

	.tnw .tnw__card,
	.tnw .tnw__card:hover,
	.tnw .tnw__media img,
	.tnw .tnw__media .tnw__ph {
		transform: none !important;
		transition: none;
	}

	.tnw .tnw__card:hover .tnw__edge::after,
	.tnw .tnw__card:hover .tnw__ph-bolt {
		animation: none;
	}
}
