.ns-latest-news-container {
	position: relative;
	width: min(1490px, 100%);
	overflow: visible;
	padding-block: 2rem;
	margin: -2rem auto -2rem;
	padding-inline: 30px;
}

@media (width>=800px) {
	.ns-latest-news-container {
		margin: -2rem auto -3rem;
	}
}

.ns-news-carousel {
	position: relative;
	width: 100%;
	overflow: hidden;
	padding-block: 2rem;
	margin-block: -2rem;
}

.ns-news-wrapper {
	display: flex;
	transition: transform 0.3s ease;
	gap: 20px;
	padding-inline: 15px;
	scroll-snap-type: x mandatory;
}

.ns-news-item {
	scroll-snap-align: start;
	flex: 0 0 auto;
	background: #ffffff;
	box-shadow: none;
	border-radius: 12px;
	padding: var(--spacer-25px) var(--spacer-50px) var(--spacer-50px);
	cursor: pointer;
	transition: all 0.3s ease;
	overflow: hidden;
	margin: 0 !important;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	font-family: 'Titillium Web', Sans-serif;
}

.ns-news-item.visible {
	box-shadow: 0px 0px 15px #0166cc39;

	&:hover {
		transform: translateY(-5px);
		box-shadow: 0 5px 20px #0166cc39;
	}
}

/* Desktop: 3 colonne */
@media (min-width: 1026px) {
	.ns-news-item {
		flex-basis: calc(33.333% - 13.333px);
		/* (20px gap * 2) / 3 = 13.333px per elemento */
	}
}

.ns-news-image {
	width: 100%;
	overflow: hidden;
	background-color: #75a3d7;
	background-image: url(/wp-content/uploads/2025/09/logo-white.png),
		url(https://www.bovolonedigitalefacile.it/wp-content/uploads/2024/12/bg-header.png);
	background-position: center center, center center;
	background-repeat: no-repeat, no-repeat;
	background-size: 125px 125px, cover;
	height: 240px;
	border-radius: 12px;
	user-select: none;

	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		transition: transform 0.3s ease;
	}
}

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

.ns-news-content {
	padding: 20px 0;
	user-select: none;
}

.ns-news-title {
	margin: 0 0 10px 0;
	font-size: clamp(16px, 15px + 0.3125vw, 20px);
	font-weight: 600;
	line-height: 1.4;
	color: var(--e-global-color-primary) !important;
	line-height: 1.2em;
	&::first-letter {
		text-transform: uppercase;
	}
}

.ns-news-excerpt {
	margin: 0;
	color: var(--e-global-color-text);
	line-height: 1.2em;
	font-size: 1rem;
	/*clamp(16px, 15px + 0.3125vw, 20px);*/
	&::first-letter {
		text-transform: uppercase;
	}
}

.ns-carousel-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: calc(2rem + 1vw) !important;
	height: calc(2rem + 1vw) !important;
	/*background-color: var(--e-global-color-secondary) !important;*/
	background-color: #e3ecf5 !important;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--e-global-color-primary) !important;
	font-size: 20px;
	z-index: 10;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	padding: 0;

	&:not(:disabled):hover {
		transform: translateY(-50%) scale(1.1);
	}

	&:disabled {
		opacity: 0;
		cursor: default;
		pointer-event: none;
	}

	svg {
		width: 48px;
		height: 48px;
	}
}

.ns-carousel-prev {
	left: 5px;
}

.ns-carousel-next {
	right: 5px;
}

.ns-news-popup {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
}

.ns-popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	cursor: pointer;
}

.ns-popup-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-height: 65svh;
	width: min(90%, 800px);
	background: #ffffff;
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	&:has(.ns-loader) .ns-popup-close {
		opacity: 0;
	}
}

.ns-popup-close {
	position: absolute;
	top: 15px;
	right: 20px;
	width: 35px;
	height: 35px;
	background: #e3ecf5;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	color: var(--e-global-color-primary) !important;
	z-index: 99999;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	padding: 0;
	line-height: 1;

	&:hover {
		background: #e3ecf5;
		transform: scale(1.25);
		opacity: 1;
	}
}

