.header-section {
    display: flex;
    flex-wrap: wrap;
}

.header-section > div {
    width: calc(100% / 3);
}

@media (max-width: 768px) {
    .header-section > div {
        width: 100%;
        text-align: center;
    }
}

body {
  margin: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #111;
  color: #eee;
  line-height: 1.6;
}

header {
  background: #000;
  padding: 15px;
  text-align: center;
  position: sticky;
  top: 0;
}
	
nav a {
  color: #eee;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
  transition: color 0.3s;
}

nav a:hover {
  color: #aaa;
}

/* --- ICONA SVG TORNA SU --- */
.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #555;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  transition: all 0.3s ease;
}

.back-to-top svg {
  width: 14px;
  height: 14px;
  fill: #fff;
  transition: fill 0.3s ease;
}

.back-to-top:hover {
  background: linear-gradient(135deg, #ff9800, #ff5722);
  transform: translateY(-2px);
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
}

.back-to-top:hover svg {
  fill: #fff;
}

/* --- CONTAINER TITOLO + ICONA --- */
.section-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.hero {
  height: 90vh;
  background: url('img/hero.jpeg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
  filter: grayscale(100%);
}

.hero .overlay {
  background: rgba(0,0,0,0.5);
  padding: 40px;
}

.hero h1 {
  font-size: 3em;
  margin: 0;
}

.about, .gallery, .contact {
  padding: 60px 20px;
  max-width: 1200px;
  margin: auto;
}

h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2em;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.grid img {
/*  width: 100%;
  filter: grayscale(100%);
  transition: transform 0.3s, filter 0.3s;
  cursor: pointer;*/
  width: 100%;
  filter: grayscale(100%);
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}

.grid img:hover {
  transform: scale(1.05);
  transform: perspective(600px) rotateY(10deg) scale(1.05);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  filter: grayscale(0%);
}

/* Animazione di fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

form {
  display: flex;
  flex-direction: column;
}

form label {
  margin: 10px 0 5px;
}

form input, form textarea, form button {
  padding: 10px;
  border: none;
  border-radius: 5px;
}

form input, form textarea {
  background: #222;
  color: #eee;
}

form button {
  margin-top: 15px;
  background: #555;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}

form button:hover {
  background: #777;
}

footer {
  text-align: center;
  background: #000;
  color: #aaa;
  padding: 15px;
  margin-top: 30px;
}

/* Lightbox 
#lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 20px rgba(255,255,255,0.5);
}*/



/* Lightbox migliorato */
#lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

#lightbox img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
  transform: scale(0.95);
  transition: transform 0.4s ease;
}

#lightbox img:hover {
  transform: scale(1);
}

#close {
  position: absolute;
  top: 30px;
  right: 50px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
}


.img-card {
  position: relative;
  width: 300px;
  height: 200px;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(191,191,191,0.3);
  cursor: pointer;
  margin-bottom: 80px; /* spazio per il tooltip */
}

.img-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.img-card:hover img {
  transform: scale(1.25);
}

/* Tooltip in basso */
.img-card::after {
  content: attr(data-caption);
  position: absolute;
  top: 100%; /* sotto l'immagine */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(191, 191, 191, 0.65);
  color: #000;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  width: 300px; /* larghezza fissa */
  max-width: 90vw; /* responsiva su schermi piccoli */
  text-align: center;
  z-index: 10;
}

.img-card[data-caption=""]::after {
  display: none;
}

.img-card:hover::after {
  opacity: 1;
}


header {
  transition: top 0.3s;
}
header.hide-header {
  top: -100px;
}

.bold-text {
  font-weight: bold;
}

.servizio-titolo {
  margin-bottom: 4px; /* riduce lo spazio sotto il titolo */
}

.servizio-descrizione {
  margin-top: 0; /* elimina lo spazio sopra la descrizione */
  line-height: 1.4; /* regola l’interlinea del paragrafo */
}