/* ============================================================
   Article Cards section ("Support & advice" blog teaser)
   Design ref: designs/Recovery Stories.png y4050-4950.
   Cream band, centred intro, 4-up card row (image / title / text
   / Read More) with a caramel bottom-bar hover, centred dark
   "View All Articles" button. Tablet 2-up, mobile stacked.
   ============================================================ */

.article-cards {
	background: var(--color-cream-light);
	padding-block: var(--section-padding);
}

/* ---- Intro ---- */

.article-cards__intro {
	text-align: center;
	max-width: 40rem;
	margin: 0 auto var(--space-xl);
}

.article-cards__heading {
	margin-bottom: 0;
}

/* ---- Cards: mobile scroll-snap carousel (card + peek), thin scrollbar track ---- */

.article-cards__grid {
	display: flex;
	gap: var(--space-md);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: var(--space-sm);
	scrollbar-width: thin;
	scrollbar-color: var(--color-teal-dark) var(--color-grey);
}

.article-cards__grid::-webkit-scrollbar {
	height: 2px;
}

.article-cards__grid::-webkit-scrollbar-track {
	background: var(--color-grey);
}

.article-cards__grid::-webkit-scrollbar-thumb {
	background: var(--color-teal-dark);
}

/* ---- Card ---- */

/* 15px of padding measured off the design's hovered card: the image sits
   inset from the card edge, so the hover shadow frames the card rather than
   hugging the photo. Without it the picture runs to the very edge and the
   card reads as cramped (Miles, 2026-07-21). The bottom is deeper to seat the
   caramel bar below the text. */
.article-cards__card {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 0 0 76%;
	scroll-snap-align: start;
	padding: 0.9375rem 0.9375rem 1.5rem;
	background: var(--color-cream-light);
	border-radius: var(--radius-xs);
	transition: box-shadow 0.3s ease;
}

/* Caramel bottom bar - grows in on hover/focus (per the design's hovered card) */
.article-cards__card::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--color-accent);
	border-radius: 0 0 var(--radius-xs) var(--radius-xs);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.4s ease;
}

.article-cards__card:hover,
.article-cards__card:focus-within {
	box-shadow: 0 8px 24px rgb(0 31 38 / 0.1);
}

.article-cards__card:hover::after,
.article-cards__card:focus-within::after {
	transform: scaleX(1);
}

.article-cards__media {
	margin-bottom: var(--space-md);
}

.article-cards__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--radius-xs);
}

.article-cards__image--placeholder {
	aspect-ratio: 1;
	background: var(--color-image-underlay);
}

.article-cards__title {
	margin-bottom: var(--space-sm);
	padding-inline: 0.125rem;
	font-family: var(--font-heading);
	font-size: 1.125rem;
	line-height: 1.3;
	color: var(--color-heading);
}

.article-cards__text {
	margin-bottom: var(--space-md);
	padding-inline: 0.125rem;
	font-size: 1rem;
	color: var(--color-text-muted);
	line-height: 1.6;
}

/* ---- Read More link (fade-underline + caramel arrow pattern) ---- */

.article-cards__more {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: auto;
	padding-inline: 0.125rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--color-teal-dark);
}

.article-cards__more-label {
	position: relative;
}

.article-cards__more-label::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 1px;
	height: 1.5px;
	background: currentColor;
	opacity: 0;
	transition: opacity 0.45s ease;
}

.article-cards__more:hover .article-cards__more-label::after,
.article-cards__more:focus-visible .article-cards__more-label::after {
	opacity: 1;
}

.article-cards__arrow {
	transition: transform 0.3s ease, color 0.3s ease;
}

.article-cards__arrow svg {
	display: block;
	width: 17px;
	height: 12px;
}

.article-cards__more:hover .article-cards__arrow,
.article-cards__more:focus-visible .article-cards__arrow,
.article-cards__card:hover .article-cards__arrow {
	color: var(--color-caramel-light);
	transform: translateX(3px);
}

/* ---- Button (design omits it on mobile - carousel relies on swipe) ---- */

.article-cards__actions {
	display: none;
	margin-top: var(--space-xl);
	justify-content: center;
}

/* ---- Tablet: 2-up grid (carousel off) ----
   The column gap is deliberately small: each card already carries 15px of
   padding, so the gap the eye sees between two photos is gap + 30px. See the
   desktop note below. */

@media (min-width: 768px) {
	.article-cards__grid {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-lg) 1.125rem;
		overflow-x: visible;
		scroll-snap-type: none;
		padding-bottom: 0;
	}

	.article-cards__actions {
		display: flex;
	}
}

/* ---- Desktop: 4-up ----
   18px between CARDS = 48px between PHOTOS once the 15px card padding is
   counted, which is exactly what both designs draw (Recovery Stories.png and
   Blog Post.png: 257px photos, 47-48px apart, first photo 15px inside the
   container). The gap used to be 3rem, set before the card padding existed;
   adding the padding without shrinking the gap left a 78px gutter and
   squeezed the photos to 234px, which made the cards tall and narrow. */

@media (min-width: 1024px) {
	.article-cards__grid {
		grid-template-columns: repeat(4, 1fr);
		gap: var(--space-lg) 1.125rem;
	}
}
