/**
 * /new-home prototype homepage. Loaded only on page-new-home.php
 * (see inc/new-home-helpers.php) -- cannot affect any other page.
 *
 * Mobile-first. Brand colors pulled from the site's own Customizer values
 * (theme_mods_zeen-child): navy #00306e, gold #fbe610, link blue #0000ff.
 */

/* Defensive: guarantee normal page scrolling on this template regardless
   of any parent-theme/plugin script that locks html/body overflow for a
   preloader, modal, or scroll-effect this page doesn't use. */
html:has(body.nh-body),
body.nh-body {
	overflow-y: auto !important;
	height: auto !important;
	position: static !important;
}

:root {
	--nh-navy: #00306e;
	--nh-navy-dark: #001f47;
	--nh-gold: #fbe610;
	--nh-ink: #1a1a1a;
	--nh-body: #4b5563;
	--nh-line: #e5e7eb;
	--nh-bg: #f7f8fa;
	--nh-surface: #fff;
	--nh-radius: 10px;
	--nh-gap: 20px;
}

[data-theme="dark"] {
	--nh-ink: #e5e7eb;
	--nh-body: #9ca3af;
	--nh-line: #2a2f3a;
	--nh-bg: #0f1218;
	--nh-surface: #171b23;
}

@media (prefers-reduced-motion: no-preference) {
	.nh,
	.nh-masthead,
	.nh-card,
	.nh-hero__lead,
	.nh-nav,
	.nh-trending {
		transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	}
}

.nh,
.nh-masthead,
.nh-footer {
	background-color: var(--nh-bg);
	color: var(--nh-ink);
}

.nh {
	background-color: var(--nh-bg) !important;
}

.nh *,
.nh *::before,
.nh *::after,
.nh-masthead *,
.nh-masthead *::before,
.nh-masthead *::after,
.nh-footer *,
.nh-footer *::before,
.nh-footer *::after {
	box-sizing: border-box;
}

.nh-masthead a,
.nh-footer a {
	text-decoration: none;
	color: inherit;
}

.nh-masthead img,
.nh-footer img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ---------- Custom masthead (header) ---------- */

/* ---------- Reading progress bar ---------- */

.nh-progress {
	position: sticky;
	top: 0;
	z-index: 41;
	height: 3px;
	background: transparent;
}

.nh-progress__bar {
	display: block;
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--nh-navy), var(--nh-gold));
}

@media (prefers-reduced-motion: no-preference) {
	.nh-progress__bar {
		transition: width 0.1s linear;
	}
}

.nh-masthead {
	background-color: var(--nh-surface) !important;
	border-bottom: 1px solid var(--nh-line);
	position: sticky;
	top: 3px;
	z-index: 40;
	transition: box-shadow 0.2s ease;
}

.nh-masthead.is-scrolled {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Prevent background scroll while the mobile nav panel is open */
body.nh-nav-open {
	overflow: hidden !important;
}

.nh-masthead__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 12px;
	padding-bottom: 12px;
}

.nh-masthead__logo img {
	display: block;
	height: 32px;
	width: auto;
}

.nh-masthead__controls {
	display: flex;
	align-items: center;
	gap: 10px;
}

.nh-theme-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex: 0 0 auto;
	padding: 0;
	background: none;
	border: 1px solid var(--nh-line);
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.05rem;
	line-height: 1;
	color: var(--nh-ink);
}

.nh-theme-toggle__icon--moon {
	display: none;
}

[data-theme="dark"] .nh-theme-toggle__icon--sun {
	display: none;
}

[data-theme="dark"] .nh-theme-toggle__icon--moon {
	display: inline;
}

.nh-nav-toggle {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 38px;
	height: 38px;
	padding: 0;
	background: none;
	border: 1px solid var(--nh-line);
	border-radius: 6px;
	cursor: pointer;
}

.nh-nav-toggle__bar {
	display: block;
	width: 18px;
	height: 2px;
	margin: 0 auto;
	background: var(--nh-navy);
}

.nh-nav {
	position: fixed;
	top: 64px;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 39;
	background-color: var(--nh-surface) !important;
	padding: 16px;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.25s ease;
}

