/* ==========================================================================
   GALLERIA CSS - B&B MY SUNSHINE
   ========================================================================== */

/* 1. SEZIONE E CONTENITORE PRINCIPALE */
.gallery-section {
  padding: 50px 20px;
  background-color: #f9f9f9;
  min-height: 80vh;
}

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-section h2 {
  font-size: 2.2rem;
  color: #222222;
  margin-bottom: 8px;
}

.gallery-subtitle {
  color: #717171;
  font-size: 1.1rem;
  margin-bottom: 30px;
}

/* 2. FILTRI PER STANZA (PULSANTI IN ALTO) */
.gallery-filters {
  display: flex;
  gap: 12px;
  overflow-x: auto; /* Permette lo scorrimento orizzontale fluido su smartphone */
  padding-bottom: 12px;
  margin-bottom: 30px;
  -webkit-overflow-scrolling: touch;
}

/* Nasconde la barra di scorrimento orizzontale antiestetica */
.gallery-filters::-webkit-scrollbar {
  display: none;
}
.gallery-filters {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-btn {
  background: #ffffff;
  border: 1px solid #dddddd;
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #333333;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.filter-btn:hover {
  border-color: #f39c12;
  color: #f39c12;
}

.filter-btn.active {
  background-color: #f39c12;
  color: #ffffff;
  border-color: #f39c12;
  box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
}

/* 3. GRIGLIA LAYOUT STILE AIRBNB */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Layout Desktop (Griglia asimmetrica) */
@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
  }

  .gallery-item.item-large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* SINGOLO ELEMENTO FOTO */
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  background-color: #e0e0e0;
}

.gallery-item.item-large {
  height: 100%; /* Si adatta alla griglia nei PC */
}

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

/* Effetto Zoom al passaggio del mouse */
.gallery-item:hover img {
  transform: scale(1.06);
}

/* ETICHETTA DELLA STANZA SOPRA L'IMMAGINE */
.room-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  color: #222222;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

/* 4. CLASSE UTILITY JS PER NASCONDERE GLI ELEMENTI FILTRATI */
.gallery-item.hidden {
  display: none !important;
}

/* 5. STILI LIGHTBOX MODAL (VISUALIZZAZIONE A SCHERMO INTERO) */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 85%;
  max-height: 85vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

.lightbox-caption {
  color: #ffffff;
  margin-top: 15px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* CONTROLLI LIGHTBOX (PULSANTI) */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s ease;
  line-height: 1;
}

.lightbox-close:hover {
  color: #f39c12;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  font-size: 28px;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s ease, color 0.3s ease;
  user-select: none;
  z-index: 1001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #222222;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* 6. RESPONSIVE PER SMARTPHONE */
@media (max-width: 768px) {
  .gallery-section {
    padding: 30px 15px;
  }

  .gallery-section h2 {
    font-size: 1.8rem;
  }

  .gallery-subtitle {
    font-size: 1rem;
  }

  .lightbox-prev {
    left: 10px;
    padding: 8px 14px;
    font-size: 22px;
  }

  .lightbox-next {
    right: 10px;
    padding: 8px 14px;
    font-size: 22px;
  }

  .lightbox-close {
    top: 15px;
    right: 20px;
    font-size: 35px;
  }
}
