/**
 * Interactive Image Links Widget Styles
 */

/* ======================
   Main Container
   ====================== */
.iil-widget {
	display: flex;
	position: relative;
	width: 100%;
	overflow: hidden;
}

/* ======================
   Links Section
   ====================== */
.iil-links {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: relative;
	z-index: 2;
}

/* Header section - aligned at top */
.iil-header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin-bottom: auto;
}

.iil-header-title {
	margin: 0;
}

.iil-header-description {
	margin: 0;
}

.iil-header-button {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
}

/* Links list - aligned at bottom */
.iil-links-list {
	display: flex;
	flex-direction: column;
	margin-top: auto;
}

.iil-link-item {
	position: relative;
	display: block;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.3s ease;
	overflow: hidden;
}

/* Border animato a sinistra */
.iil-link-item::before {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 2px;
	height: 0;
	background-color: currentColor;
	transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.iil-link-item:hover::before,
.iil-link-item.iil-active::before {
	height: 100%;
}

.iil-link-title {
	display: block;
	transition: color 0.3s ease;
}

/* ======================
   Images Section
   ====================== */
.iil-images {
	position: relative;
	overflow: hidden;
}

.iil-image-item {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0;
	clip-path: inset(0 100% 0 0);
	transition: clip-path 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prima immagine visibile di default */
.iil-image-item.iil-active {
	opacity: 1;
	clip-path: inset(0 0 0 0);
	z-index: 2;
}

/* Immagine precedente che esce */
.iil-image-item.iil-prev {
	opacity: 1;
	clip-path: inset(0 0 0 0);
	z-index: 1;
}

/* ======================
   Responsive - Mobile
   ====================== */
@media (max-width: 768px) {
	.iil-widget {
		flex-direction: column;
		min-height: auto !important;
	}

	.iil-links,
	.iil-images {
		flex: 0 0 auto !important;
		width: 100% !important;
		order: initial !important;
	}

	.iil-images {
		min-height: 300px;
		order: 1 !important;
	}

	.iil-links {
		order: 2 !important;
	}

	.iil-image-item {
		position: absolute;
	}

	/* Su mobile il primo tap attiva, il secondo va al link */
	.iil-link-item {
		-webkit-tap-highlight-color: transparent;
	}
}

/* ======================
   Tablet
   ====================== */
@media (min-width: 769px) and (max-width: 1024px) {
	.iil-widget {
		flex-wrap: nowrap;
	}
}

/* ======================
   Animazioni aggiuntive
   ====================== */

/* Smooth transition per tutti gli elementi */
.iil-link-item,
.iil-link-item::before,
.iil-link-title,
.iil-image-item {
	will-change: transform, opacity, clip-path;
}

/* Preload delle immagini */
.iil-image-item {
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}
