/* 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: inline "read also" cards ---------- */

.rp-related-articles {
	--rp-ra-accent: var(--rp-related-accent, #4f46e5);

	display: block;
	margin-block: 1.8em;
	clear: both;
}

.rp-related-articles__label {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 10px;
	font-size: 0.76em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rp-ra-accent);
}

.rp-related-articles__icon {
	flex-shrink: 0;
}

.rp-related-articles__heading {
	margin: 0 0 16px;
	font-size: 1.25em;
	font-weight: 700;
}

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

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

.rp-related-article__link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.rp-related-article__link:hover {
	border-color: color-mix(in srgb, var(--rp-ra-accent) 35%, transparent);
	box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
	transform: translateY(-1px);
}

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

.rp-related-article__thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--rp-ra-accent) 10%, #f6f7f7);
	color: var(--rp-ra-accent);
}

.rp-related-article__body {
	display: flex;
	min-width: 0;
}

.rp-related-article__title {
	font-size: 0.98em;
	font-weight: 700;
	line-height: 1.55;
	color: #1d2327;
	transition: color 0.2s ease;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.rp-related-article__link:hover .rp-related-article__title {
	color: var(--rp-ra-accent);
}

/* Grid / horizontal styles share the image-on-top card. */

.rp-related-articles__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
}

.rp-related-articles__horizontal {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	padding-block-end: 6px;
	scroll-snap-type: x proximity;
}

.rp-related-articles__horizontal .rp-related-article-card {
	flex: 0 0 190px;
	scroll-snap-align: start;
}

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

.rp-related-article-card__link {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	color: inherit;
	text-decoration: none;
	height: 100%;
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.rp-related-article-card__link:hover {
	border-color: color-mix(in srgb, var(--rp-ra-accent) 35%, transparent);
	box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
	transform: translateY(-2px);
}

.rp-related-article-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f6f7f7;
}

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

.rp-related-article-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--rp-ra-accent) 10%, #f6f7f7);
	color: var(--rp-ra-accent);
}

.rp-related-article-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 10px 12px 12px;
	font-size: 0.94em;
	font-weight: 700;
	line-height: 1.5;
	color: #1d2327;
	transition: color 0.2s ease;
}

.rp-related-article-card__link:hover .rp-related-article-card__title {
	color: var(--rp-ra-accent);
}

/* Chevron style: image + title + round "read more" arrow, no card box. */

.rp-related-articles__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 24px 20px;
}

.rp-chevron-card {
	margin: 0;
}

.rp-chevron-card__link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.rp-chevron-card__thumb {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}

.rp-chevron-card__thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--rp-ra-accent) 10%, #f6f7f7);
	color: var(--rp-ra-accent);
}

.rp-chevron-card__title {
	font-size: 1em;
	font-weight: 700;
	line-height: 1.5;
	color: #1d2327;
	transition: color 0.2s ease;
}

.rp-chevron-card__link:hover .rp-chevron-card__title {
	color: var(--rp-ra-accent);
}

.rp-chevron-card__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid var(--rp-ra-accent);
	color: var(--rp-ra-accent);
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.rp-chevron-card__link:hover .rp-chevron-card__arrow {
	background: var(--rp-ra-accent);
	color: #fff;
	transform: translateX(-4px);
}

/* The reference chevron points left (RTL "continue reading"); mirror it
   for LTR pages where "forward" points the other way. */
html[dir="ltr"] .rp-chevron-card__arrow svg {
	transform: scaleX(-1);
}

html[dir="ltr"] .rp-chevron-card__link:hover .rp-chevron-card__arrow {
	transform: translateX(4px);
}
