/* =========================================================================
   Cinematic — global front-end styles
   Mobile-first. Layered cinematic editorial system with light/dark support.
   ========================================================================= */

/* ── Design tokens & semantic aliases ──────────────────────────────────── */

:root {
	--nm-bg:          var(--wp--preset--color--base);
	--nm-surface:     var(--wp--preset--color--surface);
	--nm-dark:        var(--wp--preset--color--dark);
	--nm-text:        var(--wp--preset--color--text);
	--nm-text-muted:  var(--wp--preset--color--text-muted);
	--nm-primary:     var(--wp--preset--color--primary);
	--nm-secondary:   var(--wp--preset--color--secondary);
	--nm-accent:      var(--wp--preset--color--accent);
	--nm-border:      var(--wp--preset--color--border);
	--nm-contrast:    var(--wp--preset--color--contrast);

	--nm-t-base:   0.3s ease;
	--nm-t-slow:   0.6s cubic-bezier(0.22, 1, 0.36, 1);
	--nm-t-spring: 0.45s cubic-bezier(0.22, 1, 0.36, 1);

	--nm-header-h: 72px;
}

/* ── Dark mode overrides ───────────────────────────────────────────────── */

html[data-color-scheme="dark"] {
	/* Flip the WordPress preset variables themselves so every block and inline
	   style that references them (post titles, body copy, captions, etc.) also
	   switches. primary / secondary / accent / dark / contrast stay put. */
	--wp--preset--color--base:       #14151A;
	--wp--preset--color--surface:    #1C1D24;
	--wp--preset--color--text:       #ECE9E4;
	--wp--preset--color--text-muted: #9AA0AB;
	--wp--preset--color--border:     rgba(236, 233, 228, 0.14);

	--nm-bg:         #14151A;
	--nm-surface:    #1C1D24;
	--nm-text:       #ECE9E4;
	--nm-text-muted: #9AA0AB;
	--nm-border:     rgba(236, 233, 228, 0.14);
}

html[data-color-scheme="dark"] body {
	background: var(--nm-bg);
	color: var(--nm-text);
}

/* Map background-bearing sections to the dark tokens */
html[data-color-scheme="dark"] .about-section,
html[data-color-scheme="dark"] .section-related,
html[data-color-scheme="dark"] .archive-header {
	background: var(--nm-surface) !important;
}

html[data-color-scheme="dark"] .section-stories,
html[data-color-scheme="dark"] .editorial-feed,
html[data-color-scheme="dark"] .archive-feed,
html[data-color-scheme="dark"] .article-shell,
html[data-color-scheme="dark"] .post-body,
html[data-color-scheme="dark"] .page-body,
html[data-color-scheme="dark"] .section-pullquote {
	background: var(--nm-bg) !important;
}

/* ── Base ──────────────────────────────────────────────────────────────── */

html {
	scroll-behavior: smooth;
}

body {
	background: var(--nm-bg);
	color: var(--nm-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Sections sit flush — remove the root block-gap between top-level bands
   (fixes the gap under the header on inner heroes and between home sections). */
.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

a {
	transition: color var(--nm-t-base), opacity var(--nm-t-base);
}

:where(a):focus-visible,
:where(button):focus-visible,
:where(input):focus-visible,
:where(.wp-block-button__link):focus-visible {
	outline: 2px solid var(--nm-primary);
	outline-offset: 3px;
}

img {
	max-width: 100%;
	height: auto;
}

/* ── Reading progress bar ──────────────────────────────────────────────── */

.reading-progress-bar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background: transparent;
	z-index: 200;
	pointer-events: none;
}

.reading-progress-bar__fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--nm-primary), var(--nm-accent));
	transition: width 0.1s linear;
}

/* ── Site header ───────────────────────────────────────────────────────── */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--nm-bg) 90%, transparent);
	backdrop-filter: saturate(140%) blur(12px);
	border-bottom: 1px solid var(--nm-border);
	transition: background var(--nm-t-base), border-color var(--nm-t-base), color var(--nm-t-base);
}

/* Transparent header while over a hero (toggled by theme.js) */
.site-header.is-over-hero {
	background: transparent;
	border-bottom-color: transparent;
	color: #fff;
}

.site-header.is-over-hero .site-header__wordmark-main,
.site-header.is-over-hero .site-header__wordmark-subline,
.site-header.is-over-hero .nm-menu__item > a {
	color: #fff;
}

.site-header__brand {
	min-width: 0;
}

