/* Related Articles Carousel - Frontend */

.rac-carousel-wrapper {
	margin: 2rem 0 1.75rem;
	padding: 0.25rem 0 0.75rem;
	clear: both;
	width: 100%;
}

/* Match Comments subtitle */
.rac-carousel-title {
	font-family: Lora, Georgia, serif !important;
	font-size: 22px !important;
	font-weight: 600 !important;
	line-height: 1.3;
	margin: 0 0 0.85rem;
	color: #000 !important;
	border-bottom: 2px solid #2ecc71;
	padding-bottom: 0.35rem;
	display: inline-block;
	letter-spacing: -0.01em;
}

.rac-carousel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.rac-track-container {
	overflow: hidden;
	flex: 1;
	width: 100%;
	min-width: 0;
}

.rac-track {
	display: flex;
	transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
	will-change: transform;
}

/* Desktop: 5 per view */
.rac-item {
	flex: 0 0 calc((100% - 2rem) / 5);
	width: calc((100% - 2rem) / 5);
	max-width: calc((100% - 2rem) / 5);
	box-sizing: border-box;
	margin-right: 0.5rem;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	background: #111;
	min-width: 0;
}

.rac-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.rac-item-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.rac-item-image {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #1a1a1a;
}

.rac-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.rac-item:hover .rac-item-image img {
	transform: scale(1.05);
}

.rac-item-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 1.5rem 0.45rem 0.4rem;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.9) 0%,
		rgba(0, 0, 0, 0.55) 50%,
		rgba(0, 0, 0, 0) 100%
	);
	z-index: 1;
	pointer-events: none;
}

.rac-item-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 0.15rem;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rac-item-date {
	display: block;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	color: rgba(255, 255, 255, 0.88);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.rac-no-thumb {
	background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.rac-no-thumb .rac-placeholder {
	display: none;
}

.rac-nav {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: #2ecc71;
	color: #fff;
	font-size: 0.9rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, opacity 0.2s;
	z-index: 2;
}

.rac-nav:hover {
	background: #27ae60;
}

.rac-nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.rac-nav:focus-visible {
	outline: 2px solid #2ecc71;
	outline-offset: 2px;
}

.rac-dots {
	display: flex;
	justify-content: center;
	gap: 0.4rem;
	margin-top: 0.75rem;
	min-height: 10px;
}

.rac-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	background: #ccc;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s, transform 0.2s;
}

.rac-dot.is-active,
.rac-dot:hover {
	background: #2ecc71;
}

.rac-dot.is-active {
	transform: scale(1.2);
}

/* Hide theme "Other Articles" */
.single-next-prev-posts-container,
.single-next-prev-posts {
	display: none !important;
}

/* Tablet: 3 per view */
@media (max-width: 900px) {
	.rac-item {
		flex: 0 0 calc((100% - 1rem) / 3);
		width: calc((100% - 1rem) / 3);
		max-width: calc((100% - 1rem) / 3);
	}
}

/* Mobile: 1 per view */
@media (max-width: 640px) {
	.rac-item {
		flex: 0 0 100%;
		width: 100%;
		max-width: 100%;
		margin-right: 0;
	}

	.rac-carousel-title {
		font-size: 20px !important;
	}

	.rac-item-title {
		font-size: 15px;
	}

	.rac-item-date {
		font-size: 12px;
	}

	.rac-nav {
		width: 30px;
		height: 30px;
	}

	.rac-item-image {
		aspect-ratio: 16 / 10;
	}

	.rac-item-overlay {
		padding: 2rem 0.7rem 0.55rem;
	}
}
