/* Related Post - frontend output. Scoped under .rp-related-products so
   it never bleeds into theme styles, and easy for a theme to override. */

.rp-related-products {
	--rp-radius: 10px;
	--rp-gap: 20px;
	--rp-columns: 4;

	margin-block: 2.5em;
	clear: both;
}

.rp-related-products__title {
	font-size: 1.3em;
	font-weight: 700;
	margin-block-end: 1em;
}

.rp-grid {
	display: grid;
	grid-template-columns: repeat(var(--rp-columns), 1fr);
	gap: var(--rp-gap);
}

@media (max-width: 1024px) {
	.rp-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.rp-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: calc(var(--rp-gap) / 2);
	}
}

.rp-horizontal {
	display: flex;
	gap: var(--rp-gap);
	overflow-x: auto;
	padding-block-end: 6px;
	scroll-snap-type: x proximity;
}

.rp-horizontal .rp-card {
	flex: 0 0 220px;
	scroll-snap-align: start;
}

.rp-card {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--rp-radius);
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rp-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.rp-card__link {
	display: flex;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
	flex: 1;
}

.rp-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f6f7f7;
}

.rp-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rp-card__badge {
	position: absolute;
	top: 8px;
	inset-inline-start: 8px;
	background: rgba(29, 35, 39, 0.85);
	color: #fff;
	font-size: 0.72em;
	padding: 3px 8px;
	border-radius: 999px;
}

.rp-card__title {
	font-size: 0.95em;
	font-weight: 600;
	margin: 12px 14px 4px;
	line-height: 1.4;
}

.rp-card__price {
	margin: 0 14px 12px;
	font-size: 0.9em;
	opacity: 0.85;
}

.rp-card__price ins {
	text-decoration: none;
}

.rp-card__button {
	display: block;
	text-align: center;
	margin: 0 14px 14px;
	padding: 8px 12px;
	border-radius: calc(var(--rp-radius) / 2);
	background: var(--rp-related-button-bg, #1d2327);
	color: var(--rp-related-button-color, #fff);
	font-size: 0.85em;
	font-weight: 600;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.rp-card__button:hover {
	opacity: 0.85;
	color: var(--rp-related-button-color, #fff);
}

/* ---------- Related Articles: compact inline "read also" box ---------- */

.rp-related-articles {
	display: block;
	margin-block: 1.6em;
	padding: 12px 16px;
	border-inline-start: 3px solid var(--rp-related-accent, #4f46e5);
	background: var(--rp-related-articles-bg, rgba(79, 70, 229, 0.05));
	border-radius: 6px;
	clear: both;
}

.rp-related-articles__label {
	display: block;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--rp-related-accent, #4f46e5);
	margin-block-end: 6px;
}

.rp-related-articles__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rp-related-article {
	margin: 0;
}

.rp-related-article__link {
	display: flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.rp-related-article__link:hover .rp-related-article__title {
	text-decoration: underline;
}

.rp-related-article__thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 5px;
	flex-shrink: 0;
}

.rp-related-article__title {
	font-size: 0.96em;
	font-weight: 600;
	line-height: 1.5;
}