.site-header__wordmark {
	display: flex;
	flex-direction: column;
	line-height: 1.05;
	text-decoration: none;
	color: var(--nm-text);
}

.site-header__wordmark-main {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.3rem, 3.5vw, 1.7rem);
	font-weight: 500;
	letter-spacing: -0.01em;
}

.site-header__wordmark-subline {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.66rem;
	font-style: italic;
	letter-spacing: 0.06em;
	color: var(--nm-text-muted);
}

.site-header__right {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
}

/* ── Primary menu ──────────────────────────────────────────────────────── */

.nm-menu {
	position: relative;
}

.nm-menu__list {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 2vw, 2rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.nm-menu__item > a,
.nm-menu__sub-item > a {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--nm-text);
	opacity: 0.85;
}

.nm-menu__item > a:hover,
.nm-menu__item > a:focus-visible,
.nm-menu__sub-item > a:hover,
.nm-menu__sub-item > a:focus-visible {
	opacity: 1;
	color: var(--nm-primary);
}

.nm-menu__has-sub {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.nm-menu__sub-toggle {
	display: none;
	border: 0;
	background: transparent;
	color: inherit;
	opacity: 0.7;
	font-size: 0.95rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.1rem 0.25rem;
}

.nm-menu__sub {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	margin: 0.7rem 0 0;
	padding: 0.5rem 0;
	list-style: none;
	background: var(--nm-bg);
	border: 1px solid var(--nm-border);
	box-shadow: 0 18px 44px rgba(12, 14, 20, 0.16);
	border-radius: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--nm-t-base), transform var(--nm-t-base), visibility var(--nm-t-base);
	z-index: 60;
}

.nm-menu__has-sub:hover .nm-menu__sub,
.nm-menu__has-sub:focus-within .nm-menu__sub,
.nm-menu__has-sub.is-sub-open .nm-menu__sub {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.nm-menu__sub-item > a {
	display: block;
	padding: 0.5rem 1.1rem;
	text-transform: none;
	letter-spacing: 0.02em;
	font-size: 0.82rem;
	opacity: 0.9;
	color: var(--nm-text);
}

.nm-menu__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 38px;
	height: 38px;
	border: 1px solid var(--nm-border);
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
}

.nm-menu__toggle span {
	display: block;
	width: 16px;
	height: 2px;
	margin: 0 auto;
	background: currentColor;
}

/* ── Dark mode toggle: floating action button ──────────────────────────── */

.scheme-toggle {
	position: fixed;
	right: clamp(1rem, 3vw, 1.6rem);
	bottom: clamp(1rem, 3vw, 1.6rem);
	z-index: 150;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid var(--nm-border);
	border-radius: 50%;
	background: var(--nm-bg);
	color: var(--nm-text);
	cursor: pointer;
	opacity: 1;
	box-shadow: 0 10px 30px rgba(12, 18, 24, 0.22);
	transition: transform var(--nm-t-base), border-color var(--nm-t-base), box-shadow var(--nm-t-base);
	flex-shrink: 0;
}

.scheme-toggle:hover {
	transform: translateY(-2px);
	border-color: var(--nm-primary);
	box-shadow: 0 14px 34px rgba(12, 18, 24, 0.28);
}

.scheme-toggle .icon-moon { display: none; }
.scheme-toggle .icon-sun  { display: block; }
html[data-color-scheme="dark"] .scheme-toggle .icon-moon { display: block; }
html[data-color-scheme="dark"] .scheme-toggle .icon-sun  { display: none; }

/* ── Heroes ────────────────────────────────────────────────────────────── */

.wp-site-blocks > .site-hero {
	margin-top: calc(-1 * var(--nm-header-h));
}

/* Pin hero content to the bottom (no inner-container wrapper in markup) and
   keep it above the dim overlay so the CTA links remain clickable. */
.site-hero.wp-block-cover {
	align-items: flex-end;
}

.site-hero__content {
	position: relative;
	z-index: 3;
	width: 100%;
}

/* Inner hero content must render above the dim overlay so the text is not
   faded (the cover overlay is positioned above static content otherwise). */
.posts-hero__content,
.page-hero__content,
.error-hero__content {
	position: relative;
	z-index: 3;
	width: 100%;
	text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}

/* Keep inner heroes flush to the (opaque) header */
.posts-hero,
.page-hero,
.error-hero {
	margin-top: 0;
}

.site-hero .wp-block-cover__inner-container,
.post-hero__cover .wp-block-cover__inner-container,
.page-hero .wp-block-cover__inner-container {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	min-height: inherit;
}

