
#coverhome-container {
  position: relative;
  overflow: hidden;
  /* opzionale, se serve isolare il flusso: */
  contain: layout;
}

#home-cover .carousel,
#home-cover .carousel-slide,
#home-cover .cover-item {
  height: 100%;
}
.cover-carousel {
  display: grid;
  grid-template-columns: 50% 1fr;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
 height: clamp(400px, 70vh, 700px);
}
/* @media (min-width: 1921px) {
  .cover-carousel {
  height: clamp(400px, 60vh, 700px);
  };
} */
.cover-item {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  height: 100%;
}
.cover-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  aspect-ratio: 1 / 2; /* Per l'immagine verticale */
}
.column-right .cover-item img {
  aspect-ratio: 2 / 1; /* Immagini orizzontali */
}
.cover-item:hover img {
  transform: scale(1.05);
}
.cover-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
}
.cover-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.cover-subtitle {
  font-size: 16px;
  margin-bottom: 16px;
  opacity: 0.9;
}
.cover-btn {
  display: inline-block;
  padding: 12px 24px;
  background: #fff;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.3s ease;
}
.cover-btn:hover {
  background: #f0f0f0;
}
.column-right {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}
.carousel {
  position: relative;
  width: 100%;
  height: 100%;
}
.carousel-slide {
  display: none;
  width: 100%;
  height: 100%;
}
.carousel-slide.active {
  display: block;
}
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: #fff;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s ease;
}
.carousel-nav:hover {
  background: rgba(255, 255, 255, 0.5);
}
.carousel-prev {
  left: 20px;
}
.carousel-next {
  right: 20px;
}
.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s ease;
}
.dot.active {
  background: #fff;
}
#home-cover .carousel {
  position: relative;
  overflow: hidden;
}
#home-cover .carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
  pointer-events: none;
}
#home-cover .carousel-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
#home-cover .carousel-slide {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}
#home-cover .carousel-slide.active {
  opacity: 1;
}

@media (max-height: 600px) and (orientation: landscape) {
  .cover-carousel {
    height: clamp(300px, 55vh, 500px);
  }
}

@media (max-width: 768px) {
  .cover-carousel {
    grid-template-columns: 1fr;
    height: auto;
  }
  .cover-item {
    height: clamp(360px, 40vh, 500px);
  }
  .cover-title {
    font-size: 22px;
  }
}
