/**
 * News hub (Posts page) and single news article.
 */

.news-hub,
.news-single {
	--news-hub-accent: var(--amm-palette-primary-1, #005762);
	--news-hub-filter-active: var(--amm-palette-secondary-2, #e6edaa);
	--news-hub-featured-bg: #eef4f8;
	--news-hub-pill-bg: #e3f2fd;
	--news-hub-pill-text: #0d47a1;
	--news-hub-media-radius: 12px;
	--news-hub-row-gap: clamp(2.5rem, 4vw, 4rem);
	--news-hub-column-gap: clamp(2.5rem, 5vw, 4rem);
	/* Card / hero image frame (design spec; ~30% smaller than 588) */
	--news-media-aspect-w: 412;
	--news-media-aspect-h: 315;
}

/* ------------------------------------------------------------------------- */
/* Hub body                                                                  */
/* ------------------------------------------------------------------------- */

.news-hub__body {
	padding: clamp(2rem, 4vw, 3.5rem) 0 clamp(3rem, 5vw, 5rem);
	background: #fff;
}

.news-hub__tag {
	margin: 0 0 0.35rem;
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--news-hub-accent);
}

.news-hub__date {
	margin: 0 0 clamp(1.25rem, 2vw, 1.75rem);
	font-size: 1rem;
	color: var(--amm-text-secondary-color, #757575);
}

.news-hub__read-more {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-top: 1rem;
	font-weight: 700;
	font-size: 0.9375rem;
	color: var(--news-hub-accent);
	text-decoration: none;
}

.news-hub__read-more:hover,
.news-hub__read-more:focus-visible {
	text-decoration: underline;
}

.news-hub__read-more-icon {
	font-weight: 700;
}

/* Featured card */
.news-hub__featured {
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

.news-hub__featured-inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--news-hub-column-gap, clamp(2.5rem, 5vw, 4rem));
	align-items: start;
	padding: clamp(1.5rem, 3vw, 2.5rem);
	background: var(--news-hub-featured-bg);
	border-radius: var(--news-hub-media-radius);
}

@media (min-width: 900px) {
	.news-hub__featured-inner.has-image {
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
	}
}

.news-hub__featured-inner--text-only,
.news-hub__featured-inner--text-only .news-hub__featured-content {
	width: 100%;
	max-width: none;
}

.news-hub__featured-title {
	margin: 0 0 clamp(1.5rem, 2.5vw, 2rem);
	font-family: var(--amm-heading-font, var(--amm-font-sans));
	font-size: clamp(1.5rem, 2.5vw, 2.25rem);
	font-weight: 700;
	line-height: 1.2;
}

.news-hub__featured-title a {
	color: var(--amm-text-primary-color, #1e1e1e);
	text-decoration: none;
}

.news-hub__featured-title a:hover,
.news-hub__featured-title a:focus-visible {
	text-decoration: underline;
}

.news-hub__featured-intro {
	margin: 0;
	font-size: 1.125rem;
	color: var(--amm-text-secondary-color, #757575);
	line-height: 1.55;
}

.news-hub__featured-media,
.news-hub__row-media {
	position: relative;
	width: 100%;
	max-width: calc(var(--news-media-aspect-w) * 1px);
	margin-inline: auto;
	aspect-ratio: var(--news-media-aspect-w) / var(--news-media-aspect-h);
	border-radius: var(--news-hub-media-radius);
	overflow: hidden;
	background: var(--amm-palette-background-secondary, #f2f2f7);
}

.news-hub__featured-img,
.news-hub__row-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.news-hub__featured-media-link,
.news-hub__row-media-link {
	position: absolute;
	inset: 0;
	display: block;
	line-height: 0;
}

.news-hub__media-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	font-size: 0.875rem;
	color: var(--amm-text-secondary-color, #757575);
}

/* Filters */
.news-hub__filters {
	margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.news-hub__filter-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.news-hub__filter-pill {
	display: inline-block;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--amm-text-primary-color, #1e1e1e);
	text-decoration: none;
	border: 1px solid #d9d9d9;
	border-radius: 999px;
	background: #fff;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.news-hub__filter-pill:hover,
.news-hub__filter-pill:focus-visible {
	border-color: var(--news-hub-accent);
}

.news-hub__filter-pill.is-active {
	background: var(--news-hub-filter-active);
	border-color: var(--news-hub-filter-active);
	color: var(--amm-text-primary-color, #1e1e1e);
}

/* List rows */
.news-hub__list {
	display: flex;
	flex-direction: column;
	gap: var(--news-hub-row-gap);
}

.news-hub__row {
	margin: 0;
}

.news-hub__row-inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--news-hub-column-gap, clamp(2.5rem, 5vw, 4rem));
	align-items: start;
}

@media (min-width: 768px) {
	.news-hub__row-inner.has-image {
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
		align-items: start;
	}
}

.news-hub__row-inner--text-only,
.news-hub__row-inner--text-only .news-hub__row-content {
	width: 100%;
	max-width: none;
}

.news-hub__row-title {
	margin: 0 0 clamp(1.5rem, 2.5vw, 2rem);
	font-family: var(--amm-heading-font, var(--amm-font-sans));
	font-size: clamp(1.25rem, 2vw, 1.75rem);
	font-weight: 700;
	line-height: 1.25;
}

.news-hub__row-title a {
	color: var(--amm-text-primary-color, #1e1e1e);
	text-decoration: none;
}

.news-hub__row-title a:hover,
.news-hub__row-title a:focus-visible {
	text-decoration: underline;
}

.news-hub__row-intro {
	margin: 0;
	font-size: 1.125rem;
	color: var(--amm-text-secondary-color, #757575);
	line-height: 1.55;
}

/* Mobile: image above text */
@media (max-width: 767px) {
	.news-hub__row-inner.has-image {
		display: flex;
		flex-direction: column-reverse;
	}
}

.news-hub__load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: clamp(2rem, 4vw, 3rem);
}

.news-hub__load-more {
	padding: 0.75rem 2rem;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	color: var(--amm-palette-primary-3, #fff);
	background: var(--news-hub-accent);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.news-hub__load-more:hover:not(:disabled),
.news-hub__load-more:focus-visible:not(:disabled) {
	opacity: 0.9;
}

.news-hub__load-more:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.news-hub__empty {
	text-align: center;
	padding: clamp(3rem, 8vw, 6rem) 1rem;
}

.news-hub__empty-title {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	font-weight: 700;
}

.news-hub__empty-text {
	margin: 0;
	color: var(--amm-text-secondary-color, #757575);
}

/* ------------------------------------------------------------------------- */
/* Single news                                                               */
/* ------------------------------------------------------------------------- */

.news-single {
	--news-single-column-max: 950px;
	--news-single-hero-max: 1200px;
	--news-single-gutter: var(--amm-site-padding-x, 1rem);
	padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* Center direct children; text 950px, hero 1200px (Figma breakout) */
.site-main.news-single {
	align-items: center;
}

.site-main.news-single > .news-single__inner,
.site-main.news-single > .news-single__featured {
	box-sizing: border-box;
	width: 100%;
	margin-inline: auto;
	padding-inline: var(--news-single-gutter);
	padding-top: 0;
	padding-bottom: 0;
}

.site-main.news-single > .news-single__inner {
	max-width: min(var(--news-single-column-max), 100%);
}

.site-main.news-single > .news-single__inner--head {
	padding-top: clamp(2rem, 4vw, 3rem);
}

.site-main.news-single > .news-single__featured {
	max-width: min(var(--news-single-hero-max), 100%);
	margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.news-single__meta {
	padding-bottom: 1.5rem;
}

.news-single__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin-bottom: 1.25rem;
}

.news-single__category {
	display: inline-block;
	padding: 0.35rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--news-hub-pill-text);
	background: var(--news-hub-pill-bg);
	border-radius: 6px;
}

.news-single__date {
	font-size: 0.875rem;
	color: var(--amm-text-secondary-color, #757575);
}

.news-single__title {
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 1.25rem;
	font-family: var(--amm-heading-font, var(--amm-font-sans));
	font-size: clamp(1.75rem, 3.5vw, 2.75rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--amm-text-primary-color, #1e1e1e);
}

.news-single__share {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.news-single__share a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	color: var(--amm-text-primary-color, #1e1e1e);
	background: #f0f0f0;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.15s ease;
}

.news-single__share a:hover,
.news-single__share a:focus-visible {
	background: #e0e0e0;
}

.news-single__share a img {
	display: block;
	width: 16px;
	height: 16px;
}

.news-single__share svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.news-single__featured {
	overflow: hidden;
	border-radius: var(--news-hub-media-radius);
}

.news-single__featured > img,
.news-single__featured .news-single__featured-img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	object-fit: cover;
	object-position: center;
	border-radius: var(--news-hub-media-radius);
}

.news-single__body {
	margin-bottom: 2rem;
}

/* Keep block content inside the article column (no alignwide/full breakout) */
.news-single__body.entry-content > *,
.news-single__body.entry-content .wp-block-group,
.news-single__body.entry-content .wp-block-columns {
	max-width: 100%;
}

.news-single__body.entry-content .alignwide,
.news-single__body.entry-content .alignfull,
.news-single__body.entry-content [class*="alignwide"],
.news-single__body.entry-content [class*="alignfull"] {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.news-single__body .wp-block-image {
	margin-top: 2rem;
	margin-bottom: 0;
	text-align: center;
}

.news-single__body .wp-block-image img,
.news-single__body .wp-block-html img {
	display: block;
	margin-inline: auto;
	max-width: 100%;
	height: auto;
	border-radius: var(--news-hub-media-radius, 8px);
}

.news-single__body .wp-block-video,
.news-single__body .wp-block-embed,
.news-single__body .wp-block-table,
.news-single__body .embed-responsive,
.news-single__body figure:has(> video),
.news-single__body figure:has(> table),
.news-single__body figure:has(> iframe) {
	margin-top: 2rem;
	margin-bottom: 0;
	text-align: center;
}

.news-single__body .wp-block-video video,
.news-single__body video {
	display: block;
	max-width: 100%;
	margin-inline: auto;
}

/* Core embed blocks (YouTube, etc.) — do not shrink the aspect-ratio wrapper */
.news-single__body .wp-block-embed {
	float: none;
	clear: both;
	width: 100%;
	max-width: 100%;
	margin-inline: auto;
}

.news-single__body .wp-block-embed.alignleft,
.news-single__body .wp-block-embed.alignright {
	float: none;
	margin-inline: auto;
}

.news-single__body .wp-block-embed .wp-block-embed__wrapper {
	width: 100%;
	max-width: 100%;
	margin-inline: auto;
}

.news-single__body .wp-block-embed iframe {
	display: block;
	max-width: 100%;
	margin-inline: auto;
}

/* Bootstrap / legacy .embed-responsive markup (often in Custom HTML blocks) */
.news-single__body .embed-responsive {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	margin-inline: auto;
	padding: 0;
	overflow: hidden;
}

.news-single__body .embed-responsive::before {
	display: block;
	content: "";
}

.news-single__body .embed-responsive-16by9::before,
.news-single__body .embed-responsive.embed-responsive-16by9::before {
	padding-top: 56.25%;
}

.news-single__body .embed-responsive-4by3::before,
.news-single__body .embed-responsive.embed-responsive-4by3::before {
	padding-top: 75%;
}

.news-single__body .embed-responsive-1by1::before,
.news-single__body .embed-responsive.embed-responsive-1by1::before {
	padding-top: 100%;
}

.news-single__body .embed-responsive iframe,
.news-single__body .embed-responsive embed,
.news-single__body .embed-responsive object,
.news-single__body .embed-responsive video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.news-single__body .wp-block-html:has(.embed-responsive),
.news-single__body .wp-block-html:has(iframe) {
	text-align: center;
}

.news-single__body .wp-block-html iframe,
.news-single__body > iframe {
	display: block;
	max-width: 100%;
	margin-inline: auto;
}

.news-single__body .wp-block-table {
	overflow-x: auto;
}

.news-single__body .wp-block-table table,
.news-single__body table {
	max-width: 100%;
	margin-inline: auto;
}

.news-single__nav {
	--news-single-nav-box-width: min(459px, calc(50% - 1rem));
	--news-single-nav-gap: 2rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--news-single-nav-gap);
	width: 100%;
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.news-single__nav-box {
	flex: 1 1 var(--news-single-nav-box-width);
	max-width: var(--news-single-nav-box-width);
	min-width: min(100%, 280px);
	display: block;
	padding: 1.25rem 1rem;
	text-decoration: none;
	color: inherit;
	border: 1px solid #e0e0e0;
	border-radius: var(--news-hub-media-radius);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.news-single__nav-box--prev {
	text-align: left;
}

.news-single__nav-box--prev .news-single__nav-label {
	justify-content: flex-start;
}

.news-single__nav-box--next {
	text-align: right;
}

.news-single__nav-box--next .news-single__nav-label {
	justify-content: flex-end;
}

.news-single__nav-box--next:only-child {
	margin-left: auto;
}

.news-single__nav-box:hover,
.news-single__nav-box:focus-visible {
	border-color: var(--news-hub-accent);
	background: #fafafa;
}

.news-single__nav-label {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0 0 0.35rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--amm-text-secondary-color, #757575);
}

.news-single__nav-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--amm-text-primary-color, #1e1e1e);
}

@media (max-width: 767px) {
	.news-single__nav {
		flex-direction: column;
		max-width: 100%;
		gap: 1rem;
	}

	.news-single__nav-box {
		flex: 1 1 100%;
		width: 100%;
		max-width: 100%;
	}

	.news-single__nav-box--next:only-child {
		margin-left: 0;
	}
}
