/*
 * "Related content" block under single posts (see includes/rst-related-posts.php).
 *
 * Card geometry deliberately matches the Blog/News archive grid in
 * rst-post-grid.css -- same 16px radius, border, shadow and hover lift -- so a
 * reader arriving from the archive sees the same card they just clicked.
 */

.rst-related {
	margin: 56px 0 0;
	padding: 40px 0 0;
	border-top: 1px solid var(--rst-line);
	clear: both;
}

.rst-related__heading {
	margin: 0 0 24px;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
	color: var(--rst-navy);
	letter-spacing: -.01em;
}

.rst-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rst-related__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rst-related__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid rgba(30, 31, 75, 0.08);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(71, 95, 107, 0.08);
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}

.rst-related__card:hover,
.rst-related__card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px rgba(71, 95, 107, 0.14);
	text-decoration: none;
}

.rst-related__card:focus-visible {
	outline: 2px solid var(--rst-blue);
	outline-offset: 3px;
}

/* Letterboxed, not cropped -- the same treatment the archive grid gives these
   images. Most featured images here are diagrams, charts and screenshots, and
   a cover-crop cuts the part that carries the meaning. The fixed height still
   keeps the three cards' text baselines aligned. */
.rst-related__media {
	display: block;
	height: 170px;
	overflow: hidden;
	background: var(--rst-bg);
	line-height: 0;
}

.rst-related__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 14px;
	display: block;
	box-sizing: border-box;
}

.rst-related__media--empty {
	background: linear-gradient(135deg, var(--rst-bg) 0%, #eceffa 100%);
}

.rst-related__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 20px;
}

.rst-related__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-family: var(--rst-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--rst-slate);
}

.rst-related__cat {
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(35, 95, 232, 0.08);
	color: var(--rst-blue);
	letter-spacing: .08em;
}

.rst-related__title {
	display: block;
	font-size: 17px;
	line-height: 1.32;
	font-weight: 700;
	color: var(--rst-navy);
}

.rst-related__card:hover .rst-related__title {
	color: var(--rst-blue);
}

.rst-related__excerpt {
	display: block;
	font-size: 14px;
	line-height: 1.55;
	color: var(--rst-slate);
}

@media (max-width: 600px) {
	.rst-related {
		margin-top: 40px;
		padding-top: 32px;
	}

	.rst-related__grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}
