/* =========================================================
   PAGINA GALLERIA – HEADER PICCOLO
   ========================================================= */

body {
  background-color: #eae0c3;
}

/* Hero della galleria: sfondo trasparente,
   niente gradiente giallino/azzurro */
.hero.hero--small {
  background: none !important;
  background-image: none !important;
  background-color: transparent !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.hero.hero--small .hero-overlay {
  display: none !important;
}

/* Nav-bar appoggiata direttamente sulla foto di sfondo */
.nav-bar {
  background: transparent !important;
  box-shadow: none !important;
}

/* =========================================================
   SEZIONE GALLERIA – FOTO DI SFONDO + SFUMATURA AZZURRA
   ========================================================= */

.gallery-section {
  position: relative;
  padding: 70px 0 80px;

  /* Foto di sfondo desktop */
  background-image: url("../images/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  min-height: 100vh;
}

/* Velo azzurro sopra la foto, che rimane anche scorrendo */
.gallery-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background: linear-gradient(
      to bottom,
      rgba(135, 207, 224, 0.80) 0%,   /* più intensa in alto */
      rgba(135, 207, 224, 0.65) 25%,
      rgba(135, 207, 224, 0.55) 50%,
      rgba(135, 207, 224, 0.50) 75%,
      rgba(135, 207, 224, 0.45) 100%  /* resta azzurra anche in basso */
  );
}

/* Contenuto sopra foto + sfumatura */
.gallery-section > .container,
.gallery-header,
.gallery-grid {
  position: relative;
  z-index: 1;
}

.gallery-header {
  text-align: center;
  margin-top: 170px;   /* 🔥 Aggiunto: abbassa il titolo */
  margin-bottom: 40px;
}

.gallery-title {
  font-family: "Splash";
  font-size: clamp(3.4rem, 5vw, 4.2rem);
  margin: 0 0 10px;
}

.gallery-subtitle {
  margin: 0;
  font-size: 1.65rem;
  font-family: "Dancing script", sans-serif;
  line-height: 1.7;
  max-width: 640px;
  margin-inline: auto;
}

/* =========================================================
   GRID FOTO
   ========================================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* Cornice + ombra elegante */
.gallery-item {
  position: relative;
  cursor: pointer;

  padding: 6px;
  border-radius: 14px;
  overflow: hidden;
  background: #c99e42;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  transition:
    transform 0.35s ease,
    filter 0.35s ease,
    opacity 0.35s ease;
}

/* Hover con zoom + contrasto + sollevamento */
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: contrast(1.05) saturate(1.03);
}

/* Luce sopra foto */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.25), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* =========================================================
   DISATTIVA ANIMAZIONI DI SCROLL NELLA GALLERIA
   (altre sezioni del sito restano animate)
   ========================================================= */

.gallery-section .gallery-header,
.gallery-section .gallery-grid,
.gallery-section .gallery-item {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.lightbox__image {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 2.2rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.lightbox__arrow--prev {
  left: 12px;
}

.lightbox__arrow--next {
  right: 12px;
}

.lightbox__arrow:hover,
.lightbox__close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding: 40px 0 50px;

    /* sfondo mobile: foto verticale */
    background-image: url("../images/bg-mob.png");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: scroll;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-subtitle {
    font-size: 1.6rem;
    padding: 0 12px;
  }

  .lightbox__arrow,
  .lightbox__close {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}