/* MH Recent Posts Slider */
.mhrs {
	--mhrs-gap: 20px;
	--c: var(--mhrs-cols, 4);
	position: relative;
	container-type: inline-size;
	margin: 0 0 1.5em;
}
@media (max-width: 1024px) { .mhrs { --c: min(var(--mhrs-cols, 4), 3); } }
@media (max-width: 768px)  { .mhrs { --c: min(var(--mhrs-cols, 4), 2); --mhrs-gap: 16px; } }
@media (max-width: 480px)  { .mhrs { --c: 1; } }

.mhrs .mhrs-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--c) - 1) * var(--mhrs-gap)) / var(--c));
	gap: var(--mhrs-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	/* !important: Divi applica list-style e padding alle <ul> dei moduli */
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: normal;
}
.mhrs .mhrs-track::-webkit-scrollbar { display: none; }

.mhrs .mhrs-slide {
	scroll-snap-align: start;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}
.mhrs .mhrs-slide::before { content: none; }

.mhrs .mhrs-card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.mhrs .mhrs-media {
	aspect-ratio: var(--mhrs-ar, 4 / 3);
	overflow: hidden;
	background: #e9e9e9;
}
.mhrs .mhrs-media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .4s ease;
}
.mhrs .mhrs-card:hover .mhrs-media img { transform: scale(1.04); }

.mhrs .mhrs-title {
	margin: .75em 0 0;
	padding: 0; /* Divi aggiunge padding-bottom ai titoli */
	font-size: 1.25rem;
	line-height: 1.45;
	font-weight: 700;
	color: #444;
}
.mhrs .mhrs-card:hover .mhrs-title,
.mhrs .mhrs-card:focus-visible .mhrs-title { color: #000; }

.mhrs .mhrs-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .2em .8em;
	margin-top: .75em;
	font-size: .875rem;
	line-height: 1.4;
	color: #777;
}
.mhrs .mhrs-cat { font-weight: 600; color: #555; }
.mhrs .mhrs-meta + .mhrs-title { margin-top: .3em; }
.mhrs .mhrs-card > .mhrs-meta:first-child,
.mhrs .mhrs-card > .mhrs-title:first-child { margin-top: 0; }

.mhrs .mhrs-excerpt {
	margin: .5em 0 0;
	padding: 0; /* Divi aggiunge padding-bottom ai paragrafi */
	font-size: .95rem;
	line-height: 1.6;
	color: #666;
}

.mhrs .mhrs-more {
	display: inline-block;
	margin-top: .6em;
	font-weight: 600;
	color: #444;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.mhrs .mhrs-card:hover .mhrs-more { color: #000; }

.mhrs .mhrs-card:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* Frecce: centrate sull'immagine, non sull'intera card */
.mhrs .mhrs-nav {
	position: absolute;
	z-index: 2;
	top: 35%;
	top: calc((100cqw - (var(--c) - 1) * var(--mhrs-gap)) / var(--c) * var(--mhrs-rh, .75) / 2);
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 50px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: rgba(0, 0, 0, .8);
	color: #fff;
	line-height: 0;
	cursor: pointer;
	transition: background-color .2s;
}
.mhrs .mhrs-nav:hover { background: #000; }
.mhrs .mhrs-nav:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.mhrs .mhrs-prev { left: -10px; }
.mhrs .mhrs-next { right: -10px; }
@media (max-width: 768px) {
	.mhrs .mhrs-prev { left: 0; }
	.mhrs .mhrs-next { right: 0; }
}

/* Senza foto le frecce vanno a metà altezza */
.mhrs.no-foto .mhrs-nav { top: 50%; }

/* Se tutti gli articoli stanno in una riga, niente frecce */
.mhrs.is-static .mhrs-nav { display: none; }

@media (prefers-reduced-motion: reduce) {
	.mhrs .mhrs-track { scroll-behavior: auto; }
	.mhrs .mhrs-media img { transition: none; }
	.mhrs .mhrs-card:hover .mhrs-media img { transform: none; }
}