.nh-nav.is-open {
	transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
	.nh-nav {
		transition: none;
	}
}

.nh-nav ul {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.nh-nav li {
	border-bottom: 1px solid var(--nh-line);
}

.nh-nav a {
	display: block;
	padding: 14px 4px;
	font-size: 0.95rem;
	font-weight: 600;
}

.nh-nav a:hover,
.nh-nav a:focus-visible {
	color: var(--nh-navy);
}

.nh-search {
	display: flex;
	border: 1px solid var(--nh-line);
	border-radius: 8px;
	overflow: hidden;
}

.nh-search input {
	flex: 1;
	min-width: 0;
	border: none;
	padding: 10px 12px;
	font-size: 0.9rem;
}

.nh-search input:focus {
	outline: none;
}

.nh-search button {
	border: none;
	background: var(--nh-navy);
	color: #fff;
	padding: 0 16px;
	cursor: pointer;
	font-size: 1rem;
}

/* ---------- Custom footer ---------- */

.nh-footer {
	background-color: #0b0e14 !important;
	color: rgba(255, 255, 255, 0.85);
	margin-top: 8px;
}

.nh-footer__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
	padding: 40px 16px 24px;
}

.nh-footer__col h3 {
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 0 0 12px;
}

.nh-footer__col--brand p {
	font-size: 0.85rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.6);
	margin: 12px 0 0;
}

.nh-footer__logo {
	height: 28px;
	width: auto;
	filter: brightness(0) invert(1);
}

.nh-footer__col ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nh-footer__col li {
	margin-bottom: 8px;
}

.nh-footer__col a {
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.75);
}

.nh-footer__col a:hover,
.nh-footer__col a:focus-visible {
	color: var(--nh-gold);
}

.nh-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding: 16px;
}

.nh-footer__bottom p {
	margin: 0;
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.5);
}

.nh__inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 16px;
}

.nh a {
	text-decoration: none;
	color: inherit;
}

.nh img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ---------- Breaking news strip ---------- */

.nh-breaking {
	background: #0b0e14;
	color: #fff;
	overflow: hidden;
}

.nh-breaking__inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 16px;
	display: flex;
	align-items: stretch;
}

.nh-breaking__label {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 10px 14px 10px 0;
	border-right: 1px solid rgba(255, 255, 255, 0.2);
	margin-right: 14px;
	white-space: nowrap;
}

.nh-breaking__track-wrap {
	flex: 1;
	overflow: hidden;
	min-width: 0;
}

.nh-breaking__track {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	width: max-content;
	animation: nh-scroll 90s linear infinite;
}

.nh-breaking__track-wrap:hover .nh-breaking__track,
.nh-breaking__track-wrap:focus-within .nh-breaking__track {
	animation-play-state: paused;
}

.nh-breaking__track li {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 28px 10px 0;
	font-size: 0.85rem;
	white-space: nowrap;
}

.nh-breaking__track a {
	color: #fff;
	font-weight: 600;
}

.nh-breaking__track a:hover,
.nh-breaking__track a:focus-visible {
	text-decoration: underline;
}

.nh-breaking__time {
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.75rem;
	flex: 0 0 auto;
}

@keyframes nh-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.nh-breaking__track {
		animation: none;
	}
	.nh-breaking__track-wrap {
		overflow-x: auto;
	}
}

/* ---------- Live/pulse indicator ---------- */

.nh-pulse {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	position: relative;
	flex: 0 0 auto;
}

.nh-pulse::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: inherit;
	animation: nh-pulse-ring 1.8s ease-out infinite;
}

.nh-pulse--live {
	background: #ef4444;
}

@keyframes nh-pulse-ring {
	0% {
		transform: scale(1);
		opacity: 0.6;
	}
	100% {
		transform: scale(2.4);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nh-pulse::after {
		animation: none;
	}
}

.nh-card__new {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #16a34a;
}

/* ---------- Section scaffolding ---------- */

.nh-section {
	padding: 32px 0;
}

.nh-section + .nh-section {
	border-top: 1px solid var(--nh-line);
}

.nh-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.nh-section__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--nh-navy);
	margin: 0;
	padding-left: 12px;
	border-left: 4px solid var(--nh-gold);
}

