/* ==========================================================================
   HD Custom Dev — News & Thought Leadership module
   Loads only on the /news page (.hd-news-page) and single posts
   (.hd-news-single). Never affects Home / Mountain West.
   ========================================================================== */

/* --- Filter bar --- */
.hd-news-page #hd-news-filterbar {
	position: sticky;
	top: 90px;
	z-index: 20;
	background: rgba(250, 248, 244, 0.94);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border-radius: 16px;
	padding: 18px 22px;
	box-shadow: 0 8px 24px rgba(47, 52, 55, 0.08);
	transition: padding 0.25s ease, box-shadow 0.25s ease;
}
.hd-news-page #hd-news-filterbar.hd-news-stuck {
	padding: 10px 22px;
	box-shadow: 0 10px 28px rgba(47, 52, 55, 0.16);
}
.hd-news-page .hd-news-pills br,
.hd-news-page .hd-news-controls br { display: none; } /* wpautop artifact */
.hd-news-page .hd-news-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.hd-news-page .hd-news-pill {
	padding: 7px 18px;
	font-family: 'Inter', sans-serif;
	font-size: 13px; font-weight: 600;
	letter-spacing: 0.5px;
	color: #2f3437;
	background: transparent;
	border: 2px solid rgba(47, 52, 55, 0.25);
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.25s ease-in-out;
}
.hd-news-page .hd-news-pill:hover,
.hd-news-page .hd-news-pill:focus {
	border-color: #b85c38; color: #b85c38; outline: none;
}
.hd-news-page .hd-news-pill.active {
	background: #b85c38; border-color: #b85c38; color: #ffffff;
}
.hd-news-page .hd-news-controls {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	flex-wrap: wrap;
}
.hd-news-page #hd-news-filterbar.hd-news-stuck .hd-news-controls { margin-top: 8px; }
.hd-news-page #hd-news-search {
	flex: 1 1 220px;
	padding: 10px 16px;
	font-family: 'Inter', sans-serif;
	font-size: 15px;
	color: #2f3437;
	background: #ffffff;
	border: 1px solid rgba(47, 52, 55, 0.2);
	border-radius: 10px;
}
.hd-news-page #hd-news-search:focus {
	outline: none;
	border-color: #b85c38;
	box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.15);
}
.hd-news-page #hd-news-sort {
	padding: 10px 14px;
	font-family: 'Inter', sans-serif;
	font-size: 15px;
	color: #2f3437;
	background: #ffffff;
	border: 1px solid rgba(47, 52, 55, 0.2);
	border-radius: 10px;
	cursor: pointer;
}

/* --- Featured story --- */
.hd-news-page #hd-news-featured .hd-news-card--featured {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	background: #ffffff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(47, 52, 55, 0.08);
}
.hd-news-page .hd-news-card--featured .hd-news-card-media {
	min-height: 340px;
}
.hd-news-page .hd-news-card--featured .hd-news-card-body {
	padding: 40px 44px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.hd-news-page .hd-news-card--featured .hd-news-card-title {
	font-size: 30px;
	line-height: 1.3;
}
.hd-news-page .hd-news-featured-flag {
	position: absolute;
	top: 18px; left: 18px;
	padding: 5px 14px;
	font-family: 'Montserrat', sans-serif;
	font-size: 12px; font-weight: 700;
	letter-spacing: 1.5px; text-transform: uppercase;
	color: #ffffff;
	background: #b85c38;
	border-radius: 999px;
}

/* --- Grid + cards --- */
.hd-news-page #hd-news-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 28px;
	transition: opacity 0.25s ease;
}
.hd-news-page #hd-news-grid.hd-news-grid--fading { opacity: 0.25; }

.hd-news-page .hd-news-cell--in {
	animation: hd-news-in 0.45s ease both;
}
@keyframes hd-news-in {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: none; }
}

