.nm-archive-main,
.nm-archive-block {
	overflow-x: clip;
	background: var(--wp--preset--color--studio-white);
	color: var(--wp--preset--color--deep-teal);
}

/* --------------------------------------------------------------------------
   SHARED ARCHIVE HEADER — full-bleed band used by every archive + single CPT
   page (Projects, Model Kits, Downloads, Workshop, single Download/Note).
   -------------------------------------------------------------------------- */

.nm-archive-header {
	border-bottom: 1px solid var(--wp--preset--color--default-border);
	background: var(--wp--preset--color--subtle-surface);
}

.nm-archive-header__inner,
.nm-archive-body__inner {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin-right: auto;
	margin-left: auto;
	padding-right: var(--nm-page-gutter);
	padding-left: var(--nm-page-gutter);
}

.nm-archive-header__inner {
	padding-top: clamp(2.5rem, 5vw, 4.5rem);
	padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

/* Breadcrumb — shared across every archive page (relocated from projects.css
   so it is styled wherever archives.css loads). */
.nm-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	list-style: none;
	margin: 0 0 var(--wp--preset--spacing--30);
	padding: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
	color: var(--wp--preset--color--muted-text);
}

.nm-breadcrumb li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nm-breadcrumb li + li::before {
	content: "/";
	color: var(--wp--preset--color--default-border);
}

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

.nm-breadcrumb a:hover {
	color: var(--wp--preset--color--workshop-teal);
	text-decoration: underline;
}

/* Optional eyebrow with a brass accent line. Projects omits it; the other
   pages set their own text (e.g. "Category 02 · N kits"). */
.nm-archive-header__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	margin: 0 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--workshop-teal);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.nm-archive-header__eyebrow::before {
	content: "";
	width: 1.5rem;
	height: 1px;
	background: var(--wp--preset--color--soft-brass);
}

.nm-archive-header__title {
	max-width: 18ch;
	margin: 0 0 var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: clamp(2.5rem, 5vw, 4.25rem);
	line-height: 0.98;
	color: var(--wp--preset--color--deep-teal);
}

/* A few pages carry a shorter title and read better at 16ch. */
.nm-archive-header--tight .nm-archive-header__title {
	max-width: 16ch;
}

.nm-archive-header__description {
	max-width: 54ch;
	margin: 0;
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.6;
}

.nm-archive-header__view-all {
	margin: var(--wp--preset--spacing--40) 0 0;
}

.nm-archive-header__view-all a {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--workshop-teal);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* --------------------------------------------------------------------------
   SHARED ARCHIVE TOOLBAR — horizontal pill tabs + result count (Model Kits,
   Workshop). Sits in the body, below the header band, on one row.
   -------------------------------------------------------------------------- */

.nm-archive-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
}

.nm-archive-tabs {
	display: flex;
	gap: 0.5rem;
	flex-wrap: nowrap;
	overflow-x: auto;
	margin: 0;
}

.nm-archive-tabs a {
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 13px;
	border: 1px solid var(--wp--preset--color--default-border);
	border-radius: 6px;
	white-space: nowrap;
	font-size: 0.8125rem;
	font-weight: 500;
	background: var(--wp--preset--color--white-surface);
	color: var(--wp--preset--color--muted-text);
	text-decoration: none;
	transition: border-color var(--nm-transition-fast) var(--nm-ease-standard),
		color var(--nm-transition-fast) var(--nm-ease-standard),
		background-color var(--nm-transition-fast) var(--nm-ease-standard);
}

.nm-archive-tabs a:hover {
	border-color: var(--wp--preset--color--deep-teal);
	color: var(--wp--preset--color--deep-teal);
}

.nm-archive-tabs a[aria-current="page"] {
	background: var(--wp--preset--color--deep-teal);
	color: var(--wp--preset--color--studio-white);
	border-color: var(--wp--preset--color--deep-teal);
}

.nm-archive-summary {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
	color: var(--wp--preset--color--muted-text);
	white-space: nowrap;
}

.nm-archive-summary__count {
	color: var(--wp--preset--color--deep-teal);
	font-weight: 500;
}

.nm-archive-body__inner {
	display: grid;
	grid-template-columns: 16.5rem minmax(0, 1fr);
	gap: clamp(1.75rem, 3vw, 3rem);
	align-items: start;
	padding-top: clamp(2rem, 4vw, 3.5rem);
	padding-bottom: clamp(3.5rem, 7vw, 7rem);
}

.nm-archive-filters {
	position: sticky;
	top: calc(var(--nm-header-height) + var(--wp--preset--spacing--50));
}