.posts-hero .wp-block-cover__inner-container,
.error-hero .wp-block-cover__inner-container {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: inherit;
}

.posts-hero .wp-block-cover__inner-container {
	align-items: flex-end;
	justify-content: flex-start;
}

.site-hero__scroll {
	position: absolute;
	bottom: 1.6rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
}

.site-hero__scroll-line {
	display: block;
	width: 1px;
	height: 48px;
	background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8));
	animation: nm-scroll-pulse 2.4s ease-in-out infinite;
}

@keyframes nm-scroll-pulse {
	0%, 100% { opacity: 0.2; transform: scaleY(0.6); }
	50%      { opacity: 1;   transform: scaleY(1); }
}

/* ── About section ─────────────────────────────────────────────────────── */

.about-section {
	position: relative;
	overflow: hidden;
}

.about-card {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: clamp(1.8rem, 4vw, 3.6rem);
}

/* Image — kept visually separate from the text column */
.about-card__media {
	margin: 0;
	width: min(280px, 78%);
	flex: 0 0 auto;
}

.about-card__photo {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: 0 24px 60px rgba(15, 20, 26, 0.26);
}

.about-card__content {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 56ch;
}

.about-card__eyebrow {
	margin: 0 0 0.7rem;
	color: var(--nm-primary);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.about-card__title {
	margin: 0 0 1.1rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(2rem, 4.8vw, 3.2rem);
	font-weight: 500;
	line-height: 1.12;
	color: var(--nm-text);
}

.about-card__text p {
	margin: 0 0 1rem;
	color: var(--nm-text-muted);
	font-size: 1.05rem;
	line-height: 1.85;
}

.about-card__text p:last-child { margin-bottom: 0; }

.about-card__text a {
	color: var(--nm-primary);
	text-underline-offset: 0.18em;
}

/* Signature sign-off at the bottom of the text */
.about-card__signature {
	margin: 1.4rem 0 0;
	font-family: 'Caveat', 'Segoe Script', cursive;
	font-size: clamp(2.2rem, 5vw, 3rem);
	font-weight: 600;
	line-height: 1;
	color: var(--nm-primary);
}

/* ── Section labels ────────────────────────────────────────────────────── */

.section-label {
	border-bottom: 1px solid var(--nm-border);
	padding-bottom: var(--wp--preset--spacing--30);
}

/* ── Stories carousel ──────────────────────────────────────────────────── */

.stories-carousel {
	position: relative;
}

.stories-carousel .wp-block-post-template.stories-carousel__track {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--40);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	padding: 0 0 var(--wp--preset--spacing--40);
	margin: 0;
	list-style: none;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.stories-carousel .wp-block-post-template.stories-carousel__track::-webkit-scrollbar {
	display: none;
}

.stories-carousel .wp-block-post-template.stories-carousel__track > li {
	scroll-snap-align: start;
	list-style: none;
	flex: 0 0 auto;
	margin: 0;
	width: min(80vw, 340px);
}

.story-card {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	width: 100%;
	border-radius: 6px;
	background: var(--nm-surface);
	box-shadow: 0 10px 26px rgba(12, 18, 24, 0.16);
	transition: transform var(--nm-t-spring), box-shadow var(--nm-t-base);
}

.story-card__image,
.story-card__image.wp-block-post-featured-image,
.story-card__image a,
.story-card__image img {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--nm-t-slow);
}

.story-card__overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(to top, rgba(9, 12, 16, 0.92) 0%, rgba(9, 12, 16, 0.66) 42%, rgba(9, 12, 16, 0.06) 100%);
}

.story-card__overlay a { pointer-events: auto; }

.story-card__title a {
	color: var(--nm-contrast);
	text-decoration: none;
}

.story-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 34px rgba(12, 18, 24, 0.24);
}

.story-card:hover .story-card__image img { transform: scale(1.06); }

.stories-carousel-dots {
	margin-top: var(--wp--preset--spacing--40);
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.stories-carousel-dots button {
	width: 9px;
	height: 9px;
	border-radius: 999px;
	border: 0;
	padding: 0;
	background: var(--nm-border);
	cursor: pointer;
	transition: background var(--nm-t-base), transform var(--nm-t-base);
}

.stories-carousel-dots button.is-active {
	background: var(--nm-primary);
	transform: scale(1.3);
}

/* ── Homepage gallery carousels ────────────────────────────────────────── */

.home-gallery__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
	padding-bottom: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--60);
	border-bottom: 1px solid var(--nm-border);
}

