/**
 * Related posts grid — [relatedposts]
 * Card styling aligned with product-categories-kti
 */

html body .kti-related-posts-wrap {
	width: 100%;
	max-width: 100%;
	margin: 32px 0;
}

html body .kti-related-posts__header {
	margin: 0 0 28px;
	max-width: 820px;
}

html body .kti-related-posts__heading {
	margin: 0 0 12px !important;
	text-align: left;
}

html body .kti-related-posts__intro {
	margin: 0;
	font-family: "Inter", sans-serif;
	font-size: 17px;
	line-height: 1.6;
	color: #3a4653;
}

html body .kti-related-posts {
	display: grid;
	width: 100%;
	max-width: 100%;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* 1 kaart: gecentreerd */
html body .kti-related-posts--count-1 {
	grid-template-columns: minmax(0, 420px);
	justify-content: center;
}

/* 2 kaarten: gecentreerd duo-grid */
html body .kti-related-posts--count-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 780px;
	margin-left: auto;
	margin-right: auto;
}

/* 3 kaarten: normaal 3-koloms grid */
html body .kti-related-posts--count-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 4+ kaarten: carousel (3 zichtbaar op desktop) */
html body .kti-related-posts-carousel {
	position: relative;
	width: 100%;
	overflow: hidden;
}

html body .kti-related-posts--carousel {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	-ms-overflow-style: none;
	scrollbar-width: none;
	padding-bottom: 4px;
}

html body .kti-related-posts--carousel::-webkit-scrollbar {
	display: none;
}

html body .kti-related-posts--carousel .kti-related-posts__card {
	flex: 0 0 calc((100% - 32px) / 3);
	width: calc((100% - 32px) / 3);
	min-width: calc((100% - 32px) / 3);
	max-width: calc((100% - 32px) / 3);
	height: auto;
	aspect-ratio: 3 / 2;
	align-self: flex-start;
	scroll-snap-align: start;
}

html body .kti-related-posts__controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

html body .kti-related-posts__prev,
html body .kti-related-posts__next {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(90deg, #FAB400 0%, #ED6B06 100%);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

html body .kti-related-posts__prev:hover:not(:disabled),
html body .kti-related-posts__next:hover:not(:disabled) {
	transform: translateY(-1px);
}

html body .kti-related-posts__prev:disabled,
html body .kti-related-posts__next:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

html body .kti-related-posts__card {
	width: 100%;
	min-width: 0;
	aspect-ratio: 3 / 2;
	border-radius: 12px;
	overflow: hidden;
	position: relative;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

html body .kti-related-posts__card:hover {
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

html body .kti-related-posts__link {
	display: block;
	height: 100%;
	width: 100%;
	text-decoration: none;
	color: inherit;
}

html body .kti-related-posts__image-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	background: #3a4653;
	overflow: hidden;
}

html body .kti-related-posts__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	z-index: 1;
	transform: scale(1);
	transition: transform 0.45s ease;
}

html body .kti-related-posts__card:hover .kti-related-posts__img {
	transform: scale(1.08);
}

html body .kti-related-posts__overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	padding: 24px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0.72) 100%);
	pointer-events: none;
}

html body .kti-related-posts__overlay * {
	pointer-events: auto;
}

html body .kti-related-posts__title {
	margin: 0;
	padding: 0;
	font-family: "DM Sans", sans-serif !important;
	font-size: 24px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: #fff !important;
	background: none !important;
	-webkit-text-fill-color: #fff !important;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

html body .kti-related-posts__excerpt {
	margin: 8px 0 0;
	font-family: "Inter", sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.95) !important;
	-webkit-text-fill-color: rgba(255, 255, 255, 0.95) !important;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

html body .kti-related-posts__button {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 4;
	background: linear-gradient(90deg, #FAB400 0%, #ED6B06 100%);
	color: #fff !important;
	padding: 10px 16px;
	border-radius: 50px;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(237, 107, 6, 0.3);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	transition: all 0.3s ease;
}

html body .kti-related-posts__button i {
	background: rgba(0, 0, 0, 0.2);
	padding: 5px;
	border-radius: 50%;
	font-size: 12px;
}

html body .kti-related-posts__card:hover .kti-related-posts__button {
	background: linear-gradient(90deg, #E6A200 0%, #D85F05 100%);
}

@media (max-width: 1024px) {
	html body .kti-related-posts--count-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	html body .kti-related-posts--count-2 {
		max-width: 100%;
	}

	html body .kti-related-posts--carousel .kti-related-posts__card {
		flex-basis: calc((100% - 16px) / 2);
		width: calc((100% - 16px) / 2);
		min-width: calc((100% - 16px) / 2);
		max-width: calc((100% - 16px) / 2);
	}
}

@media (max-width: 768px) {
	html body .kti-related-posts__intro {
		font-size: 16px;
	}

	html body .kti-related-posts,
	html body .kti-related-posts--count-3 {
		grid-template-columns: 1fr;
	}

	html body .kti-related-posts--carousel {
		padding-inline: 0;
	}

	html body .kti-related-posts--carousel .kti-related-posts__card {
		flex-basis: 85%;
		width: 85%;
		min-width: 85%;
		max-width: 85%;
		scroll-snap-align: center;
	}

	html body .kti-related-posts--count-1 {
		grid-template-columns: minmax(0, 1fr);
		max-width: 420px;
		margin-left: auto;
		margin-right: auto;
	}

	html body .kti-related-posts--count-2 {
		grid-template-columns: 1fr;
		max-width: 420px;
	}

	html body .kti-related-posts__title {
		font-size: 22px !important;
	}
}
