/*
 * Blog / News styles — NPM Refinery
 *
 * Covers home.php (3-column archive) and single.php (single post
 * two-column layout + Related Posts sidebar). Same design tokens as
 * npm-single-product.css / npm-all-products.css:
 *   --wp--preset--color--primary     Deep Green  #182B0F
 *   --wp--preset--color--accent      Bronze      #BA9A52
 *   --wp--preset--color--secondary   Gray        #ACAEAF
 *   --wp--preset--color--contrast    Charcoal    #3D3D3C
 *   --wp--preset--color--background  Cream       #EDEDEB
 *   --wp--preset--color--base        White       #FFFFFF
 *   --wp--preset--font-family--heading / --body
 *   --wp--preset--font-size--{small,medium,large,x-large,xx-large}
 *
 * Prev/next nav on the single post reuses single-service.php's markup
 * but gets its own layout below, scoped to .npm-single-post-page so
 * single-service.php's .post-navigation styling stays untouched.
 */

/* =========================================================================
   Archive (home.php) — custom header + 3-column card grid
   ========================================================================= */

.npm-news {
	max-width: var(--wp--style--global--wide-size, 1240px);
	margin: 0 auto;
	padding: 0 1.5rem 4rem;
}

/* Posts page's own block content (heading, intro, banner, etc.), since
   home.php otherwise ignores that Page's content. Falls back to
   .npm-news__title when the Page has no content yet. */
.npm-news__header {
	margin-bottom: 5rem;
}

.npm-news__title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0 0 2rem;
}

.npm-news__empty {
	font-family: var(--wp--preset--font-family--body);
	color: var(--wp--preset--color--contrast);
	text-align: center;
	padding: 3rem 1.5rem;
	border: 1px dashed rgba(23, 38, 17, 0.2);
	border-radius: 6px;
}

.npm-news-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

@media (max-width: 960px) {
	.npm-news-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.npm-news {
		padding: 0 1rem 4rem;;
	}
	.npm-news-grid {
		grid-template-columns: 1fr;
	}
}

.npm-news-card {
	display: block;
	text-decoration: none;
	color: inherit;
	background-color: var(--wp--preset--color--base);
	border: 1px solid rgba(23, 38, 17, 0.12); /* matches .card in style.css */
	border-radius: 6px; /* matches .card in style.css */
	overflow: hidden;
	transition: all ease 0.25s; /* site-wide hover transition */
}

.npm-news-card:hover {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 6px 16px rgba(23, 38, 17, 0.08);
	transform: translateY(-2px);
}

.npm-news-card__image {
	width: 100%;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background-color: var(--wp--preset--color--background);
}

.npm-news-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.npm-news-card__content {
	padding: 1.25rem 1.25rem 1.5rem;
}

.npm-news-card__date {
	display: block;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
	margin-bottom: 0.5rem;
}

.npm-news-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.35;
	margin: 0;
}

.npm-news-card:hover .npm-news-card__title {
	color: var(--wp--preset--color--accent);
}

/* ---- Pagination — same treatment as .npm-all-products__pagination,
   kept as its own rule since the two templates don't share a class. */

.npm-news__pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 2.5rem;
}

.npm-news__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.6rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	border: 1px solid rgba(23, 38, 17, 0.12);
	border-radius: 5px;
	transition: all ease 0.25s;
}

.npm-news__pagination .page-numbers:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

.npm-news__pagination .page-numbers.current {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.npm-news__pagination .page-numbers.dots {
	border-color: transparent;
}

/* =========================================================================
   Single post (single.php) — two-column layout + Related Posts sidebar
   ========================================================================= */

.npm-single-post {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 3rem;
	max-width: var(--wp--style--global--wide-size, 1240px);
	margin: 0 auto;
	padding: 3rem 1.5rem 3rem;
	align-items: start;
}

@media (max-width: 960px) {
	.npm-single-post {
		grid-template-columns: 1fr;
		padding: 2rem 1rem;
		gap: 2.5rem;
	}
}

/* ---- Content column ---- */

.npm-single-post__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.npm-single-post__category {
	display: inline-block;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.3em 0.8em;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: 999px;
	transition: all ease 0.25s;
}

.npm-single-post__category:hover {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.npm-single-post__title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
	margin: 0 0 0.75rem;
}

@media (max-width: 782px) {
	.npm-single-post__title {
		font-size: var(--wp--preset--font-size--large);
	}
}

.npm-single-post__meta {
	margin-bottom: 1.75rem;
}

.npm-single-post__date {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}

.npm-single-post__image {
	margin-bottom: 1.75rem;
}

.npm-single-post__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.npm-single-post__body {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.75;
	color: var(--wp--preset--color--contrast);
}

.npm-single-post__body p {
	margin: 0 0 1.25rem;
}

.npm-single-post__body h2,
.npm-single-post__body h3,
.npm-single-post__body h4 {
	font-family: var(--wp--preset--font-family--heading);
	color: var(--wp--preset--color--primary);
	margin: 2rem 0 1rem;
}

.npm-single-post__body img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}