.home-gallery__eyebrow {
	margin: 0 0 0.5rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--nm-primary);
}

.home-gallery__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.9rem, 4.4vw, 3rem);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--nm-text);
}

.home-gallery__subtitle {
	margin: 0.6rem 0 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--nm-text-muted);
}

.home-gallery__cta {
	flex: 0 0 auto;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--nm-primary);
	white-space: nowrap;
	transition: color var(--nm-t-base);
}

.home-gallery__cta span {
	display: inline-block;
	transition: transform var(--nm-t-base);
}

.home-gallery__cta:hover span { transform: translateX(4px); }

/* Dark band variant (video) needs light typography */
.home-gallery--video .home-gallery__head { border-bottom-color: rgba(255, 255, 255, 0.14); }
.home-gallery--video .home-gallery__eyebrow { color: var(--nm-accent); }
.home-gallery--video .home-gallery__title { color: var(--nm-contrast); }
.home-gallery--video .home-gallery__subtitle { color: rgba(255, 255, 255, 0.6); }
.home-gallery--video .home-gallery__cta { color: var(--nm-accent); }
.home-gallery--video .home-gallery__caption { color: rgba(255, 255, 255, 0.82); }

/* The video band is always dark — keep its cards (and captions) dark in both
   colour schemes so the light caption text never lands on a light surface. */
.home-gallery--video .home-gallery__card { background: #1b1c22; }

.home-gallery__track {
	list-style: none;
	margin: 0;
	padding: 0 0 0.6rem;
	display: flex;
	gap: clamp(0.9rem, 2vw, 1.4rem);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.home-gallery__track::-webkit-scrollbar { display: none; }

.home-gallery__item {
	flex: 0 0 auto;
	width: min(74vw, 300px);
	scroll-snap-align: start;
}

.home-gallery--video .home-gallery__item { width: min(82vw, 380px); }

.home-gallery__card {
	position: relative;
	display: block;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	background: var(--nm-surface);
	box-shadow: 0 12px 30px rgba(12, 18, 24, 0.16);
	transition: transform var(--nm-t-spring), box-shadow var(--nm-t-base);
}

.home-gallery__card:hover,
.home-gallery__card:focus-visible {
	transform: translateY(-5px);
	box-shadow: 0 20px 44px rgba(12, 18, 24, 0.28);
}

.home-gallery__img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	background-size: cover;
	background-position: center;
	background-color: var(--nm-dark);
	transition: transform var(--nm-t-slow);
}

.home-gallery--video .home-gallery__img { aspect-ratio: 16 / 10; }

.home-gallery__card:hover .home-gallery__img { transform: scale(1.06); }

.home-gallery__img.is-noimg {
	background-image: linear-gradient(135deg, var(--nm-primary), var(--nm-secondary));
}

.home-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.55);
	color: #fff;
	pointer-events: none;
	transition: background var(--nm-t-base), transform var(--nm-t-base);
}

.home-gallery__card:hover .home-gallery__play {
	background: var(--nm-primary);
	border-color: var(--nm-primary);
	transform: translate(-50%, -50%) scale(1.08);
}

.home-gallery__caption {
	display: block;
	padding: 0.85rem 0.95rem 1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.82rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.005em;
	color: var(--nm-text);
}

/* ── Editorial feed (posts page) ───────────────────────────────────────── */

.lead-story__image img,
.stream-item__image img,
.related-card__image img {
	border-radius: 6px;
	width: 100%;
	object-fit: cover;
}

.lead-story__title a,
.stream-item .wp-block-post-title a,
.related-card .wp-block-post-title a {
	color: var(--nm-text);
	text-decoration: none;
	transition: color var(--nm-t-base);
}

.lead-story__title a:hover,
.stream-item .wp-block-post-title a:hover,
.related-card .wp-block-post-title a:hover {
	color: var(--nm-primary);
}

.rail-card {
	position: sticky;
	top: calc(var(--nm-header-h) + 1.5rem);
}

.editorial-topics,
.footer-theme-list {
	list-style: none;
	margin: 0.8rem 0 0;
	padding: 0;
}

.editorial-topics li,
.footer-theme-list li {
	margin: 0 0 0.55em;
}

.editorial-topics a {
	color: var(--nm-text-muted);
	text-decoration: none;
	font-size: 0.92rem;
}

.editorial-topics a:hover { color: var(--nm-primary); }

.footer-theme-list a {
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	font-size: 0.92rem;
}

