/**
 * Related Items component
 *
 * Sibling-link grid rendered by template-parts/related-items.php at
 * the bottom of single CPT templates (plugins / themes today; any
 * CPT in the future). Visual: bordered card with optional icon,
 * 2-line title, 2-line excerpt, soft hover lift.
 *
 * @package WPFolks
 * @since   1.23.223
 */

.related-items {
	margin-top: 56px;
	margin-bottom: 56px;
	padding-top: 48px;
	border-top: 1px solid var(--color-border, #e5e7eb);
}
.related-items__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}
.related-items__heading {
	margin: 0;
	font-size: clamp(22px, 2.4vw, 28px);
	font-weight: 700;
	letter-spacing: -0.3px;
	color: var(--color-text, #0b1220);
}
.related-items__archive {
	font-size: 14px;
	font-weight: 600;
	color: var(--brand-primary, #4f46e5);
	text-decoration: none;
}
.related-items__archive:hover { text-decoration: underline; }

.related-items__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}
.related-items__item { margin: 0; }

.related-items__card {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 16px;
	border: 1px solid var(--color-border, #e5e7eb);
	border-radius: 12px;
	background: var(--surface-white, #ffffff);
	text-decoration: none;
	color: inherit;
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
	height: 100%;
}
.related-items__card:hover {
	border-color: var(--brand-primary, #4f46e5);
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
	transform: translateY(-1px);
}

.related-items__icon {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--color-bg-subtle, #f3f4f6);
}
.related-items__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-items__icon--fallback {
	background: linear-gradient(135deg, #4f46e5 0%, #c026d3 100%);
	color: #fff;
	font-weight: 700;
	font-size: 18px;
}
/* Submitter avatars render as circles so they read as "person"
 * rather than "logo" — distinguishes snippet / idea / deal cards
 * from plugin / theme cards which use square wp.org icons. */
.related-items__icon--avatar {
	border-radius: 50%;
	background: var(--color-bg-subtle, #f3f4f6);
}
.related-items__icon--avatar img { border-radius: 50%; }

.related-items__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1;
}
.related-items__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--color-text, #0b1220);
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.related-items__excerpt {
	font-size: 13px;
	line-height: 1.45;
	color: var(--color-text-muted, #4b5160);
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
