/*
 * "Weitere Artikel" after the third paragraph (inc/inline_related.php).
 *
 * The module sits inside .entry-content, whose rules for a, img and headings reach it
 * (magenta underline on links, image margins). Every rule here is therefore scoped as
 * `.entry-content .gn-irel …` or deeper, so it wins on specificity rather than on load
 * order — main.css loads before the parent's CSS (AGENTS.md §4).
 *
 * The row is a CSS scroll-snap track, not an Owl carousel: no JS needed to scroll, and no
 * inline filmstrip width to inflate a flex parent.
 */

.gn-irel {
	clear: both;
	min-width: 0;
	max-width: 100%;
	margin: 32px 0 34px;
	padding-top: 20px;
	border-top: 1px solid #e6e6e6;
}

.gn-irel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.entry-content .gn-irel__title {
	margin: 0;
	padding-left: 12px;
	border-left: 3px solid #ad3e81;
	color: #111;
	font-family: Lato, sans-serif;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
}

.gn-irel__nav {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

.gn-irel__nav[hidden] {
	display: none;
}

.entry-content .gn-irel__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid #dcdcdc;
	border-radius: 50%;
	background: #fff;
	color: #ad3e81;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.entry-content .gn-irel__arrow--prev svg {
	transform: rotate(180deg);
}

.entry-content .gn-irel__arrow:hover:not(:disabled) {
	border-color: #ad3e81;
	background: #ad3e81;
	color: #fff;
}

.entry-content .gn-irel__arrow:disabled {
	opacity: .35;
	cursor: default;
}

.entry-content .gn-irel__arrow:focus-visible,
.entry-content .gn-irel__card:focus-visible,
.gn-irel__track:focus-visible {
	outline: 2px solid #ad3e81;
	outline-offset: 2px;
}

.gn-irel__track {
	display: flex;
	gap: 16px;
	min-width: 0;
	/* room for the card shadow, which overflow would otherwise clip */
	margin: 0 -4px;
	padding: 2px 4px 14px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-left: 4px;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: #d6d6d6 transparent;
	-webkit-overflow-scrolling: touch;
}

/* Mobile first: one card and the edge of the next, so it reads as swipeable. */
.gn-irel__item {
	flex: 0 0 74%;
	min-width: 0;
	scroll-snap-align: start;
}

@media (min-width: 600px) {
	.gn-irel__item {
		flex-basis: calc((100% - 32px) / 3);
	}

	.entry-content .gn-irel__title {
		font-size: 21px;
	}
}

.entry-content .gn-irel__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid #ececec;
	border-bottom: 1px solid #ececec;
	border-radius: 5px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
	color: #222;
	text-decoration: none;
	transition: box-shadow .2s ease;
}

.entry-content .gn-irel__card:hover {
	box-shadow: 0 10px 18px -8px rgba(0, 0, 0, .22);
	color: #222;
	text-decoration: none;
}

.entry-content .gn-irel__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f1f1f1;
}

.entry-content .gn-irel__media img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
	transition: transform .35s ease;
}

.entry-content .gn-irel__card:hover .gn-irel__media img {
	transform: scale(1.03);
}

.entry-content .gn-irel__cat {
	position: absolute;
	bottom: 10px;
	left: 10px;
	max-width: calc(100% - 20px);
	overflow: hidden;
	padding: 5px 8px 4px;
	border-radius: 3px;
	background: #ad3e81;
	color: #fff;
	font-family: Cabin, sans-serif;
	font-size: 12px;
	line-height: 1.2;
	letter-spacing: .02em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.entry-content .gn-irel__name {
	display: -webkit-box;
	overflow: hidden;
	margin: 12px 14px 14px;
	color: #222;
	font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	transition: color .15s ease;
}

.entry-content .gn-irel__card:hover .gn-irel__name {
	color: #ad3e81;
}

@media (prefers-reduced-motion: reduce) {
	.gn-irel__track {
		scroll-behavior: auto;
	}

	.entry-content .gn-irel__card,
	.entry-content .gn-irel__media img,
	.entry-content .gn-irel__name {
		transition: none;
	}

	.entry-content .gn-irel__card:hover .gn-irel__media img {
		transform: none;
	}
}

@media print {
	.gn-irel {
		display: none;
	}
}
