/* ══════════════════════════════════════════════════════
   Notizie — news landing page (page-notizie.php)

   Ported from ali.ong's page-notizie template and re-skinned to the
   rete cyan/mauve palette + Lora/Nunito type. Everything reads from the
   --ali-* aliases in ali-base.css, so a palette change lands here too.
   ══════════════════════════════════════════════════════ */

/* ── Hero ────────────────────────────────────────── */
.nz-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	padding: 100px 40px 56px;
	background: var(--ali-cream, #FAFAF8);
}

.nz-hero__inner {
	position: relative;
	z-index: 2;
	max-width: 1140px;
	width: 100%;
	margin: 0 auto;
	animation: fadeInUp .9s cubic-bezier(.22, 1, .36, 1) both;
}

.nz-hero h1 {
	font-family: 'Lora', Georgia, serif;
	font-size: clamp(2.2rem, 5vw, 3.4rem);
	font-weight: 600;
	color: var(--ali-navy, #7A4D79);
	margin: 0 0 12px;
	line-height: 1.1;
}

.nz-hero p {
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: clamp(.9rem, 1.5vw, 1.05rem);
	color: var(--ali-text-secondary, #64748B);
	margin: 0;
	max-width: 560px;
	line-height: 1.7;
}

/* ── Featured section ───────────────────────────── */
.nz-featured {
	padding: 56px 24px 0;
	background: var(--ali-cream, #FAFAF8);
}

.nz-featured__inner {
	max-width: 1140px;
	margin: 0 auto;
}

.nz-featured__grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	grid-template-rows: auto auto;
	gap: 20px;
}

/* One featured post: the hero card spans the full width instead of
   leaving a hole where the two side cards would have been. */
.nz-featured__grid--single {
	grid-template-columns: 1fr;
	grid-template-rows: auto;
}

.nz-featured__grid--single .nz-featured__hero {
	grid-row: auto;
}

.nz-featured__hero {
	grid-row: 1 / 3;
}

.nz-featured__hero .nz-card {
	height: 100%;
	border: none;
	border-radius: var(--ali-radius, 1rem);
	overflow: hidden;
	position: relative;
}

.nz-featured__hero .nz-card__img {
	aspect-ratio: auto;
	position: absolute;
	inset: 0;
}

.nz-featured__hero .nz-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nz-featured__hero .nz-card__body {
	position: relative;
	z-index: 2;
	margin-top: auto;
	padding: 40px 32px 36px;
	background: linear-gradient(to top, rgba(30, 41, 59, .94) 0%, rgba(30, 41, 59, .7) 60%, transparent 100%);
	min-height: 420px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

/* No featured image: the gradient has nothing to sit on, so fill with the
   brand mauve instead of a transparent-to-dark wash over white. */
.nz-featured__hero .nz-card--noimg .nz-card__body {
	background: linear-gradient(135deg, var(--rete-primary-dark, #7A4D79), var(--rete-primary, #A367A1));
}

.nz-featured__hero .nz-card__meta {
	color: rgba(255, 255, 255, .7);
}

.nz-featured__hero .nz-card__cat {
	background: rgba(0, 192, 198, .35);
	color: #fff;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.nz-featured__hero .nz-card__body h3 {
	font-size: 1.55rem;
	color: #fff;
	line-height: 1.22;
	margin-bottom: 12px;
}

.nz-featured__hero .nz-card:hover .nz-card__body h3 {
	color: #fff;
}

.nz-featured__hero .nz-card__excerpt {
	color: rgba(255, 255, 255, .78);
	-webkit-line-clamp: 3;
	font-size: .88rem;
	line-height: 1.7;
}

.nz-featured__side {
	animation: fadeInUp .8s cubic-bezier(.22, 1, .36, 1) both;
}

.nz-featured__side:nth-of-type(2) { animation-delay: .15s; }
.nz-featured__side:nth-of-type(3) { animation-delay: .25s; }

/* ── Card (shared) ──────────────────────────────── */
.nz-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--ali-radius, 1rem);
	overflow: hidden;
	background: var(--rete-card, #fff);
	border: 1px solid var(--rete-border, #E2E8F0);
	text-decoration: none;
	color: var(--ali-text, #1E293B);
	transition: transform .4s cubic-bezier(.22, 1, .36, 1), box-shadow .4s cubic-bezier(.22, 1, .36, 1), border-color .3s ease;
}

/* The whole card is one <a>, so ali-base.css's `a:hover { text-decoration:
   underline }` would underline the title, the excerpt and the category badge
   at once. The lift + colour shift is the hover affordance here. */
.nz-card:hover,
.nz-card:focus-visible {
	text-decoration: none;
}

.nz-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--rete-shadow-hover, 0 16px 48px rgba(30, 41, 59, .1));
	border-color: color-mix(in srgb, var(--ali-teal, #00C0C6) 30%, transparent);
	color: var(--ali-text, #1E293B);
}

.nz-card__img {
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var(--ali-warm-gray, #E2E8F0);
	position: relative;
}

.nz-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}

.nz-card:hover .nz-card__img img {
	transform: scale(1.05);
}

.nz-card__body {
	padding: 22px 24px 28px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.nz-card__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .7rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ali-text-secondary, #64748B);
}

.nz-card__cat {
	background: var(--ali-teal-glow, #E5F8F9);
	color: var(--ali-teal-deep, #008A8E);
	padding: 3px 11px;
	border-radius: 20px;
	font-weight: 700;
	font-size: .65rem;
	letter-spacing: .04em;
}

.nz-card__body h3 {
	font-family: 'Lora', Georgia, serif;
	font-size: 1.08rem;
	font-weight: 600;
	color: var(--ali-navy, #7A4D79);
	margin: 0 0 10px;
	line-height: 1.3;
	transition: color .25s ease;
}

.nz-card:hover .nz-card__body h3 {
	color: var(--ali-teal-deep, #008A8E);
}

.nz-card__excerpt {
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .85rem;
	color: var(--ali-text-secondary, #64748B);
	line-height: 1.65;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Filter bar ────────────────────────────────── */
.nz-filters {
	padding: 40px 24px 0;
	background: var(--ali-cream, #FAFAF8);
}

.nz-filters__inner {
	max-width: 1140px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
}

.nz-filters__search {
	position: relative;
	flex: 0 0 auto;
	width: 260px;
}

.nz-filters__search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 15px;
	height: 15px;
	color: var(--ali-text-secondary, #64748B);
	pointer-events: none;
}

.nz-filters__search-input {
	width: 100%;
	padding: 9px 14px 9px 38px;
	border: 1.5px solid var(--rete-border, #E2E8F0);
	border-radius: 50px;
	background: #fff;
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .84rem;
	color: var(--ali-text, #1E293B);
	outline: none;
	transition: border-color .25s ease, box-shadow .25s ease;
}

.nz-filters__search-input::placeholder {
	color: var(--ali-text-secondary, #64748B);
	opacity: .7;
}

.nz-filters__search-input:focus {
	border-color: var(--ali-teal, #00C0C6);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ali-teal, #00C0C6) 18%, transparent);
}

.nz-filters__search-clear {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	border: none;
	background: rgba(30, 41, 59, .07);
	border-radius: 50%;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: var(--ali-text-secondary, #64748B);
	font-size: .7rem;
	line-height: 1;
	transition: background .2s ease;
}

.nz-filters__search-clear:hover {
	background: rgba(30, 41, 59, .14);
}

.nz-filters__search-input:not(:placeholder-shown) ~ .nz-filters__search-clear {
	display: flex;
}

.nz-filters__sep {
	width: 1px;
	height: 24px;
	background: var(--rete-border, #E2E8F0);
	flex-shrink: 0;
}

.nz-filters__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.nz-filters__pill {
	display: inline-flex;
	align-items: center;
	padding: 6px 16px;
	border: 1.5px solid var(--rete-border, #E2E8F0);
	border-radius: 50px;
	background: #fff;
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .02em;
	color: var(--ali-text-secondary, #64748B);
	cursor: pointer;
	transition: all .25s cubic-bezier(.22, 1, .36, 1);
	white-space: nowrap;
}

.nz-filters__pill:hover {
	border-color: var(--ali-teal, #00C0C6);
	color: var(--ali-teal-deep, #008A8E);
}

.nz-filters__pill.active {
	background: var(--ali-navy, #7A4D79);
	border-color: var(--ali-navy, #7A4D79);
	color: #fff;
}

.nz-filters__pill--tag {
	font-weight: 500;
	font-size: .74rem;
	padding: 5px 13px;
}

.nz-filters__pill--tag.active {
	background: var(--ali-teal, #00C0C6);
	border-color: var(--ali-teal, #00C0C6);
	color: #fff;
}

.nz-filters__reset {
	display: none;
	align-items: center;
	gap: 4px;
	padding: 6px 14px;
	border: none;
	border-radius: 50px;
	background: rgba(30, 41, 59, .05);
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .74rem;
	font-weight: 600;
	color: var(--ali-text-secondary, #64748B);
	cursor: pointer;
	transition: all .25s ease;
	white-space: nowrap;
}

.nz-filters__reset:hover {
	background: rgba(30, 41, 59, .1);
	color: var(--ali-text, #1E293B);
}

.nz-filters--active .nz-filters__reset {
	display: inline-flex;
}

/* ── Divider ────────────────────────────────────── */
.nz-divider {
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 24px;
	background: var(--ali-cream, #FAFAF8);
}

.nz-divider__line {
	height: 1px;
	background: linear-gradient(90deg, var(--ali-teal, #00C0C6) 0%, var(--rete-border, #E2E8F0) 30%, var(--rete-border, #E2E8F0) 70%, transparent 100%);
	margin-top: 56px;
}

/* ── Grid section ───────────────────────────────── */
.nz-articles {
	padding: 0 24px 88px;
	background: var(--ali-cream, #FAFAF8);
}

.nz-articles__inner {
	max-width: 1140px;
	margin: 0 auto;
}

.nz-articles__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 48px;
	margin-bottom: 32px;
}

.nz-articles__label {
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .15em;
	color: var(--ali-text-secondary, #64748B);
	margin: 0;
}

.nz-articles__count {
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .78rem;
	color: var(--ali-text-secondary, #64748B);
}

.nz-articles__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

/* Staggered reveal */
.nz-articles__grid .nz-card {
	animation: fadeInUp .7s cubic-bezier(.22, 1, .36, 1) both;
}

.nz-articles__grid .nz-card:nth-child(1) { animation-delay: .05s; }
.nz-articles__grid .nz-card:nth-child(2) { animation-delay: .12s; }
.nz-articles__grid .nz-card:nth-child(3) { animation-delay: .19s; }
.nz-articles__grid .nz-card:nth-child(4) { animation-delay: .26s; }
.nz-articles__grid .nz-card:nth-child(5) { animation-delay: .33s; }
.nz-articles__grid .nz-card:nth-child(6) { animation-delay: .40s; }
.nz-articles__grid .nz-card:nth-child(7) { animation-delay: .47s; }
.nz-articles__grid .nz-card:nth-child(8) { animation-delay: .54s; }
.nz-articles__grid .nz-card:nth-child(9) { animation-delay: .61s; }

/* ── Load more ──────────────────────────────────── */
.nz-load-more {
	display: flex;
	justify-content: center;
	margin-top: 56px;
}

.nz-load-more__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 36px;
	border-radius: 50px;
	border: 1.5px solid var(--rete-border, #E2E8F0);
	background: #fff;
	font-family: 'Nunito', system-ui, sans-serif;
	font-size: .84rem;
	font-weight: 600;
	letter-spacing: .04em;
	color: var(--ali-text, #1E293B);
	cursor: pointer;
	transition: all .35s cubic-bezier(.22, 1, .36, 1);
}

.nz-load-more__btn:hover {
	border-color: var(--ali-teal, #00C0C6);
	color: var(--ali-teal-deep, #008A8E);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px color-mix(in srgb, var(--ali-teal, #00C0C6) 18%, transparent);
}

.nz-load-more__btn:disabled {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.nz-load-more__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid color-mix(in srgb, var(--ali-teal, #00C0C6) 25%, transparent);
	border-top-color: var(--ali-teal, #00C0C6);
	border-radius: 50%;
	animation: nz-spin .6s linear infinite;
}

.nz-load-more__btn.loading .nz-load-more__spinner {
	display: block;
}

.nz-load-more__btn.loading .nz-load-more__text {
	opacity: .6;
}

@keyframes nz-spin {
	to { transform: rotate(360deg); }
}

.nz-card--entering {
	opacity: 0 !important;
	transform: translateY(24px) !important;
	animation: none !important;
	transition: opacity .5s cubic-bezier(.22, 1, .36, 1), transform .5s cubic-bezier(.22, 1, .36, 1);
}

.nz-card--visible {
	opacity: 1 !important;
	transform: translateY(0) !important;
}

/* ── No results ─────────────────────────────────── */
.nz-no-results {
	text-align: center;
	padding: 100px 20px;
	background: var(--ali-cream, #FAFAF8);
}

.nz-no-results h2 {
	font-family: 'Lora', Georgia, serif;
	font-size: 1.5rem;
	color: var(--ali-navy, #7A4D79);
	margin: 0 0 12px;
}

.nz-no-results p {
	font-family: 'Nunito', system-ui, sans-serif;
	color: var(--ali-text-secondary, #64748B);
	font-size: .92rem;
	margin: 0;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
	.nz-filters__inner {
		gap: 10px;
	}

	.nz-filters__search {
		width: 100%;
		order: -1;
	}

	.nz-filters__sep {
		display: none;
	}

	.nz-featured__grid {
		grid-template-columns: 1fr;
	}

	.nz-featured__hero {
		grid-row: auto;
	}

	.nz-featured__hero .nz-card__body {
		min-height: 340px;
	}

	.nz-articles__grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 520px) {
	.nz-hero {
		padding: 80px 20px 40px;
	}

	.nz-filters {
		padding: 32px 16px 0;
	}

	.nz-filters__pills {
		gap: 5px;
	}

	.nz-filters__pill {
		padding: 5px 12px;
		font-size: .74rem;
	}

	.nz-featured {
		padding: 40px 16px 0;
	}

	.nz-featured__hero .nz-card__body {
		min-height: 280px;
		padding: 28px 20px;
	}

	.nz-featured__hero .nz-card__body h3 {
		font-size: 1.25rem;
	}

	.nz-divider {
		padding: 0 16px;
	}

	.nz-articles {
		padding: 0 16px 64px;
	}

	.nz-articles__grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nz-hero__inner,
	.nz-featured__side,
	.nz-articles__grid .nz-card {
		animation: none;
	}

	.nz-card,
	.nz-card__img img,
	.nz-card--entering {
		transition: none;
	}
}