.npm-single-post__body a {
	color: var(--wp--preset--color--accent);
}

.npm-single-post__body a:hover {
	color: var(--wp--preset--color--primary);
}

/* ---- Related Posts sidebar — sticky, same pattern as .npm-filters
   in npm-all-products.css. */

.npm-related-posts {
	background-color: var(--wp--preset--color--base);
	border: 1px solid rgba(23, 38, 17, 0.12); /* matches .card in style.css */
	border-radius: 6px; /* matches .card in style.css */
	padding: 1.5rem;
	position: sticky;
	top: 1.5rem;
}

.npm-related-posts__title {
	font-family: var(--wp--preset--font-family--heading);
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--medium);
	margin: 0 0 1.25rem;
}

.npm-related-posts__empty {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
	margin: 0;
}

.npm-related-posts__list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.npm-related-posts__item {
	display: flex;
	gap: 0.9rem;
	text-decoration: none;
	color: inherit;
}

.npm-related-posts__image {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 5px;
	background-color: var(--wp--preset--color--background);
}

.npm-related-posts__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.npm-related-posts__content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.npm-related-posts__date {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	color: var(--wp--preset--color--secondary);
}

.npm-related-posts__item-title {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	color: var(--wp--preset--color--primary);
}

.npm-related-posts__item:hover .npm-related-posts__item-title {
	color: var(--wp--preset--color--accent);
}

@media (max-width: 960px) {
	.npm-related-posts {
		position: static;
	}
}

/* ---- Previous / Next navigation — overrides custom.css's shared
   .post-navigation (built for single-service.php) with a two-card
   layout, scoped to .npm-single-post-page so single-service.php's
   look stays untouched. Markup/classes unchanged, only layout. */

.npm-single-post-page .post-navigation {
	max-width: var(--wp--style--global--wide-size, 1240px);
	margin: 0 auto 3rem;
	padding: 0 1.5rem;
}

.npm-single-post-page .post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
	padding-top: 2.5rem;
    border-top: 1px solid rgba(23, 38, 17, 0.12);
}

.npm-single-post-page .post-navigation .nav-previous,
.npm-single-post-page .post-navigation .nav-next {
	min-width: 0;
}

.npm-single-post-page .post-navigation a {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 1.1rem 1.25rem;
	background-color: var(--wp--preset--color--base);
	border: 1px solid rgba(23, 38, 17, 0.12); /* matches .card in style.css */
	border-radius: 6px; /* matches .card in style.css */
	transition: all ease 0.25s; /* site-wide hover transition */
}

.npm-single-post-page .post-navigation a:hover {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 6px 16px rgba(23, 38, 17, 0.08);
}

/* Chevron from rotated borders, same trick as the All Products filter
   checkmark — left for Previous, right for Next. */
.npm-single-post-page .post-navigation a::before {
	content: "";
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border: solid var(--wp--preset--color--accent);
	border-width: 0 2px 2px 0;
}

.npm-single-post-page .post-navigation .nav-previous a::before {
	order: -1;
	transform: rotate(135deg);
}

.npm-single-post-page .post-navigation .nav-next a {
	flex-direction: row-reverse;
}

.npm-single-post-page .post-navigation .nav-next a::before {
	transform: rotate(-45deg);
}

/* "Previous"/"Next" stacked above the title rather than side by side,
   fixing the old single-line layout that clipped the label text. */
.npm-single-post-page .post-navigation .nav-text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	flex: 1 1 auto;
	min-width: 0;
}

.npm-single-post-page .post-navigation .nav-previous .nav-text {
	align-items: flex-start;
	text-align: left;
}

.npm-single-post-page .post-navigation .nav-next .nav-text {
	align-items: flex-end;
	text-align: right;
}

.npm-single-post-page .post-navigation .nav-subtitle {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--secondary, #acaeaf);
}

.npm-single-post-page .post-navigation .nav-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-weight: 700;
	line-height: 1.35;
}

@media (max-width: 640px) {
	.npm-single-post-page .post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.npm-single-post-page .post-navigation .nav-next a {
		flex-direction: row;
	}

	.npm-single-post-page .post-navigation .nav-next a::before {
		order: -1;
		transform: rotate(135deg);
	}

	.npm-single-post-page .post-navigation .nav-next .nav-text {
		align-items: flex-start;
		text-align: left;
	}
}