/* ================= RESET BASE ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

body {
  line-height: 1.6;
  color: #333;
  scroll-behavior: smooth;
}

/* ================= MENU NAV ================= */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(34,34,34,0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  z-index: 100;
}

nav .logo {
  color: #fff;
  font-size: 1.3rem;
  font-weight: bold;
}

nav .menu {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav .menu li a {
  color: #fff;
  font-weight: 500;
  transition: color 0.3s;
}

nav .menu li a:hover {
  color: #ffd700;
}

/* ================= HOME HEADER MODERNO ================= */
.home-header {
  position: relative;
  height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  margin-top: 0;
}

/* HERO IMAGE SOTTO IL NOME */
.home-header .hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(5px) brightness(0.6);
  z-index: 1;
}

/* OVERLAY VETRO */
.home-header .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  z-index: 2;
}

/* TESTO SOPRA L'IMMAGINE */
.home-header .header-content {
  position: relative;
  z-index: 3;
  color: #ffffff; /* colore come il footer */
  text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
}

.home-header h1 {
  font-size: 3rem;
  margin-bottom: 15px;
}

.home-header p {
  font-size: 1.3rem;
  margin: 0;
}

/* ================= SEZIONE STORIA ================= */
.storia {
  max-width: 900px;
  margin: 50px auto;
  padding: 0 20px;
  text-align: center;
}

.storia h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: #444;
}

.storia p {
  font-size: 1.1rem;
  color: #666;
}

/* ================= SEZIONE SERVIZI ================= */
.servizi {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin: 50px 0;
  padding: 0 20px;
}

.servizio {
  position: relative;
  flex: 1 1 250px;
  max-width: 320px;
  overflow: hidden;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.4s, box-shadow 0.4s;
}

.servizio img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s, filter 0.4s;
}

.servizio:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px 0;
  text-align: center;
  font-size: 1.5rem;
  color: #fff;
  font-weight: bold;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
}

/* ================= FOOTER SEMPRE IN FONDO ================= */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* ================= FOOTER MODERNO ================= */
footer {
  background-color: #222;
  color: #fff;
  text-align: center;
  padding: 40px 20px;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

footer p {
  margin: 0;
}

footer a {
  color: #ffd700;
  text-decoration: none;
  transition: color 0.3s;
}

footer a:hover {
  color: #fff;
}

footer .footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-bottom: 15px;
}

footer .footer-top div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

footer .footer-bottom {
  font-size: 0.85rem;
  color: #aaa;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .home-header h1 { font-size: 2.5rem; }
  .home-header p { font-size: 1.1rem; }

  .servizi {
    flex-direction: column;
    align-items: center;
  }

  .servizio img {
    height: 220px;
  }

  nav {
    padding: 8px 15px;
  }

  nav .menu {
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav .menu li a {
    font-size: 0.85rem;
    padding: 5px 8px;
  }

  nav .logo {
    font-size: 1.1rem;
  }

  footer {
    padding: 30px 15px;
  }

  footer .footer-top {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .home-header h1 { font-size: 2rem; }
  .home-header p { font-size: 1rem; }

  .servizio img { height: 180px; }

  nav .menu li a { font-size: 0.8rem; padding: 4px 6px; }
  nav .logo { font-size: 1rem; }
}


/* ================= ALBUM MASONRY ================= */
.album {
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 20px;
  text-align: center;
}

.album h2 {
  margin-bottom: 30px;
  font-size: 2rem;
  color: #555;
}

.foto-album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 10px; /* altezza base piccola, JS calcola lo span */
  gap: 15px;
}

.foto-album a {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.foto-album img {
  width: 100%;
  display: block;
  transition: transform 0.4s, filter 0.4s;
}

.foto-album img:hover {
  transform: scale(1.05);
  filter: brightness(0.85);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .foto-album {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .foto-album {
    grid-template-columns: 1fr;
  }
}