.nh-section__all {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--nh-navy);
	white-space: nowrap;
}

.nh-section__all:hover,
.nh-section__all:focus-visible {
	text-decoration: underline;
}

/* ---------- Hero ---------- */

.nh-hero-wrap {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--nh-gap);
}

.nh-hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--nh-gap);
	min-width: 0;
}

/* ---------- Trending Now rail ---------- */

.nh-trending {
	background-color: var(--nh-surface) !important;
	color: var(--nh-ink);
	border: 1px solid var(--nh-line);
	border-radius: var(--nh-radius);
	padding: 18px 18px 6px;
}

.nh-trending__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--nh-navy);
	margin: 0 0 14px;
}

.nh-trending__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nh-trending__list li {
	display: flex;
	gap: 12px;
	align-items: baseline;
	padding: 12px 0;
	border-top: 1px solid var(--nh-line);
}

.nh-trending__rank {
	flex: 0 0 auto;
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--nh-line);
	font-variant-numeric: tabular-nums;
}

.nh-trending__link {
	display: block;
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--nh-ink);
	margin-bottom: 4px;
}

.nh-trending__link:hover,
.nh-trending__link:focus-visible {
	color: var(--nh-navy);
}

.nh-trending__time {
	font-size: 0.72rem;
	color: #9ca3af;
}

.nh-hero__lead {
	background-color: var(--nh-surface) !important;
	border-radius: var(--nh-radius);
	overflow: hidden;
	border: 1px solid var(--nh-line);
}

.nh-hero__lead .nh-card__media {
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.nh-hero__lead .nh-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nh-hero__lead .nh-card__body {
	padding: 18px 20px 20px;
}

.nh-hero__lead .nh-card__cat {
	font-size: 0.78rem;
	font-weight: 800;
	color: var(--nh-cat-color, #dc2626);
	margin-bottom: 8px;
}

.nh-hero__lead .nh-card__title {
	font-size: 1.85rem;
	line-height: 1.22;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.nh-hero__side {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--nh-gap);
}

.nh-hero__side .nh-card {
	background-color: var(--nh-surface) !important;
	border-radius: var(--nh-radius);
	border: 1px solid var(--nh-line);
	overflow: hidden;
}

.nh-hero__side .nh-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.nh-hero__side .nh-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nh-hero__side .nh-card__body {
	padding: 12px 14px;
}

.nh-hero__side .nh-card__title {
	font-size: 0.92rem;
	line-height: 1.35;
}

/* ---------- Card grid (category sections) ---------- */

.nh-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--nh-gap);
}

.nh-card {
	background-color: var(--nh-surface) !important;
	border: 1px solid var(--nh-line);
	border-radius: var(--nh-radius);
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
	.nh-card {
		transition: none;
	}
}

.nh-card:hover,
.nh-card:focus-within {
	box-shadow: 0 6px 20px rgba(0, 48, 110, 0.12);
	transform: translateY(-2px);
}

.nh-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--nh-line);
	overflow: hidden;
}

.nh-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nh-card__img--placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #eef1f5, #e2e6ec);
}

.nh-card__body {
	padding: 14px 16px 16px;
}

.nh-card__cat {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--nh-cat-color, var(--nh-navy));
	margin-bottom: 6px;
}

.nh-card__byline {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.76rem;
	color: var(--nh-body);
	margin: 0 0 8px;
}

.nh-card__author {
	font-weight: 600;
}

.nh-card__dot {
	color: var(--nh-line);
}

.nh-card__cat:hover,
.nh-card__cat:focus-visible {
	text-decoration: underline;
}

.nh-card__title {
	font-size: 1.02rem;
	line-height: 1.32;
	margin: 0 0 8px;
	font-weight: 700;
	letter-spacing: -0.005em;
}

.nh-card__title a:hover,
.nh-card__title a:focus-visible {
	color: var(--nh-navy);
}

.nh-card__excerpt {
	font-size: 0.85rem;
	color: var(--nh-body);
	margin: 0 0 8px;
	line-height: 1.5;
}

.nh-card__meta {
	display: flex;
	align-items: center;
	gap: 6px;
}

