/* =========================================================================
   NHC Post Grid  (also used by Selected Posts)
   Blog cards styled to match the site's WP Grid Builder article cards:
   rounded corners, hover lift (scale + shadow), a category pill and a Lora
   title over a bottom gradient.
   ========================================================================= */

.nhc-pg {
	margin: 0;
}

.nhc-pg__heading {
	font-family: 'Lora', Georgia, serif;
	font-size: 34px;
	line-height: 1.25;
	color: #4e4e4e;
	margin: 0 0 24px;
}

/* ---------- Grid ---------- */
.nhc-pg__grid {
	display: grid;
	gap: 16px;
}
.nhc-pg--cols-2 { grid-template-columns: repeat(2, 1fr); }
.nhc-pg--cols-3 { grid-template-columns: repeat(3, 1fr); }
.nhc-pg--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Card ---------- */
.nhc-pg__card {
	position: relative;
	overflow: hidden;
	border-radius: 5px;
	background: #e0e4e9;
	transition: transform 200ms linear, box-shadow 200ms linear;
	will-change: transform;
}
.nhc-pg__card:hover,
.nhc-pg__card:focus-within {
	box-shadow: 0 20px 20px -10px rgba(0, 0, 0, 0.3);
	transform: scale(1.01);
}

.nhc-pg__link {
	display: block;
	position: relative;
	text-decoration: none;
	color: #ffffff;
}

.nhc-pg__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;                 /* default; a ratio class below overrides it */
	line-height: 0;
}
.nhc-pg--r-1-1  .nhc-pg__media { aspect-ratio: 1 / 1; }
.nhc-pg--r-4-3  .nhc-pg__media { aspect-ratio: 4 / 3; }
.nhc-pg--r-3-2  .nhc-pg__media { aspect-ratio: 3 / 2; }
.nhc-pg--r-3-4  .nhc-pg__media { aspect-ratio: 3 / 4; }
.nhc-pg--r-4-5  .nhc-pg__media { aspect-ratio: 4 / 5; }
.nhc-pg--r-16-9 .nhc-pg__media { aspect-ratio: 16 / 9; }

.nhc-pg__img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
.nhc-pg__img--placeholder {
	background: linear-gradient(135deg, #cfd6d8, #e6ebec);
}

/* ---------- Overlaid text (bottom gradient) ---------- */
.nhc-pg__overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 2rem;
	font-size: 16px;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0, transparent 88%);
}

/* Category pill */
.nhc-pg__cat {
	width: max-content;
	max-width: 100%;
	margin: 0;
	padding: .5rem .75rem;
	border-radius: 10px;
	background: #cce8eb;
	color: #4e4e4e;
	font-family: 'Lato', 'Open Sans', sans-serif;
	font-weight: 700;
	font-size: .8em;
	line-height: 1.4;
}

/* Title */
.nhc-pg__title {
	margin: 0;
	padding: 0;
	font-family: 'Lora', Georgia, serif;
	font-weight: 400;
	font-size: 1.5em;
	line-height: 1.2;
	color: #ffffff;
}

.nhc-pg__empty {
	color: #777777;
	font-style: italic;
}

/* ---------- Responsive ---------- */
@media only screen and (max-width: 999px) {
	.nhc-pg--cols-3,
	.nhc-pg--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media only screen and (max-width: 690px) {
	.nhc-pg__heading { font-size: 28px; }
	.nhc-pg__overlay { padding: 1.5rem; }

	/* Swipeable horizontal slider on phones */
	.nhc-pg__grid {
		display: flex;
		grid-template-columns: none;
		gap: 14px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding-bottom: 6px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;              /* Firefox */
	}
	.nhc-pg__grid::-webkit-scrollbar { display: none; } /* WebKit */
	.nhc-pg__card {
		flex: 0 0 85%;                      /* one card + a peek of the next */
		scroll-snap-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nhc-pg__card { transition: none; }
	.nhc-pg__card:hover,
	.nhc-pg__card:focus-within { transform: none; }
}
