/*
 * News & Blog hub (template-news-blog.php).
 * Enqueued only on that page by inc/theme-news-blog.php.
 * Mobile first: single column with the red rail on the left,
 * from 768px a date column on the left of the rail.
 */
.nb-section {
	--nb-red: #da291c;        /* 4.87:1 on white, 4.57:1 on the news tint (AA) */
	--nb-red-dark: #b02016;
	--nb-text: #484848;
	--nb-rule: rgba(0, 0, 0, 0.15);
	--nb-hover: #f5f5f5;
	--nb-news-bg: #fef6f5;    /* light brand tint behind News & Awards rows */
	--nb-date-w: 0px;
	--nb-rail: 3px;
}

/* ---- Hero -------------------------------------------------------------
 * Same half-width column and position as every other hero. The theme sizes
 * (96/80/70/60px) are too big for the word "INSIGHTS" in that column on
 * phones, small tablets and 992px+ screens, so only those ranges are scaled
 * to the column width (~10% headroom). Words never split mid-word. */
#hero.nb-hero h1 {
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
}
@media (max-width: 575.98px) {
	#hero.nb-hero h1 { font-size: clamp(26px, calc(16.6vw - 26px), 60px); }
}
@media (min-width: 576px) and (max-width: 767.98px) {
	#hero.nb-hero h1 { font-size: clamp(56px, calc(16.6vw - 30px), 70px); }
}
@media (min-width: 992px) {
	#hero.nb-hero h1 { font-size: clamp(42px, calc(8.3vw - 39px), 80px); }
}

.nb-container { max-width: 1000px; }

.nb-intro {
	max-width: 720px;
	margin: 0 auto 2rem;
	text-align: center;
	font-size: 18px;
	line-height: 1.6;
	color: var(--nb-text);
}

/* ---- Filters --------------------------------------------------------- */
.nb-filters ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}
.nb-filters a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 8px 18px;
	border: 2px solid #000;
	color: #000;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nb-filters a:hover { background: #f2f2f2; color: #000; }
.nb-filters a[aria-current="page"] { background: var(--nb-red); border-color: var(--nb-red); color: #fff; }
.nb-filters a:focus-visible,
.nb-year-toggle:focus-visible,
.nb-panel-link:focus-visible,
.nb-readmore a:focus-visible {
	outline: 3px solid #000;
	outline-offset: 3px;
}

/* ---- Year accordion -------------------------------------------------- */
.nb-year-heading {
	margin: 0;
	font-size: inherit;
	line-height: 1;
	text-transform: none;
}
.nb-year-toggle {                 /* also has the theme's .year-display (red block) */
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 22px 0 10px;
	padding: 3px 10px;
	border: 0;
	border-radius: 0;
	font-family: inherit;
	font-size: 32px;
	cursor: default;              /* inert until JavaScript enhances it */
}
.nb-year-toggle .nb-icon { display: none; width: 0.7em; height: 0.7em; transition: transform 0.2s ease; }
.nb-timeline.is-enhanced .nb-year-toggle { cursor: pointer; transition: background-color 0.2s ease; }
.nb-timeline.is-enhanced .nb-year-toggle:hover { background: var(--nb-red-dark); }
.nb-timeline.is-enhanced .nb-year-toggle .nb-icon { display: block; }
.nb-year-toggle[aria-expanded="true"] .nb-icon { transform: rotate(180deg); }

.nb-panel-more { margin: 0 0 1rem; }
.nb-panel-link { font-weight: 700; }
.nb-panel.is-loading { min-height: 60px; opacity: 0.6; }

/* ---- Timeline -------------------------------------------------------- */
.nb-list {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}
.nb-list::before {               /* the red rail */
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--nb-date-w);
	width: var(--nb-rail);
	background: var(--nb-red);
	z-index: 1;                  /* stays visible over row backgrounds */
}
.nb-item {
	position: relative;
	padding-left: 20px;
}
.nb-item::before {               /* dot on the rail: hollow = Blog, solid = News & Awards */
	content: "";
	position: absolute;
	top: 26px;
	left: calc(var(--nb-date-w) - 6px);
	width: 15px;
	height: 15px;
	border: 3px solid var(--nb-red);
	border-radius: 50%;
	background: #fff;
	z-index: 2;
}
.nb-item--news::before { background: var(--nb-red); }
.nb-entry {
	position: relative;
	padding: 18px 12px;
	border-bottom: 1px solid var(--nb-rule);
}
.nb-item:last-child .nb-entry { border-bottom: 0; }

