.autocomplete {
    position: relative;
    display: inline-block;
  }
  
  input {
    border: 1px solid transparent;
    background-color: #f1f1f1;
    padding: 10px;
    font-size: 16px;
  }
  
  input[type=text] {
    background-color: #f1f1f1;
    width: 100%;
  }
  
  input[type=submit] {
    background-color: DodgerBlue;
    color: #fff;
    cursor: pointer;
  }
  
  .autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    /*position the autocomplete items to be the same width as the container:*/
    top: 100%;
    left: 0;
    right: 0;
  }
  
  .autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff; 
    border-bottom: 1px solid #d4d4d4; 
  }

  .autocomplete-items div:hover {
    background-color: #e9e9e9; 
  }

  .autocomplete-active {
    background-color: DodgerBlue !important; 
    color: #ffffff; 
  }

  .t30perc {padding-top: 30%; }

.h1pad30  {padding-bottom: 30px; }

.nice-select { float: inherit!important; }

/* ===== SEZIONE GALLERY ===== */
.gallery-section {
  padding: 60px 0;
  text-align: center;
}

.gallery-title {
  font-size: 2.2em;
  margin-bottom: 30px;
  font-weight: 600;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== FILTRI ===== */
.gallery-filters {
  list-style: none;
  padding: 0;
  margin-bottom: 40px;
}

.gallery-filters li {
  display: inline-block;
  padding: 8px 18px;
  margin: 0 6px;
  border: 1px solid #ccc;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95em;
}

.gallery-filters li.active,
.gallery-filters li:hover {
  background: #000;
  color: #fff;
}

/* ===== GRIGLIA GENERICA ===== */
.gallery-grid {
  display: grid;
  gap: 30px;
  padding: 0 20px;
  justify-items: center;
}

/* Versione 3 colonne (usata per la gallery sopra) */
.gallery-grid.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

/* Versione 4 colonne (usata per la gallery sotto) */
.gallery-grid.four-cols {
  grid-template-columns: repeat(4, 1fr);
}

/* ===== ITEM ===== */
.gallery-item {
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;

}
.gallery-item-3 {
   max-width: 400px;
}

/* ===== IMMAGINI ===== */
.gallery-item a {
  display: block;
  width: 100%;
  height: 300px; /* altezza fissa */
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ===== TESTO SOTTO ===== */
.caption {
  text-align: center;
  padding: 14px 10px 20px;
  font-size: 1em;
  color: #111;
  font-weight: 500;
  line-height: 1.3em;
}

.caption small {
  display: block;
  font-size: 0.85em;
  color: #777;
  margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .gallery-grid.three-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid.four-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-grid.three-cols,
  .gallery-grid.four-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item a {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .gallery-grid.three-cols,
  .gallery-grid.four-cols {
    grid-template-columns: 1fr;
  }
  .gallery-item a {
    height: 200px;
  }
}