.footer-theme-list a:hover { color: #fff; }

/* "All stories →" dynamic blog link in the section label */
.section-label p { margin: 0; }

.cinematic-blog-textlink {
	color: var(--nm-text-muted);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--sans);
	font-size: clamp(0.85rem, 1.6vw, 1.05rem);
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.cinematic-blog-textlink:hover { color: var(--nm-primary); }

/* ── Single post body ──────────────────────────────────────────────────── */

.post-hero__category a { color: var(--nm-accent); text-decoration: none; }

.post-meta {
	color: var(--nm-text-muted);
}

.is-dark-meta .post-meta,
.post-hero__meta .post-meta {
	color: rgba(255, 255, 255, 0.78);
}

.is-dark-meta .post-meta__author a,
.post-hero__meta .post-meta__author a {
	color: #fff;
	text-decoration: none;
}

.post-meta__dot { opacity: 0.5; }

/* Article shell: main column + "Keep reading" rail */
.article-shell {
	max-width: 1200px;
	margin-inline: auto;
}

.article-main { min-width: 0; }

/* Redesigned article header (replaces the cover hero) */
.article-header {
	position: relative;
	padding-top: var(--wp--preset--spacing--30);
}

.article-header__category a {
	color: var(--nm-primary);
	text-decoration: none;
}

.article-header__title {
	margin-top: 0.5rem;
}

.article-header__meta {
	margin-top: 1.1rem;
	padding-bottom: 1.4rem;
	border-bottom: 1px solid var(--nm-border);
}

/* Inline editorial feature image */
.article-feature img {
	width: 100%;
	object-fit: cover;
	border-radius: 10px;
	box-shadow: 0 26px 60px rgba(15, 20, 26, 0.18);
}

.post-content {
	font-size: clamp(1.06rem, 0.6vw + 0.9rem, 1.18rem);
	line-height: 1.85;
}

.post-content > * { margin-top: 1.6em; }
.post-content > h2 { margin-top: 2.2em; }
.post-content > h3 { margin-top: 1.8em; }

.post-content :where(figure, .wp-block-image) {
	margin-top: 2.4em;
	margin-bottom: 2.4em;
}

.post-content img { border-radius: 6px; }

.post-content blockquote {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-size: 1.3em;
	line-height: 1.5;
	border-left: 3px solid var(--nm-primary);
	padding-left: 1.2em;
}

.post-footer__tags { display: block; }

/* Engagement bar + Appreciate (like) button */
.post-engagement {
	padding: 1.1rem 1.3rem;
	border: 1px solid var(--nm-border);
	border-radius: 12px;
	background: var(--nm-surface);
}

.cinematic-like {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1.05rem;
	border: 1px solid var(--nm-primary);
	border-radius: 999px;
	background: transparent;
	color: var(--nm-primary);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background var(--nm-t-base), color var(--nm-t-base), transform var(--nm-t-base);
}

.cinematic-like:hover { background: rgba(177, 106, 62, 0.1); }
.cinematic-like:active { transform: scale(0.97); }

.cinematic-like__icon {
	display: inline-flex;
	transition: transform var(--nm-t-base);
}

.cinematic-like.is-liked {
	background: var(--nm-primary);
	color: var(--nm-contrast);
	cursor: default;
}

.cinematic-like.is-liked .cinematic-like__icon svg { fill: currentColor; }
.cinematic-like.is-liked .cinematic-like__icon { transform: scale(1.12); }

.cinematic-like__count {
	min-width: 1.2em;
	padding-left: 0.1rem;
	font-variant-numeric: tabular-nums;
}

/* Comments */
.post-comments__title { margin-bottom: 0.4rem; }

.comment-item {
	padding-bottom: 1.4rem;
	border-bottom: 1px solid var(--nm-border);
}

.comment-item__avatar img { border-radius: 999px; }

.comment-item__content {
	margin-top: 0.6rem;
	color: var(--nm-text);
	line-height: 1.7;
}

.post-comments__form input[type="text"],
.post-comments__form input[type="email"],
.post-comments__form input[type="url"],
.post-comments__form textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--nm-border);
	border-radius: 8px;
	background: var(--nm-bg);
	color: var(--nm-text);
	font-family: var(--wp--preset--font-family--body);
}

.post-comments__form .wp-block-button__link,
.post-comments__form .submit {
	border-radius: 999px;
}

/* Prev / next navigation */
.post-nav-prev,
.post-nav-next {
	display: inline-block;
	max-width: 48%;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.85rem;
}

.post-nav-next { text-align: right; margin-left: auto; }

/* ── "Keep reading" rail ───────────────────────────────────────────────── */

