/* =====================================================================
 * San Giorgio – News Overview widget
 * Tutte le classi sono namespaced con prefisso "sg-news-".
 * Riproduce fedelmente il layout Figma "Overview Articoli".
 *
 * MONKEY LAB di Michele Gigantino — © 2026
 * ===================================================================== */

.sg-news-overview {
	--sg-news-bg: #f5efe3;
	--sg-news-title: #a58b6e;
	--sg-news-link: #80674e;
	--sg-news-gap: 80px;
	--sg-news-max: 1113px;
	--sg-news-card-h: 400px;

	background-color: var(--sg-news-bg);
	color: var(--sg-news-title);
	font-family: "EB Garamond", Georgia, serif;
	width: 100%;
	box-sizing: border-box;
	padding-bottom: 0;
}

.sg-news-overview *,
.sg-news-overview *::before,
.sg-news-overview *::after {
	box-sizing: border-box;
}

.sg-news-overview__inner {
	max-width: var(--sg-news-max);
	margin: 0 auto;
	padding: 80px 24px;
	display: flex;
	flex-direction: column;
	gap: var(--sg-news-gap);
}

/* ---------- Heading ---------- */
.sg-news-overview__heading {
	margin: 0;
	color: var(--sg-news-title);
	font-weight: 400;
	font-size: clamp(48px, 8vw, 96px);
	line-height: 1;
	word-break: break-word;
}

.sg-news-overview__heading-prefix {
	font-style: normal;
}

.sg-news-overview__heading-text {
	font-style: italic;
}

/* ---------- Card (shared) ---------- */
.sg-news-card {
	color: var(--sg-news-title);
}

.sg-news-card__media {
	width: 100%;
	height: var(--sg-news-card-h);
	overflow: hidden;
}

.sg-news-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.sg-news-card__title {
	margin: 0;
	font-weight: 400;
	font-size: 48px;
	line-height: 48px;
	color: var(--sg-news-title);
	word-break: break-word;
}

.sg-news-card__title--sm {
	font-size: 48px;
	line-height: 48px;
}

.sg-news-card__excerpt {
	margin: 8px 0 0;
	font-style: italic;
	font-size: 32px;
	line-height: 33px;
	color: var(--sg-news-title);
	word-break: break-word;
}

.sg-news-card__cta {
	display: inline-block;
	margin-top: 24px;
	font-family: "Balthazar", Georgia, serif;
	font-size: 16px;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-position: from-font;
	color: var(--sg-news-link);
	width: max-content;
}

.sg-news-card__cta:hover,
.sg-news-card__cta:focus {
	color: var(--sg-news-title);
}

/* ---------- Featured (image + text side by side) ---------- */
.sg-news-card--featured {
	display: flex;
	gap: var(--sg-news-gap);
	align-items: flex-start;
}

.sg-news-card--featured .sg-news-card__media {
	flex: 0 0 516px;
	max-width: 516px;
}

.sg-news-card--featured .sg-news-card__body {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--sg-news-gap);
	padding: 24px 0;
}

.sg-news-card--featured .sg-news-card__cta {
	margin-top: 0;
}

/* ---------- Grid (2 columns) ---------- */
.sg-news-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--sg-news-gap);
}

.sg-news-card--grid {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sg-news-card--grid .sg-news-card__text {
	display: flex;
	flex-direction: column;
}

.sg-news-card--grid .sg-news-card__cta {
	margin-top: 0;
}

/* ---------- All articles (full-width strip / carousel) ---------- */
.sg-news-all {
	width: 100%;
	margin-top: var(--sg-news-gap);
}

.sg-news-all__divider {
	border: 0;
	border-top: 2px solid rgba(165, 139, 110, 0.45);
	margin: 0;
}

.sg-news-all__inner {
	padding: 48px;
	display: flex;
	flex-direction: column;
	gap: 48px;
}

.sg-news-all__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-left: 114px;
}

.sg-news-all__title {
	margin: 0;
	font-weight: 400;
	font-size: 48px;
	line-height: 48px;
	color: var(--sg-news-title);
}

/* ---- Nav arrows ---- */
.sg-news-all__nav {
	display: flex;
	gap: 12px;
	flex-shrink: 0;
}

