/* ==========================================================================
   PREFOOTER BLOCK - FRONTEND
   ========================================================================== */

/* Section wrapper - edge to edge, no padding */
.s4w-prefooter {
	padding: 0;
}

/* 3-column grid - desktop */
.s4w-prefooter__grid {
	display: flex;
	flex-flow: row nowrap;
	width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

/* Each column: 33.333% width with 480x707 aspect ratio */
.s4w-prefooter__column {
	flex: 0 0 33.333%;
	max-width: 33.333%;
	position: relative;
	aspect-ratio: 480 / 707;
	overflow: hidden;
}

/* Background image layer */
.s4w-prefooter__bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

.s4w-prefooter__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overlay box - at rest, pushed down to show only title */
.s4w-prefooter__overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 2;
	padding: 52px 20px 60px 20px;
	transform: translateY(calc(100% - 110px));
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content container */
.s4w-prefooter__content {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Title: Override font-weight to book (450) and force uppercase */
.s4w-prefooter__title .s4w-title {
	font-weight: var(--weight-book);
	text-transform: uppercase;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Text: Max 3 lines with ellipsis */
.s4w-prefooter__text .s4w-text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Button wrapper */
.s4w-prefooter__button {
	margin-top: var(--spacing-sm, 16px);
}

/* Desktop hover: box slides up to reveal all content */
@media (hover: hover) and (min-width: 769px) {
	.s4w-prefooter__column:hover .s4w-prefooter__overlay {
		transform: translateY(0);
	}

	.s4w-prefooter__column:hover .s4w-prefooter__bg img {
		transform: scale(1.05);
	}
}

/* Gli stili del btn--link sono definiti globalmente in tokens.css */

/* ==========================================================================
   TABLET/INTERMEDIATE (<=1280px)
   ========================================================================== */
@media (max-width: 1280px) {
	.s4w-prefooter__content {
		gap: 15px;
	}
}

/* ==========================================================================
   TABLET (<=1024px)
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
	.s4w-prefooter__overlay {
		padding: 60px 20px 60px 20px;
		transform: translateY(calc(100% - 152px));
	}

	.s4w-prefooter__title .s4w-title {
		min-height: 2.2em;
	}

	.s4w-prefooter__content {
		gap: 25px;
	}

	.s4w-prefooter__column.is-active .s4w-prefooter__overlay {
		transform: translateY(0);
	}

	.s4w-prefooter__column.is-active .s4w-prefooter__bg img {
		transform: scale(1.05);
	}
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
	.s4w-prefooter__overlay {
		transition: none;
	}
}

/* ==========================================================================
   MOBILE (<=768px)
   ========================================================================== */

@media (max-width: 768px) {

	/* Stack columns vertically */
	.s4w-prefooter__grid {
		flex-direction: column;
	}

	.s4w-prefooter__column {
		flex: 0 0 100%;
		max-width: 100%;
		aspect-ratio: unset;
		overflow: visible;
		display: flex;
		flex-direction: column;
		position: relative;
	}

	/* L'immagine mantiene il suo aspect ratio occupando tutta la larghezza */
	.s4w-prefooter__bg {
		position: relative;
		width: 100%;
		aspect-ratio: 480 / 707;
		flex-shrink: 0;
	}

	.s4w-prefooter__bg img {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}

	/* Overlay esce dal posizionamento assoluto e fluisce sotto l'immagine */
	.s4w-prefooter__overlay {
		position: relative;
		bottom: unset;
		left: unset;
		right: unset;
		transform: none;
		padding: 52px 20px 60px 20px;
	}

}

/* ==========================================================================
   BLOCK PLACEHOLDER (Editor only)
   ========================================================================== */

.s4w-block-placeholder {
	padding: 40px 20px;
	text-align: center;
	background-color: var(--bg-weak-100);
	border: 2px dashed var(--text-soft-400);
	border-radius: 4px;
}

.s4w-block-placeholder p {
	margin: 0;
	color: var(--text-sub-500);
	font-size: var(--paragraph-small);
}