.article-rail__label { margin: 0 0 1rem; }

.related-rail__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: row;
	gap: 1.1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 0.5rem;
}

.related-rail__list::-webkit-scrollbar { display: none; }

.related-rail__list > li {
	scroll-snap-align: start;
	flex: 0 0 auto;
	width: min(72vw, 260px);
}

.rail-story__image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 8px;
}

.rail-story .wp-block-post-title { margin-top: 0.3rem; }

.rail-story .wp-block-post-title a {
	color: var(--nm-text);
	text-decoration: none;
	transition: color var(--nm-t-base);
}

.rail-story .wp-block-post-title a:hover { color: var(--nm-primary); }

/* ── Related cards (editorial feed reuse) ──────────────────────────────── */
.related-card .wp-block-post-title {
	margin-top: 0.4rem;
}

/* ── Featured quote (configurable via Theme Settings) ──────────────────── */

.section-pullquote { text-align: center; }

.section-pullquote__text {
	margin: 0;
	color: var(--nm-text);
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.6rem, 4vw, 2.6rem);
	font-weight: 400;
	font-style: italic;
	line-height: 1.4;
}

.section-pullquote__author {
	margin: var(--wp--preset--spacing--40) 0 0;
	color: var(--nm-text-muted);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.78rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ── Media galleries (video + image) ───────────────────────────────────── */

.gallery-page__head {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.gallery-page__title {
	margin-left: auto;
	margin-right: auto;
}

.gallery-page__lede {
	max-width: 56ch;
	margin-left: auto;
	margin-right: auto;
}

.gallery-page__rule {
	display: block;
	width: 64px;
	height: 3px;
	margin: var(--wp--preset--spacing--40) auto 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--nm-primary), var(--nm-accent));
}

.media-gallery {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

.media-gallery__stage { min-width: 0; }

.media-gallery__viewer {
	position: relative;
	width: 100%;
	background: var(--nm-dark);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(15, 20, 26, 0.22);
}

.media-gallery__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
}

.media-gallery__frame iframe,
.media-gallery__frame video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.media-gallery--image .media-gallery__viewer { background: var(--nm-dark); }

.media-gallery__image {
	display: block;
	width: 100%;
	max-height: 74vh;
	object-fit: contain;
	background: var(--nm-dark);
}

.media-gallery__caption {
	margin: 1rem 0 0;
	color: var(--nm-text-muted);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.92rem;
	font-weight: 500;
	letter-spacing: 0.005em;
	line-height: 1.5;
	min-height: 1.2em;
}

.media-gallery__empty {
	color: var(--nm-text-muted);
	font-style: italic;
}

/* Thumbnail rail — horizontal scroller on mobile / portrait (default) */
.media-gallery__rail {
	list-style: none;
	margin: 0;
	padding: 0 0 0.5rem;
	display: flex;
	flex-direction: row;
	gap: 0.85rem;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.media-gallery__rail::-webkit-scrollbar { display: none; }

.media-gallery__item {
	flex: 0 0 auto;
	width: min(60vw, 220px);
	scroll-snap-align: start;
}

.media-thumb {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid var(--nm-border);
	border-radius: 9px;
	background: var(--nm-surface);
	color: var(--nm-text);
	cursor: pointer;
	overflow: hidden;
	text-align: left;
	transition: border-color var(--nm-t-base), transform var(--nm-t-base), box-shadow var(--nm-t-base);
}

.media-thumb:hover { transform: translateY(-2px); }

.media-thumb.is-active {
	border-color: var(--nm-primary);
	box-shadow: 0 0 0 2px var(--nm-primary);
}

.media-thumb__img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
	background-color: var(--nm-dark);
}

.media-thumb__img.is-noimg {
	background-image: linear-gradient(135deg, var(--nm-primary), var(--nm-secondary));
}

.media-gallery--image .media-thumb__img { aspect-ratio: 4 / 3; }

.media-thumb__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	pointer-events: none;
}

.media-gallery--image .media-thumb__play { display: none; }

.media-thumb__title {
	display: block;
	padding: 0.55rem 0.65rem 0.7rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.76rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.005em;
	color: var(--nm-text-muted);
}

/* ── Gallery pagination ────────────────────────────────────────────────── */

.media-pagination {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin-top: 1.6rem;
}

.media-pagination__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 0.85rem;
	border: 1px solid var(--nm-border);
	border-radius: 8px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--nm-text);
	text-decoration: none;
	transition: border-color var(--nm-t-base), background var(--nm-t-base), color var(--nm-t-base);
}

