/* =======================================================
   FOTO - Album Grid e Lightbox Gallery
   ======================================================= */

/* Container più largo per galleria */
.section-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Grid album: 3 colonne su desktop */
.photo-albums-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .photo-albums-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .photo-albums-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Album Card */
.album-card {
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform .2s ease, box-shadow .2s ease;
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Cover foto */
.album-cover {
  position: relative;
  width: 100%;
  height: 300px;
  background-size: cover;
  background-position: center;
  background-color: #f0f0f0;
}

.album-empty {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Overlay scuro su hover */
.album-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  transition: background .2s ease;
}

.album-card:hover .album-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
}

/* Info album */
.album-info {
  color: #fff;
  width: 100%;
}

.album-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.album-meta {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Bottone chiusura */
.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 50px;
  height: 50px;
  z-index: 3;
  transition: transform .2s ease;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

/* Area principale foto */
.lightbox-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Frecce navigazione */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: none;
  font-size: 3rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, transform .2s ease;
  color: #333;
  line-height: 1;
  padding: 0;
}

.lightbox-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-nav:disabled:hover {
  transform: translateY(-50%) scale(1);
}

/* Info sotto la foto */
.lightbox-info {
  text-align: center;
  color: #fff;
  margin-bottom: 15px;
}

.lightbox-album-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.lightbox-counter {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0 0 8px 0;
}

.lightbox-caption {
  font-size: 1rem;
  margin: 0;
  font-style: italic;
  opacity: 0.9;
}

/* Thumbnail strip */
.lightbox-thumbnails {
  display: flex;
  gap: 10px;
  justify-content: center;
  overflow-x: auto;
  padding: 10px 0;
  max-width: 100%;
}

.lightbox-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity .2s ease, transform .2s ease;
  flex-shrink: 0;
  border: 3px solid transparent;
}

.lightbox-thumbnail:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.lightbox-thumbnail.active {
  opacity: 1;
  border-color: var(--color-accent, #C9A227);
  transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
  .lightbox-nav {
    width: 50px;
    height: 50px;
    font-size: 2rem;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  
  .lightbox-close {
    top: -40px;
    font-size: 2.5rem;
  }
  
  .lightbox-thumbnail {
    width: 60px;
    height: 60px;
  }
}