.nm-archive-filters__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	margin-bottom: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--deep-teal);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nm-archive-filters__clear {
	color: var(--wp--preset--color--signal-red);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.nm-archive-filter-group {
	padding: var(--wp--preset--spacing--40) 0;
	border-top: 1px solid var(--wp--preset--color--default-border);
}

.nm-archive-filter-group__label {
	margin: 0 0 var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--muted-text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nm-archive-filter-group__chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.nm-filter-chip {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 0 13px;
	border: 1px solid var(--wp--preset--color--default-border);
	border-radius: 6px;
	background: var(--wp--preset--color--white-surface);
	color: var(--wp--preset--color--muted-text);
	font-size: 0.8125rem;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	user-select: none;
	transition: background-color var(--nm-transition-fast) var(--nm-ease-standard),
		border-color var(--nm-transition-fast) var(--nm-ease-standard),
		color var(--nm-transition-fast) var(--nm-ease-standard);
}

.nm-filter-chip:hover {
	border-color: var(--wp--preset--color--workshop-teal);
	color: var(--wp--preset--color--deep-teal);
}

.nm-filter-chip:focus-visible {
	outline: 2px solid var(--wp--preset--color--workshop-teal);
	outline-offset: 2px;
}

.nm-filter-chip--active {
	border-color: var(--wp--preset--color--deep-teal);
	background: var(--wp--preset--color--deep-teal);
	color: var(--wp--preset--color--studio-white);
}

.nm-filter-chip--active:hover {
	border-color: var(--wp--preset--color--deep-teal);
	color: var(--wp--preset--color--studio-white);
}

.nm-archive-results__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--60);
}

.nm-archive-results__bar p {
	margin: 0;
	color: var(--wp--preset--color--muted-text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
}

.nm-archive-results__bar span {
	color: var(--wp--preset--color--deep-teal);
	font-weight: 500;
}

.nm-archive-results__bar em {
	font-style: normal;
}

.nm-archive-results__bar em::before {
	content: " / ";
}

.nm-archive-filter-toggle {
	display: none;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	min-height: 42px;
	padding: 0 var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--default-border);
	border-radius: 6px;
	background: var(--wp--preset--color--white-surface);
	color: var(--wp--preset--color--deep-teal);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.nm-archive-filter-toggle span {
	display: inline-grid;
	place-items: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.3125rem;
	border-radius: 999px;
	background: var(--wp--preset--color--signal-red);
	color: var(--wp--preset--color--white-surface);
	font-size: 0.6875rem;
}

.nm-project-grid,
.nm-archive-project-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.75rem 1.5rem;
}

/* Base .nm-project-card* component lives in projects.css (loaded in every
   Project-card context: project archive, single Project, Project taxonomies). */

.nm-download-card__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	margin-bottom: var(--wp--preset--spacing--20);
}

.nm-download-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--50);
}

.nm-download-card {
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--default-border);
	border-radius: var(--nm-radius-media);
	background: var(--wp--preset--color--white-surface);
	color: var(--wp--preset--color--deep-teal);
	text-decoration: none;
	transition: border-color var(--nm-transition-fast) var(--nm-ease-standard);
}

.nm-download-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-bottom: 1px solid var(--wp--preset--color--default-border);
	/* Blueprint treatment: cream paper + faint technical grid. A real photo
	   (.nm-download-card__image) covers this when one is uploaded. Grid line
	   colour stays within the theme palette via color-mix on deep-teal. */
	--nm-download-blueprint-line: color-mix(in srgb, var(--wp--preset--color--deep-teal) 5%, transparent);
	background-color: var(--wp--preset--color--white-surface);
	background-image:
		linear-gradient(var(--nm-download-blueprint-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--nm-download-blueprint-line) 1px, transparent 1px),
		radial-gradient(
			120% 130% at 50% 0%,
			var(--wp--preset--color--studio-white),
			var(--wp--preset--color--subtle-surface)
		);
	background-size: 24px 24px, 24px 24px, 100% 100%;
}

/* Centered technical line-drawing for cards without a photo. */
.nm-download-card__blueprint {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nm-download-card__blueprint-svg {
	width: 55%;
	max-width: 180px;
	height: auto;
}

.nm-download-card__blueprint-ring {
	stroke: var(--wp--preset--color--workshop-teal);
	stroke-width: 1.4;
	opacity: 0.55;
}

.nm-download-card__blueprint-cross {
	stroke: var(--wp--preset--color--soft-brass);
	stroke-width: 1;
	stroke-dasharray: 4 5;
	opacity: 0.85;
}

.nm-download-card__image {
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform var(--nm-transition-base) var(--nm-ease-standard);
}

.nm-download-card__type,
.nm-download-card__free {
	position: absolute;
	top: var(--wp--preset--spacing--30);
	display: inline-flex;
	align-items: center;
	min-height: 1.5rem;
	border-radius: 5px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
	font-weight: 500;
}

.nm-download-card__type {
	left: var(--wp--preset--spacing--30);
	padding: 0 var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--deep-teal);
	color: var(--wp--preset--color--studio-white);
}

.nm-download-card__free {
	right: var(--wp--preset--spacing--30);
	padding: 0 var(--wp--preset--spacing--20);
	border: 1px solid var(--wp--preset--color--default-border);
	background: color-mix(in srgb, var(--wp--preset--color--studio-white) 86%, transparent);
	color: var(--wp--preset--color--workshop-teal);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.nm-download-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: var(--wp--preset--spacing--50);
}