.media-pagination__link:hover {
	border-color: var(--nm-primary);
	color: var(--nm-primary);
}

.media-pagination__link.is-current {
	background: var(--nm-primary);
	border-color: var(--nm-primary);
	color: #fff;
}

/* ── Blog topics (reusable horizontal scroller) ────────────────────────── */

.blog-topics__head {
	margin-bottom: 1.4rem;
}

.blog-topics__eyebrow {
	margin: 0 0 0.35rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--nm-primary);
}

.blog-topics__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.6rem, 3.6vw, 2.4rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.015em;
	color: var(--nm-text);
}

.blog-topics__track {
	list-style: none;
	margin: 0;
	padding: 0 0 0.5rem;
	display: flex;
	gap: 0.9rem;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.blog-topics__track::-webkit-scrollbar { display: none; }

.blog-topics__item {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.topic-card {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.3rem;
	width: min(60vw, 220px);
	min-height: 116px;
	padding: 1.1rem 1.2rem;
	border: 1px solid var(--nm-border);
	border-radius: 12px;
	background:
		linear-gradient(150deg, color-mix(in srgb, var(--nm-primary) 10%, transparent), transparent 70%),
		var(--nm-bg);
	text-decoration: none;
	transition: transform var(--nm-t-spring), border-color var(--nm-t-base), box-shadow var(--nm-t-base);
}

.topic-card:hover,
.topic-card:focus-visible {
	transform: translateY(-4px);
	border-color: var(--nm-primary);
	box-shadow: 0 14px 32px rgba(12, 18, 24, 0.14);
}

.topic-card__name {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.18rem;
	font-weight: 500;
	line-height: 1.2;
	color: var(--nm-text);
}

.topic-card__count {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--nm-text-muted);
}

/* Category-image cards: image background + dark scrim for legible white text */
.topic-card--has-image {
	position: relative;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-color: transparent;
	overflow: hidden;
	isolation: isolate;
}

.topic-card--has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(8, 10, 14, 0.82) 0%, rgba(8, 10, 14, 0.45) 45%, rgba(8, 10, 14, 0.2) 100%);
}

.topic-card--has-image .topic-card__name { color: #fff; }
.topic-card--has-image .topic-card__count { color: rgba(255, 255, 255, 0.82); }

.topic-card--has-image:hover,
.topic-card--has-image:focus-visible {
	border-color: var(--nm-primary);
}

/* Footer/dark-band variant */
.blog-topics--footer .topic-card {
	width: min(54vw, 190px);
	min-height: 96px;
}

/* ── Search field ──────────────────────────────────────────────────────── */

.cinematic-search .wp-block-search__inside-wrapper {
	border: 1px solid var(--nm-border);
	border-radius: 999px;
	overflow: hidden;
	background: var(--nm-bg);
}

.cinematic-search--dark .wp-block-search__inside-wrapper {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.3);
}

.cinematic-search--dark input,
.cinematic-search--dark input::placeholder {
	color: #fff;
}

/* ── Pagination ────────────────────────────────────────────────────────── */

.editorial-pagination {
	margin-top: var(--wp--preset--spacing--70);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--nm-border);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.85rem;
}

.editorial-pagination a { color: var(--nm-text-muted); text-decoration: none; }
.editorial-pagination a:hover { color: var(--nm-primary); }
.editorial-pagination .current { color: var(--nm-primary); font-weight: 600; }

/* ── Fade-in on scroll (set by theme.js) ───────────────────────────────── */