.nh-card__date {
	display: block;
	font-size: 0.75rem;
	color: #9ca3af;
}

/* ---------- Latest News list ---------- */

.nh-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.nh-list__item {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--nh-line);
}

.nh-list__item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.nh-list__thumb {
	flex: 0 0 88px;
	width: 88px;
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	overflow: hidden;
	background: var(--nh-line);
}

.nh-list__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nh-list__body {
	flex: 1;
	min-width: 0;
}

.nh-list__cat {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--nh-navy);
}

.nh-list__title {
	font-size: 0.92rem;
	line-height: 1.4;
	margin: 2px 0 4px;
	font-weight: 600;
}

.nh-list__title a:hover,
.nh-list__title a:focus-visible {
	color: var(--nh-navy);
}

.nh-list__meta {
	display: flex;
	align-items: center;
	gap: 6px;
}

.nh-list__date {
	font-size: 0.75rem;
	color: #9ca3af;
}

/* ---------- Learn to Trade teaser ---------- */

.nh-teaser {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--nh-gap);
}

.nh-teaser .nh-card__body {
	padding: 12px 14px;
}

.nh-teaser .nh-card__title {
	font-size: 0.9rem;
}

/* ---------- Ad slot ---------- */

.nh-ad {
	display: flex;
	justify-content: center;
}

/* ---------- Scroll-reveal ---------- */

.nh-reveal {
	opacity: 0;
	transform: translateY(16px);
}

.nh-reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: no-preference) {
	.nh-reveal {
		transition: opacity 0.5s ease, transform 0.5s ease;
	}
}

/* ---------- Card image hover zoom ---------- */

.nh-card__media {
	position: relative;
}

.nh-card__img {
	transition: transform 0.35s ease;
}

@media (hover: hover) {
	.nh-card:hover .nh-card__img,
	.nh-card:focus-within .nh-card__img {
		transform: scale(1.05);
	}
}

@media (prefers-reduced-motion: reduce) {
	.nh-card__img {
		transition: none;
	}
}

/* ---------- Back to top ---------- */

.nh-to-top {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 45;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background-color: var(--nh-navy) !important;
	color: #fff;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
}

.nh-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (prefers-reduced-motion: no-preference) {
	.nh-to-top {
		transition: opacity 0.2s ease, transform 0.2s ease;
	}
}

.nh-to-top:hover,
.nh-to-top:focus-visible {
	background-color: var(--nh-navy-dark) !important;
}

/* ---------- Focus visibility (accessibility) ---------- */

.nh a:focus-visible,
.nh-masthead a:focus-visible,
.nh-to-top:focus-visible {
	outline: 2px solid var(--nh-navy);
	outline-offset: 2px;
}

.nh-footer a:focus-visible {
	outline: 2px solid var(--nh-gold);
	outline-offset: 2px;
}

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

@media (min-width: 600px) {
	.nh-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.nh-hero__side {
		grid-template-columns: repeat(2, 1fr);
	}

	.nh-teaser {
		grid-template-columns: repeat(3, 1fr);
	}

	.nh-list__thumb {
		flex-basis: 110px;
		width: 110px;
	}

	.nh-footer__inner {
		grid-template-columns: 1.4fr 1fr 1fr;
	}
}

@media (min-width: 992px) {
	.nh-hero-wrap {
		grid-template-columns: 2.4fr 1fr;
		align-items: start;
	}

	.nh-hero {
		grid-template-columns: 1.6fr 1fr;
	}

	.nh-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.nh-section__title {
		font-size: 1.5rem;
	}

	/* Masthead switches from a mobile slide-in panel to an inline bar */
	.nh-nav-toggle {
		display: none;
	}

	.nh-nav {
		position: static;
		transform: none;
		background: none;
		padding: 0;
		overflow: visible;
		display: flex;
		align-items: center;
		gap: 24px;
	}

	.nh-nav ul {
		display: flex;
		align-items: center;
		gap: 20px;
		margin: 0;
	}

	.nh-nav li {
		border-bottom: none;
	}

	.nh-nav a {
		padding: 6px 0;
		font-size: 0.88rem;
	}

	.nh-search {
		width: 200px;
	}
}
