.image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 125%; /* mobile ratio */
  overflow: hidden;
}

@media (min-width: 768px) {
  .image-wrapper {
    padding-top: 0;
    height: 700px; /* altezza massima desktop controllata */
  }
}

.img-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hide-nav {
  transform: translateY(-100%);
}

.show-nav {
  transform: translateY(0);
  transition: transform 0.3s ease-in-out;
}

.hamburger-top,
.hamburger-middle,
.hamburger-bottom {
  transition: all 0.3s ease-in-out;
}

.open .hamburger-top {
  transform: rotate(45deg) translateY(6px) translateX(6px);
}

.open .hamburger-middle {
  opacity: 0;
}

.open .hamburger-bottom {
  transform: rotate(-45deg) translateY(-6px) translateX(6px);
}

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
  max-height: 500px;
}

html {
  scroll-behavior: smooth;
}

.underline-custom {
  position: relative;
}

.underline-custom::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 3px;
  bottom: -8px;
  left: 0;
  background-color: #15803d;
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #15803d;
  transition: width 0.3s ease-in-out;
}

.nav-link:hover::after {
  width: 100%;
}

.dark body {
  background-color: #1a1a1a;
  color: #f3f3f3;
}

.dark .bg-white {
  background-color: #1e1e1e !important;
}

.dark .text-gray-800,
.dark .text-gray-700,
.dark .text-gray-600 {
  color: #ddd !important;
}

.dark .bg-gray-100 {
  background-color: #2a2a2a !important;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background-color: #ccc;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: inline-block;
  flex-shrink: 0;
}

.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.3s;
}

.dark .toggle-switch {
  background-color: #4b5563;
}

.dark .toggle-switch::before {
  transform: translateX(24px);
}

.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.carousel-images,
.carousel-slide {
  height: 100% !important;
  width: 100%;
}

.carousel-slide {
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.project-carousel .carousel-images {
  height: 100% !important;
}

.project-carousel .carousel-slide {
  height: 100% !important;
  width: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

#fase-costruzione-carousel.project-carousel {
  height: 400px;
}