.ns-popup-body {
	max-height: calc(65svh - 60px);
	overflow-y: auto;
	padding: 30px 30px 50px;

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: var(--e-global-color-primary);
		text-wrap: balance;
		font-family: 'Titillium Web', Sans-serif;
		line-height: 1.2em;
		font-weight: 600;
		&::first-letter {
			text-transform: uppercase;
		}
	}

	h1 {
		font-size: clamp(32px, 28.75px + 1.0156vw, 45px) !important;
		font-weight: 600;
		line-height: 1em;
	}

	img {
		width: 100%;
		height: auto;
		margin: 0 0 15px;
		border-radius: 8px;
	}

	p {
		color: var(--e-global-color-text);
		line-height: 1.2em;
		font-size: clamp(16px, 15px + 0.3125vw, 20px);
		font-family: var(--e-global-typography-text-font-family), Sans-serif;
		&::first-letter {
			text-transform: uppercase;
		}
	}

	ul {
		border-top: 1px dashed #707070;
		border-bottom: 1px dashed #707070;
		padding-block: 1rem;
		font-family: var(--e-global-typography-text-font-family), Sans-serif;
	}
	b,
	strong {
		font-weight: 600;
	}

	li::marker {
		color: var(--e-global-color-primary);
	}

	.wp-block-image {
		text-align: center;
		margin: 30px 0;
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		margin: 30px 0 15px;
	}

	&:not(:has(img)) > h1 {
		margin: 0 0 15px 0;
		padding-right: 50px;
	}

	h2 {
		font-size: clamp(20px, 18px + 0.625vw, 28px) !important;
	}

	h3 {
		font-size: clamp(18px, 16.5px + 0.4688vw, 24px) !important;
	}

	h4,
	h5,
	h6 {
		font-size: clamp(16px, 15px + 0.3125vw, 20px) !important;
	}

	ul,
	ol {
		margin: 16px 0;
		padding-left: 30px;
	}

	blockquote {
		border-left: 4px solid #0073aa;
		padding-left: 20px;
		margin: 25px 0;
		font-style: italic;
		color: #666666;
	}
}

@media (width<=1200px) {
	.ns-news-wrapper {
		padding: 0;
	}
}

@media (width<=1025px) {
	.ns-news-wrapper {
		gap: 15px;
	}

	.ns-news-item {
		flex-basis: calc(50% - 7.5px);
		/* (15px gap) / 2 = 7.5px per elemento */
	}

	.ns-carousel-nav {
		width: 36px;
		height: 36px;
		font-size: 18px;
	}

	.ns-carousel-prev {
		left: 4px;
	}

	.ns-carousel-next {
		right: 4px;
	}
}

@media (max-width: 850px) {
	.ns-news-wrapper {
		gap: 10px;
	}

	.ns-news-item {
		flex-basis: calc(50% - 5px);
		/* (10px gap) / 2 = 5px per elemento */
	}

	.ns-news-content {
		padding: 15px;
	}

	.ns-news-title {
		font-size: 16px;
	}

	.ns-news-excerpt {
		font-size: 13px;
	}

	.ns-news-image {
		height: 160px;
	}

	.ns-carousel-nav {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}

	.ns-carousel-prev {
		left: 4px;
	}

	.ns-carousel-next {
		right: 4px;
	}

	.ns-popup-content {
		width: 95%;
		max-height: 95vh;
		border-radius: 8px;
	}

	.ns-popup-body {
		padding: 20px;
		max-height: calc(95vh - 40px);
	}

	.ns-popup-body h1 {
		font-size: 24px;
	}

	.ns-popup-close {
		top: 10px;
		right: 10px;
	}
}

@media (max-width: 600px) {
	.ns-news-wrapper {
		padding-inline: 0;
		gap: 10px;
	}

	.ns-news-item {
		flex-basis: calc(100% - 10px);
		/* Lascia un po' di spazio per il gap */
	}

	.ns-news-content {
		padding: 12px;
	}

	.ns-news-title {
		font-size: 15px;
		margin-bottom: 8px;
	}

	.ns-news-excerpt {
		font-size: 12px;
	}

	.ns-news-image {
		height: 140px;
	}

	.ns-carousel-nav {
		width: 30px;
		height: 30px;
		font-size: 14px;
	}

	.ns-carousel-prev {
		left: 2px;
	}

	.ns-carousel-next {
		right: 2px;
	}

	.ns-popup-body {
		padding: 15px;
	}

	.ns-popup-body h1 {
		font-size: 20px;
		margin-bottom: 15px;
	}
}

@media (min-width: 600px) and (max-width: 800px) {
	.ns-news-item {
		flex-basis: calc(50% - 5px);
		/* (10px gap) / 2 = 5px per elemento */
	}
}

@media (pointer: coarse) {
	.ns-popup-close {
		width: 3.5rem;
		height: 3.5rem;
	}
}
