/* Modern related downloads block.
   Scoped classes keep the legacy catalogue and carousels untouched. */

.related-modern {
	margin: 40px 0 10px;
	padding: 26px;
	background: #fff;
	border: 1px solid #e5edf3;
	border-radius: 16px;
	box-shadow: 0 8px 28px rgba(24, 48, 72, 0.07);
	content-visibility: auto;
	contain-intrinsic-size: auto 1000px;
}

.related-modern__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
}

.related-modern__title {
	position: relative;
	min-width: 0;
	margin: 0;
	padding-left: 17px;
	color: #172033;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}

.related-modern__title::before {
	position: absolute;
	top: 0.1em;
	bottom: 0.1em;
	left: 0;
	width: 4px;
	border-radius: 4px;
	background: #249fd1;
	content: "";
}

.related-modern__all {
	flex: 0 0 auto;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 4px 0 12px;
	color: #1677c8;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.related-modern__all-arrow {
	font-size: 20px;
	line-height: 1;
	transition: transform 0.2s ease;
}

.related-modern__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px 20px;
}

/* Every generated item must fill its grid track. This also protects the block
   while DLE or an edge cache still serves the previous relatednews.tpl markup. */
.related-modern__grid > * {
	float: none !important;
	justify-self: stretch;
	min-width: 0 !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
}

.related-card {
	min-width: 0;
	margin: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e3eaf0;
	border-radius: 14px;
	box-shadow: 0 3px 12px rgba(24, 48, 72, 0.06);
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.related-card__link {
	display: flex;
	min-width: 0;
	height: 100%;
	flex-direction: column;
	color: #172033;
	text-decoration: none;
}

.related-card__media {
	display: block;
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	aspect-ratio: 26 / 33;
	overflow: hidden;
	background: #f2f5f8;
}

.related-card__image {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	max-width: 100%;
	margin: 0;
	object-fit: contain;
	object-position: center;
	transition: transform 0.25s ease;
}

.related-card__body {
	display: flex;
	min-width: 0;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 14px 14px 15px;
}

.related-card__title {
	display: -webkit-box;
	min-height: 4.35em;
	overflow: hidden;
	color: #263445;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.related-card__action {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 32px;
	margin-top: 12px;
	padding-top: 11px;
	border-top: 1px solid #edf1f4;
	color: #64748b;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
}

.related-card__action span {
	color: #1677c8;
	font-size: 18px;
	line-height: 1;
	transition: transform 0.2s ease;
}

.related-card__link:hover,
.related-card__link:focus {
	color: #172033;
}

.related-card__link:focus-visible,
.related-modern__all:focus-visible {
	outline: 3px solid rgba(36, 159, 209, 0.38);
	outline-offset: 3px;
}

@media (hover: hover) {
	.related-card:hover {
		transform: translateY(-3px);
		border-color: #b9dce9;
		box-shadow: 0 12px 28px rgba(24, 48, 72, 0.13);
	}

	.related-card:hover .related-card__image {
		transform: scale(1.025);
	}

	.related-card:hover .related-card__action span,
	.related-modern__all:hover .related-modern__all-arrow {
		transform: translateX(3px);
	}
}

@media screen and (max-width: 980px) {
	.related-modern__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media screen and (max-width: 720px) {
	.related-modern {
		margin-top: 32px;
		padding: 18px;
		border-radius: 14px;
	}

	.related-modern__head {
		margin-bottom: 18px;
	}

	.related-modern__title {
		font-size: 19px;
	}

	.related-modern__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 12px;
	}

	.related-card__body {
		padding: 11px 11px 12px;
	}

	.related-card__title {
		font-size: 14px;
	}

	.related-card__action {
		font-size: 11px;
	}
}

@media screen and (max-width: 470px) {
	.related-modern {
		margin-right: 0;
		margin-left: 0;
		padding: 15px;
	}

	.related-modern__head {
		gap: 8px;
	}

	.related-modern__title {
		padding-left: 13px;
		font-size: 16px;
	}

	.related-modern__title::before {
		width: 3px;
	}

	.related-modern__all {
		gap: 5px;
		padding-left: 4px;
		font-size: 11px;
	}

	.related-card__action {
		align-items: flex-end;
	}
}

@media screen and (max-width: 380px) {
	.related-modern__all-optional {
		display: none;
	}
}

@media screen and (max-width: 340px) {
	.related-modern__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Compatibility with cached/legacy relatednews.tpl markup.
   It can be removed after all DLE and CDN caches definitely contain
   the new .related-card HTML. */
.related-modern__grid > .mov.tcarusel-item {
	display: flex !important;
	height: auto !important;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e3eaf0;
	border-radius: 14px;
	box-shadow: 0 3px 12px rgba(24, 48, 72, 0.06);
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.related-modern__grid > .mov.tcarusel-item .mov-i {
	float: none !important;
	position: relative;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	aspect-ratio: 26 / 33;
	overflow: hidden;
	background: #f2f5f8;
}

.related-modern__grid > .mov.tcarusel-item .mov-i img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
	max-width: 100% !important;
	margin: 0 !important;
	object-fit: contain;
	object-position: center;
	transition: transform 0.25s ease;
}

.related-modern__grid > .mov.tcarusel-item .mov-mask {
	position: absolute !important;
	inset: 0 !important;
	z-index: 2;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	padding: 0 !important;
	background: transparent !important;
	border-radius: 0 !important;
	opacity: 0 !important;
}

.related-modern__grid > .mov.tcarusel-item .mov-mask span {
	display: none !important;
}

.related-modern__grid > .mov.tcarusel-item .mov-i + div {
	display: flex;
	min-width: 0;
	flex: 1 1 auto;
	text-align: left !important;
}

.related-modern__grid > .mov.tcarusel-item .mov-1 {
	display: -webkit-box !important;
	width: 100%;
	height: auto !important;
	min-height: 4.35em;
	margin: 0 !important;
	padding: 14px 14px 15px;
	overflow: hidden;
	color: #263445;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;
	text-align: left;
	white-space: normal;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.related-modern__grid > .mov.tcarusel-item .mov-c {
	display: none !important;
}

@media (hover: hover) {
	.related-modern__grid > .mov.tcarusel-item:hover {
		transform: translateY(-3px);
		border-color: #b9dce9;
		box-shadow: 0 12px 28px rgba(24, 48, 72, 0.13);
	}

	.related-modern__grid > .mov.tcarusel-item:hover .mov-i img {
		transform: scale(1.025);
	}
}

@media screen and (max-width: 720px) {
	.related-modern__grid > .mov.tcarusel-item .mov-1 {
		padding: 11px 11px 12px;
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.related-card,
	.related-card__image,
	.related-card__action span,
	.related-modern__all-arrow,
	.related-modern__grid > .mov.tcarusel-item,
	.related-modern__grid > .mov.tcarusel-item .mov-i img {
		transition: none;
	}
}
