/**
 * News page.
 *
 * Loaded only on the page with slug "news". Figma frame "News", 1512 wide. Uses
 * the theme design tokens from main.css.
 *
 * 1. Hero
 * 2. Filter bar
 * 3. News grid + cards
 * 4. Responsive
 */

/* -------------------------------------------------------------------------- */
/* 1. Hero                                                                     */
/* -------------------------------------------------------------------------- */

.nhero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: clamp(320px, 24.2vw, 367px); /* header (~90px) + this ≈ the 457 design band */
	padding-block: clamp(48px, 5.29vw, 80px);
	background: var(--c-purple);
	color: var(--c-white);
	isolation: isolate;
}

.nhero__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.nhero__media img,
.nhero__media video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Purple-into-black wash, so the white copy always reads. */
.nhero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgb(102 75 186 / 55%) 0%, rgb(20 12 42 / 80%) 100%);
}

.nhero__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.nhero__crumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: var(--fw-medium);
}

.nhero__crumb {
	color: var(--c-lilac);
	text-decoration: none;
	transition: color var(--duration) var(--ease);
}

.nhero__crumb:hover {
	color: var(--c-white);
}

.nhero__crumb--current {
	color: var(--c-white);
}

.nhero__crumb-sep {
	width: 16px;
	height: 16px;
	color: var(--c-lilac);
}

.nhero__eyebrow {
	margin: 0;
	font-size: clamp(18px, 1.587vw, 24px);
	font-style: italic;
	font-weight: var(--fw-semibold);
	line-height: 1.2;
}

.nhero__title {
	margin: 0;
	font-size: clamp(38px, 4.7619vw, 72px); /* 72 / 1512 */
	font-weight: var(--fw-bold);
	letter-spacing: -0.02em;
	line-height: 1;
	text-transform: uppercase;
	text-wrap: balance;
}

.nhero__subtitle {
	max-width: 720px;
	margin: 0;
	font-size: 18px;
	font-weight: var(--fw-medium);
	line-height: 1.6;
}

/* -------------------------------------------------------------------------- */
/* 2. Filter bar                                                               */
/* -------------------------------------------------------------------------- */

.nbar {
	position: sticky;
	/* Comes to rest under the sticky site header rather than beneath it. */
	top: var(--header-h);
	z-index: 50;
	padding-block: 16px;
	background: var(--c-white);
	border-bottom: 1px solid var(--c-cream);
}

.nbar__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

/* Outline pill by default, solid purple when active. */
.nbar__filter {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	border: 1px solid rgb(51 51 51 / 35%);
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--c-purple);
	font-size: 14px;
	font-weight: var(--fw-semibold);
	line-height: 1.6;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color var(--duration) var(--ease),
		border-color var(--duration) var(--ease),
		color var(--duration) var(--ease);
}

.nbar__filter:hover {
	border-color: var(--c-purple);
}

.nbar__filter.is-active {
	border-color: var(--c-purple);
	background: var(--c-purple);
	color: var(--c-white);
}

/* -------------------------------------------------------------------------- */
/* 3. News grid + cards                                                        */
/* -------------------------------------------------------------------------- */

.nnews {
	padding-block: clamp(48px, 6.35vw, 96px);
	background: var(--c-cream);
}

/* 3 cards of 423px with ~55px gaps across the 1380 column. */
.ngrid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(28px, 3.6vw, 48px) clamp(24px, 3vw, 40px);
	margin: 0;
	padding: 0;
	list-style: none;
	align-items: start;
}

.ncard {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* JS hides a filtered-out card by adding [hidden]; keep it robust. */
.ncard[hidden] {
	display: none;
}

.ncard__media {
	display: block;
	aspect-ratio: 423 / 370;
	overflow: hidden;
	border-radius: 12px;
}

.ncard__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--duration) var(--ease);
}

.ncard__media:hover img {
	transform: scale(1.04);
}

.ncard__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ncard__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: space-between;
	margin: 0;
	font-size: 14px;
	font-weight: var(--fw-medium);
}

.ncard__cat {
	color: var(--c-purple);
}

.ncard__date {
	color: var(--c-charcoal);
}

.ncard__title {
	margin: 0;
	font-size: clamp(20px, 1.587vw, 24px);
	font-weight: var(--fw-semibold);
	line-height: 1.25;
}

.ncard__title a {
	color: var(--c-charcoal);
	text-decoration: none;
}

.ncard__title a:hover {
	color: var(--c-purple);
}

.ncard__more {
	margin-top: 4px;
	color: var(--c-purple);
	font-size: 14px;
	font-weight: var(--fw-semibold);
	text-transform: uppercase;
}

.nnews__empty {
	margin: 0;
	padding-block: 40px;
	color: var(--c-grey);
	font-size: 18px;
	text-align: center;
}

/* -------------------------------------------------------------------------- */
/* 4. Responsive                                                               */
/* -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
	.ngrid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.ngrid {
		grid-template-columns: 1fr;
	}
}
