@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portfolio-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
  background-color: blue;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.portfolio-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.portfolio-item:hover img {
  transform: scale(1.4);
}

.portfolio-info {
  position: absolute;
  padding: 5%;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgb(0, 0, 255, 1);
  color: white;
  transform: translateY(100%);
  transition: transform 0.5s ease;
}

.portfolio-info h3 {
  padding-bottom: 3%;
}

.portfolio-item:hover .portfolio-info {
  transform: translateY(0);
}

.portfolio-container-sfumato {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 50px 20px 100px 20px;
  background: linear-gradient(180deg, blue, white);
  background: linear-gradient(0deg, white, rgb(27, 121, 179) 80%, blue);
}

.portfolio-container-sfumato .portfolio-info {
  position: absolute;
  padding: 5%;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  color: black;
  transform: translateY(100%);
  transition: transform 0.5s ease;
}

@media (max-width: 768px) {
  .portfolio-container {
    grid-template-columns: 1fr;
  }

  .portfolio-item {
    display: block;
  }
  
  /* Rimuovo l'effetto hover sull'immagine */
  .portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: none;
  }
  
  /* Rendo il contenitore info parte del flusso del documento */
  .portfolio-info {
    position: static; /* da absolute a static */
    transform: none;  /* rimuovo la trasformazione */
    background: white;
    color: black;
    padding: 5%;
    margin-top: 10px; /* per separarlo dall'immagine */
  }

  .portfolio-container-sfumato .portfolio-info {
    position: static;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    color: black;
    transform: none;
  }
}