.nb-date {
	margin-bottom: 6px;
	font-size: 16px;
	font-weight: 700;
	color: #000;
}
.nb-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}
.nb-label--blog { color: var(--nb-red); }

/* ---- Blog card (clickable) ------------------------------------------- */
.nb-card { transition: background-color 0.2s ease; }
.nb-card-inner {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.nb-thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.nb-title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: none;
}
.nb-title a { color: #000; }
.nb-link::after {                /* stretches the title link over the whole entry */
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.nb-link:focus { outline: none; }
.nb-link:focus-visible::after { outline: 3px solid #000; outline-offset: -3px; }
.nb-excerpt {
	margin: 0 0 10px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--nb-text);
}
.nb-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	color: var(--nb-red);
}
.nb-cta svg { transition: transform 0.2s ease; }
.nb-card:hover { background: var(--nb-hover); }
.nb-card:hover .nb-title a { color: var(--nb-red); text-decoration: underline; }
.nb-card:hover .nb-cta svg { transform: translateX(4px); }

/* ---- News & Awards (stands out: tinted band, solid dot, red pill) ----- */
.nb-item--news .nb-entry { background: var(--nb-news-bg); }
.nb-label--news {
	padding: 5px 10px 5px 8px;
	background: var(--nb-red);
	color: #fff;
}
.nb-label--news { gap: 7px; }
.nb-label--news .nb-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nb-content {
	font-size: 16px;
	line-height: 1.715;
	color: #333;
}
.nb-content img,
.nb-content iframe,
.nb-content video { max-width: 100%; height: auto; }
.nb-content > :last-child { margin-bottom: 0; }
.nb-readmore { margin-top: 12px; }
.nb-empty { text-align: center; padding: 2rem 0; }

/* ---- Breakpoints ----------------------------------------------------- */
@media (min-width: 576px) {
	.nb-card-inner { flex-direction: row; align-items: flex-start; }
	.nb-thumb { flex: 0 0 38%; max-width: 240px; }
	.nb-text { flex: 1; min-width: 0; }
}

@media (min-width: 768px) {
	.nb-section { --nb-date-w: 170px; }
	.nb-item { padding-left: 0; }
	.nb-entry {
		display: grid;
		grid-template-columns: var(--nb-date-w) minmax(0, 1fr);
		padding: 0;
	}
	.nb-date {
		margin: 0;
		padding: 22px 24px 22px 0;
		font-size: 18px;
		font-weight: 400;
		text-align: right;
	}
	.nb-body { padding: 20px 16px 22px 32px; }
	.nb-year-heading {
		width: var(--nb-date-w);
		padding-right: 12px;
		text-align: right;
	}
	.nb-panel-more { margin-left: calc(var(--nb-date-w) + 32px); }
}

@media (min-width: 992px) {
	.nb-section { --nb-date-w: 220px; }
	.nb-date { font-size: 20px; }
	.nb-title { font-size: 22px; }
	.nb-year-toggle { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
	.nb-filters a,
	.nb-card,
	.nb-cta svg,
	.nb-year-toggle,
	.nb-year-toggle .nb-icon { transition: none; }
	.nb-card:hover .nb-cta svg { transform: none; }
}

@media (forced-colors: active) {
	.nb-list::before { background: CanvasText; }
	.nb-item::before { border-color: CanvasText; }
	.nb-item--news::before { background: CanvasText; }
	.nb-label--news { border: 1px solid CanvasText; }
}