.hd-news-page .hd-news-card {
	background: #ffffff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(47, 52, 55, 0.08);
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hd-news-page .hd-news-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 32px rgba(47, 52, 55, 0.14);
}
.hd-news-page .hd-news-card-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background-color: #2f3437;
	background-size: cover;
	background-position: center;
}
.hd-news-page .hd-news-card-media[data-noimg]::after {
	content: 'SOLID EARTH';
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	font-family: 'Montserrat', sans-serif;
	font-size: 15px; font-weight: 700; letter-spacing: 3px;
	color: rgba(255, 255, 255, 0.35);
}
.hd-news-page .hd-news-via {
	position: absolute;
	bottom: 12px; right: 12px;
	padding: 4px 12px;
	font-family: 'Inter', sans-serif;
	font-size: 12px; font-weight: 600;
	color: #ffffff;
	background: rgba(15, 17, 21, 0.75);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	backdrop-filter: blur(3px);
}
.hd-news-page .hd-news-card-body {
	padding: 24px 26px 26px;
	display: flex;
	flex-direction: column;
	flex: 1;
}
.hd-news-page .hd-news-card-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}
.hd-news-page .hd-news-chip {
	padding: 4px 12px;
	font-family: 'Inter', sans-serif;
	font-size: 12px; font-weight: 600;
	letter-spacing: 1px; text-transform: uppercase;
	color: #b85c38;
	background: rgba(184, 92, 56, 0.1);
	border-radius: 999px;
}
.hd-news-page .hd-news-card-meta time {
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	color: #555a5e;
}
.hd-news-page .hd-news-card-title {
	font-family: 'Montserrat', sans-serif;
	font-size: 20px; font-weight: 700;
	line-height: 1.35;
	margin: 0 0 10px;
}
.hd-news-page .hd-news-card-title a {
	color: #2f3437;
	text-decoration: none;
	transition: color 0.2s ease;
}
.hd-news-page .hd-news-card-title a:hover { color: #b85c38; }
.hd-news-page .hd-news-card-excerpt {
	font-family: 'Inter', sans-serif;
	font-size: 15px; line-height: 1.65;
	color: #555a5e;
	margin: 0 0 16px;
}
.hd-news-page .hd-news-card-read {
	margin-top: auto;
	font-family: 'Inter', sans-serif;
	font-size: 14px; font-weight: 600;
	letter-spacing: 0.5px;
	color: #b85c38;
	text-decoration: none;
}
.hd-news-page .hd-news-card-read:hover { color: #914324; }

/* --- Load more + status --- */
.hd-news-page #hd-news-status {
	text-align: center;
	font-family: 'Inter', sans-serif;
	color: #555a5e;
	min-height: 24px;
	margin-top: 20px;
}
.hd-news-page #hd-news-more {
	display: inline-block;
	margin-top: 10px;
	padding: 14px 42px;
	font-family: 'Montserrat', sans-serif;
	font-size: 14px; font-weight: 700;
	letter-spacing: 1.5px; text-transform: uppercase;
	color: #2f3437;
	background: transparent;
	border: 2px solid #2f3437;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.25s ease-in-out;
}
.hd-news-page #hd-news-more:hover,
.hd-news-page #hd-news-more:focus {
	background: #2f3437;
	color: #ffffff;
	outline: none;
}
.hd-news-page #hd-news-more:disabled { opacity: 0.5; cursor: wait; }

/* --- Single post: attribution + backlink --- */
.hd-news-single .hd-news-attribution {
	margin: 0 0 28px;
	padding: 18px 22px;
	font-family: 'Inter', sans-serif;
	font-size: 15px; line-height: 1.6;
	color: #2f3437;
	background: rgba(184, 92, 56, 0.08);
	border-left: 4px solid #b85c38;
	border-radius: 0 12px 12px 0;
}
.hd-news-single .hd-news-via-chip {
	display: inline-block;
	margin-right: 8px;
	padding: 3px 12px;
	font-size: 12px; font-weight: 600;
	color: #ffffff;
	background: #b85c38;
	border-radius: 999px;
}
.hd-news-single .hd-news-attribution a { color: #b85c38; font-weight: 600; }
.hd-news-single .hd-news-backlink {
	margin-top: 40px;
	font-family: 'Inter', sans-serif;
}
.hd-news-single .hd-news-backlink a {
	color: #b85c38;
	font-weight: 600;
	text-decoration: none;
}

/* --- Mobile --- */
@media (max-width: 900px) {
	.hd-news-page #hd-news-featured .hd-news-card--featured {
		grid-template-columns: 1fr;
	}
	/* aspect-ratio + min-height fight each other here: a definite 220px
	   height makes the browser derive width = 220 x 16/9 = 391px, which
	   overflows the 330px card. Drop the ratio on mobile and let the
	   fixed height + background-size:cover do the work. */
	.hd-news-page .hd-news-card--featured .hd-news-card-media {
		aspect-ratio: auto;
		height: 220px;
		min-height: 0;
		width: 100%;
	}
	.hd-news-page .hd-news-card--featured .hd-news-card-body { padding: 26px 24px; }
	.hd-news-page .hd-news-card--featured .hd-news-card-title { font-size: 24px; }
	.hd-news-page #hd-news-filterbar { top: 70px; }
}

/* --- Featured card: prevent grid blowout on narrow screens ---
   Grid items default to min-width:auto, so they refuse to shrink below
   their content's intrinsic minimum. On the featured card the media has
   aspect-ratio 16/9 plus min-height 220px, which computes to a
   220 x 16/9 = 391px minimum width. That sized the whole column, and
   because .hd-news-card--featured has overflow:hidden the body inherited
   the 391px width and had its text sliced off mid-word inside a 330px
   card ("Why We Put a 3D Model in..." lost the final words).

   min-width:0 lets the column shrink to the card; the media then honours
   min-height and fills via background-size:cover, so nothing is cropped
   that shouldn't be. Applied at all widths - the same blowout can occur
   on the two-column desktop layout at narrow window sizes. */
.hd-news-page #hd-news-featured .hd-news-card--featured > * {
	min-width: 0;
}

/* Long unbroken strings (URLs in excerpts, long product names) should
   wrap rather than push the column wider. */
.hd-news-page .hd-news-card-title,
.hd-news-page .hd-news-card-excerpt {
	overflow-wrap: break-word;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
	.hd-news-page .hd-news-cell--in { animation: none !important; }
	.hd-news-page .hd-news-card,
	.hd-news-page #hd-news-grid,
	.hd-news-page .hd-news-pill,
	.hd-news-page #hd-news-filterbar { transition: none !important; }
}
