/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Related articles (Contextual Related Posts)
#   Mirrors the category/archive card style:
#   image (3:2) -> category -> title, mirrored grid + breakpoints.
# Section rubric
# Grid
# Card
# Hover
# Responsive
# Reduced motion
--------------------------------------------------------------*/

/* === gp-builder (managed) === */

/*--------------------------------------------------------------
# Related articles (Contextual Related Posts)
--------------------------------------------------------------*/

.crp_related {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--base-10);
}

/*--------------------------------------------------------------
# Section rubric
--------------------------------------------------------------*/

.crp_related > h2 {
	margin: 0 0 1.5rem;
	font-size: 0.813rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--contrast-30);
}

/*--------------------------------------------------------------
# Grid — mirrors archive cards, sized for the related items
--------------------------------------------------------------*/

.crp_related ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px 24px;
	align-items: start;
}

.crp_related .crp_clear {
	display: none;
}

/*--------------------------------------------------------------
# Card: image -> category -> title (matches archive order)
--------------------------------------------------------------*/

.crp_related ul li {
	position: relative;
	margin: 0;
	padding: 0;
}

.crp_related .crp_link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Image — 3:2 landscape, matches .post-image a */
.crp_related figure {
	margin: 0 0 14px;
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--base-20);
}

.crp_related figure img.crp_thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

/* Category — matches .cat-links a */
.crp_related .crp_primary_term {
	display: block;
	margin-bottom: 8px;
	font-size: 0.688rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--contrast-10);
}

/* Title — matches h2.entry-title (archive-content-title) */
.crp_related .crp_title {
	display: block;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--contrast-10);
}

/*--------------------------------------------------------------
# Hover
--------------------------------------------------------------*/

.crp_related .crp_link:hover figure img.crp_thumb {
	transform: scale(1.04);
}

.crp_related .crp_link:hover .crp_title {
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

/*--------------------------------------------------------------
# Responsive — mirrors archive breakpoints
--------------------------------------------------------------*/

@media (max-width: 900px) {
	.crp_related ul {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px 20px;
	}

	.crp_related .crp_title {
		font-size: 1rem;
		line-height: 1.25;
	}
}

@media (max-width: 480px) {
	.crp_related ul {
		grid-template-columns: 1fr;
		gap: 24px 0;
	}

	.crp_related .crp_title {
		font-size: 0.938rem;
		line-height: 1.3;
	}
}

/*--------------------------------------------------------------
# Reduced motion
--------------------------------------------------------------*/

@media (prefers-reduced-motion: reduce) {
	.crp_related figure img.crp_thumb {
		transition: none;
	}
}

/* === end gp-builder === */