.sg-news-all__arrow {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid var(--sg-news-link);
	background: transparent;
	color: var(--sg-news-link);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.sg-news-all__arrow:hover:not(:disabled) {
	background: var(--sg-news-link);
	color: var(--sg-news-bg);
}

.sg-news-all__arrow:disabled {
	opacity: .3;
	cursor: default;
}

.sg-news-all__arrow-icon {
	pointer-events: none;
	display: block;
}

/* ---- Carousel ---- */
.sg-news-carousel {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sg-news-carousel__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	cursor: grab;
	scrollbar-width: none; /* Firefox: la barra nativa è sostituita dal progress custom */
	outline: none;
}

.sg-news-carousel__viewport::-webkit-scrollbar {
	display: none;
}

.sg-news-carousel__viewport.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	scroll-behavior: auto;
	user-select: none;
}

.sg-news-carousel__viewport:focus-visible {
	box-shadow: 0 0 0 2px rgba(128, 103, 78, 0.45);
	border-radius: 2px;
}

.sg-news-carousel__track {
	display: flex;
	gap: 32px;
	padding-bottom: 4px;
}

/* ---- Progress bar ---- */
.sg-news-carousel__progress {
	position: relative;
	height: 4px;
	background: rgba(165, 139, 110, 0.25);
	border-radius: 4px;
	cursor: pointer;
	overflow: hidden;
}

.sg-news-carousel__progress-bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 30%;
	background: var(--sg-news-link);
	border-radius: 4px;
	transition: transform .15s ease, width .15s ease;
	will-change: transform, width;
}

.sg-news-carousel.is-static .sg-news-carousel__progress {
	display: none;
}

.sg-news-thumb {
	flex: 0 0 400px;
	max-width: 400px;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sg-news-thumb__media {
	width: 100%;
	height: 400px;
	overflow: hidden;
}

.sg-news-thumb__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.sg-news-thumb__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sg-news-thumb__title {
	margin: 0;
	font-weight: 400;
	font-size: 32px;
	line-height: 48px;
	color: var(--sg-news-title);
}

.sg-news-thumb__cta {
	font-family: "Balthazar", Georgia, serif;
	font-size: 16px;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-position: from-font;
	color: var(--sg-news-link);
	width: max-content;
}

.sg-news-thumb__cta:hover,
.sg-news-thumb__cta:focus {
	color: var(--sg-news-title);
}

/* =====================================================================
 * RESPONSIVE
 * ===================================================================== */

/* Tablet */
@media (max-width: 1024px) {
	.sg-news-overview {
		--sg-news-gap: 48px;
		--sg-news-card-h: 320px;
	}

	.sg-news-card__title,
	.sg-news-card__title--sm,
	.sg-news-all__title {
		font-size: 36px;
		line-height: 40px;
	}

	.sg-news-card__excerpt {
		font-size: 24px;
		line-height: 28px;
	}

	.sg-news-all__header {
		margin-left: 0;
	}

	.sg-news-all__inner {
		padding: 32px 24px;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.sg-news-overview {
		--sg-news-gap: 40px;
		--sg-news-card-h: 260px;
	}

	.sg-news-overview__inner {
		padding: 48px 20px;
	}

	.sg-news-card--featured {
		flex-direction: column;
		gap: 24px;
	}

	.sg-news-card--featured .sg-news-card__media {
		flex-basis: auto;
		max-width: 100%;
	}

	.sg-news-card--featured .sg-news-card__body {
		gap: 24px;
		padding: 0;
	}

	.sg-news-grid {
		grid-template-columns: 1fr;
	}

	.sg-news-card__title,
	.sg-news-card__title--sm,
	.sg-news-all__title {
		font-size: 32px;
		line-height: 36px;
	}

	.sg-news-card__excerpt {
		font-size: 20px;
		line-height: 26px;
	}

	.sg-news-thumb {
		flex-basis: 78vw;
		max-width: 78vw;
	}

	.sg-news-thumb__media {
		height: 260px;
	}
}

/* =====================================================================
 * Stato "non pubblicato" — visibile SOLO nell'editor Elementor.
 * Nel front-end pubblico queste card non vengono proprio renderizzate.
 * MONKEY LAB di Michele Gigantino — © 2026
 * ===================================================================== */
.sg-news-card--unpublished,
.sg-news-thumb.sg-news-card--unpublished,
.sg-news-thumb--unpublished {
	position: relative;
	opacity: .55;
	filter: grayscale(35%);
}

.sg-news-draft-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 5;
	display: inline-block;
	padding: 4px 10px;
	background: #80674e;
	color: #f5efe3;
	font-family: "Balthazar", Georgia, serif;
	font-size: 13px;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: .04em;
	border-radius: 3px;
	pointer-events: none;
}