.nm-fade-in {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.nm-fade-in.is-visible {
	opacity: 1;
	transform: none;
}

/* ── Hide default Sample Page nav items ────────────────────────────────── */

.site-header .wp-block-navigation-item__content[href*="sample-page"],
.site-footer .wp-block-navigation-item__content[href*="sample-page"] {
	display: none !important;
}

/* =========================================================================
   Responsive — mobile-first scale-ups
   ========================================================================= */

/* Small tablets / large phones: 2 cards */
@media (min-width: 640px) {
	.stories-carousel .wp-block-post-template.stories-carousel__track > li {
		width: calc((100% - var(--wp--preset--spacing--40)) / 2);
	}
}

/* Tablet landscape: 3 cards, About becomes side-by-side */
@media (min-width: 900px) {
	.nm-menu__toggle,
	.nm-menu__sub-toggle { display: none; }

	.about-card {
		flex-direction: row;
		align-items: center;
		text-align: left;
	}

	.about-card__media {
		width: clamp(240px, 32%, 340px);
	}

	.about-card__content { max-width: none; }

	.stories-carousel .wp-block-post-template.stories-carousel__track > li {
		width: calc((100% - (var(--wp--preset--spacing--40) * 2)) / 3);
	}
}

/* Desktop: 5 cards across */
@media (min-width: 1200px) {
	.stories-carousel .wp-block-post-template.stories-carousel__track > li {
		width: calc((100% - (var(--wp--preset--spacing--40) * 4)) / 5);
	}
}

/* Desktop + iPad landscape: post becomes main column + sticky "Keep reading" rail */
@media (min-width: 1024px) {
	.article-shell {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: clamp(2.5rem, 4vw, 4.5rem);
		align-items: start;
	}

	.article-main { margin-inline: 0; }

	.article-rail {
		position: sticky;
		top: calc(var(--nm-header-h) + 1.5rem);
		padding-left: 1.8rem;
		border-left: 1px solid var(--nm-border);
	}

	/* Rail stacks vertically on the side */
	.related-rail__list {
		flex-direction: column;
		overflow: visible;
		gap: 1.6rem;
		scroll-snap-type: none;
	}

	.related-rail__list > li { width: 100%; }

	/* Galleries: viewer + thumbnail rail on the right */
	.media-gallery {
		grid-template-columns: minmax(0, 1fr) clamp(260px, 26vw, 340px);
		gap: 1.8rem;
		align-items: start;
	}

	.media-gallery__rail {
		flex-direction: column;
		flex-wrap: nowrap;
		overflow-x: visible;
		overflow-y: auto;
		max-height: 80vh;
		gap: 0.9rem;
		padding: 0 0.4rem 0 0;
		scroll-snap-type: none;
	}

	.media-gallery__item { width: 100%; }
}

/* ── Mobile-only: nav collapses to a panel ─────────────────────────────── */

@media (max-width: 899px) {
	.nm-menu__toggle { display: flex; }

	/* Keep the open menu panel legible over the hero (don't inherit white) */
	.site-header.is-over-hero .nm-menu.is-open .nm-menu__item > a,
	.site-header.is-over-hero .nm-menu.is-open .nm-menu__sub-item > a,
	.site-header.is-over-hero .nm-menu.is-open .nm-menu__sub-toggle {
		color: var(--nm-text);
	}

	.nm-menu__list {
		position: absolute;
		top: calc(100% + 0.8rem);
		right: 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.35rem;
		min-width: 230px;
		padding: 0.9rem 1.1rem;
		background: var(--nm-bg);
		border: 1px solid var(--nm-border);
		border-radius: 12px;
		box-shadow: 0 18px 44px rgba(12, 18, 24, 0.18);
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity var(--nm-t-base), transform var(--nm-t-base), visibility var(--nm-t-base);
		z-index: 80;
	}

	.nm-menu.is-open .nm-menu__list {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.nm-menu__item > a,
	.nm-menu__sub-item > a {
		color: var(--nm-text);
	}

	/* Each top-level row fills the panel width so the +/- target is reachable */
	.nm-menu__list > .nm-menu__item { width: 100%; }

	.nm-menu__has-sub {
		width: 100%;
		justify-content: space-between;
		gap: 0;
		flex-wrap: wrap;
	}

	.nm-menu__has-sub > a {
		flex: 1 1 auto;
		padding: 0.7rem 0;
	}

	/* Large, easy-to-tap expander */
	.nm-menu__sub-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		font-size: 1.4rem;
		opacity: 0.8;
		border-radius: 8px;
	}

	.nm-menu__sub-toggle:hover,
	.nm-menu__sub-toggle:focus-visible {
		opacity: 1;
		background: rgba(127, 127, 127, 0.12);
	}

	.nm-menu__sub {
		position: static;
		display: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		margin: 0.2rem 0 0.4rem 0.6rem;
		padding: 0;
		min-width: 0;
		width: 100%;
		background: transparent;
	}

	.nm-menu__has-sub.is-sub-open .nm-menu__sub { display: block; }

	/* Stack editorial columns */
	.editorial-feed__layout,
	.stream-item {
		flex-direction: column !important;
	}

	.editorial-feed__layout > .wp-block-column,
	.stream-item > .wp-block-column {
		flex-basis: 100% !important;
	}

	.rail-card { position: static; }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.site-hero__scroll-line { animation: none; }
}

/* ── Dark mode for the WP admin bar ────────────────────────────────────── */

html[data-color-scheme="dark"] #wpadminbar {
	background: #15161B;
}