.nm-download-card__version {
	display: inline-flex;
	align-items: center;
	min-height: 1.25rem;
	padding: 0 var(--wp--preset--spacing--20);
	border: 1px solid var(--wp--preset--color--default-border);
	border-radius: 4px;
	background: var(--wp--preset--color--subtle-surface);
	color: var(--wp--preset--color--muted-text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
}

.nm-download-card__size,
.nm-download-card__details {
	color: var(--wp--preset--color--muted-text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
}

.nm-download-card__title {
	margin-bottom: var(--wp--preset--spacing--10);
	font-size: var(--wp--preset--font-size--lead);
	font-weight: 600;
	line-height: 1.25;
}

.nm-download-card__project {
	margin-bottom: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--signal-red);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.nm-download-card__description {
	margin-bottom: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--muted-text);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
}

.nm-download-card__details {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	margin-top: auto;
}

.nm-download-card__details::before {
	content: "";
	width: 0.375rem;
	height: 0.375rem;
	border-radius: 50%;
	background: var(--wp--preset--color--workshop-teal);
}

.nm-download-card__details span + span::before {
	content: "·";
	margin-right: var(--wp--preset--spacing--20);
	opacity: 0.6;
}

.nm-download-card__action {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--default-border);
	color: var(--wp--preset--color--workshop-teal);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.nm-download-card__action span:first-child::after {
	content: " ->";
}

.nm-archive-pagination {
	display: flex;
	justify-content: center;
	margin-top: clamp(2.75rem, 5vw, 3.5rem);
}

.nm-load-more {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	min-height: 3.125rem;
	padding: 0 var(--wp--preset--spacing--60);
	border: 1px solid var(--wp--preset--color--deep-teal);
	border-radius: var(--nm-radius-button);
	background: var(--wp--preset--color--white-surface);
	color: var(--wp--preset--color--deep-teal);
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--nm-transition-fast) var(--nm-ease-standard),
		color var(--nm-transition-fast) var(--nm-ease-standard);
}

.nm-load-more span {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--technical-xs);
	opacity: 0.72;
}

.nm-archive-empty {
	border-style: solid;
	background: var(--wp--preset--color--white-surface);
	text-align: center;
}

.nm-archive-empty__action {
	margin-top: var(--wp--preset--spacing--40);
	text-align: center;
}

.nm-archive-sheet {
	display: none;
}

.nm-archive-sheet[aria-hidden="false"] {
	display: block;
}

.nm-archive-sheet__backdrop {
	position: fixed;
	inset: 0;
	z-index: 70;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 0;
	background: color-mix(in srgb, var(--wp--preset--color--deep-teal) 40%, transparent);
}

.nm-archive-sheet__panel {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 71;
	display: flex;
	flex-direction: column;
	max-height: 82vh;
	border-top-left-radius: 14px;
	border-top-right-radius: 14px;
	background: var(--wp--preset--color--studio-white);
	box-shadow: var(--wp--preset--shadow--subtle-surface);
}

.nm-archive-sheet__header,
.nm-archive-sheet__footer {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border-bottom: 1px solid var(--wp--preset--color--default-border);
}

.nm-archive-sheet__header {
	justify-content: space-between;
	color: var(--wp--preset--color--deep-teal);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--heading-4);
	font-weight: 700;
}

.nm-archive-sheet__header button {
	width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--deep-teal);
	font-size: var(--wp--preset--font-size--heading-4);
}

.nm-archive-sheet__content {
	overflow-y: auto;
	padding: 0 var(--wp--preset--spacing--50);
}

.nm-archive-sheet__footer {
	border-top: 1px solid var(--wp--preset--color--default-border);
	border-bottom: 0;
}

.nm-archive-sheet__clear,
.nm-archive-sheet__show {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	border-radius: var(--nm-radius-button);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
}

.nm-archive-sheet__clear {
	border: 1px solid var(--wp--preset--color--default-border);
	background: var(--wp--preset--color--white-surface);
	color: var(--wp--preset--color--deep-teal);
}

.nm-archive-sheet__show {
	flex: 2;
	border: 0;
	background: var(--wp--preset--color--signal-red);
	color: var(--wp--preset--color--white-surface);
}

@media (hover: hover) {
	/* .nm-project-card hover lives in projects.css alongside the base component. */

	.nm-download-card:hover .nm-download-card__image {
		transform: scale(1.03);
	}

	.nm-download-card:hover {
		border-color: var(--wp--preset--color--workshop-teal);
	}

	.nm-load-more:hover {
		background: var(--wp--preset--color--deep-teal);
		color: var(--wp--preset--color--studio-white);
	}
}

@media (max-width: 960px) {
	.nm-archive-body__inner {
		grid-template-columns: 1fr;
	}

	.nm-archive-filters {
		display: none;
	}

	.nm-archive-filter-toggle {
		display: inline-flex;
	}

	.nm-project-grid,
	.nm-archive-project-grid,
	.nm-download-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.nm-archive-hero h1 {
		font-size: var(--wp--preset--font-size--heading-1);
	}

	.nm-archive-results__bar {
		align-items: flex-start;
	}

	.nm-project-grid,
	.nm-archive-project-grid,
	.nm-download-grid {
		grid-template-columns: 1fr;
	}

	.nm-download-card__body {
		padding: var(--wp--preset--spacing--40);
	}
}
