/* =========================================================
   GALLERY & LIGHTBOX STYLESHEET (LCPH Album Gallery V3)
   ========================================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8f9fa;
  color: #333;
}

.radius-0 {
  border-radius: 0 !important;
}

/* Griglia Immagini */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 260px) {
  .gallery-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  background-color: #000;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), filter 0.3s ease;
  will-change: transform;
}

/* Effetto Zoom Interno al passaggio del mouse */

.gallery-item:hover img {
  transform: scale(1.08);
}

/* Lightbox Modal Overlay */

.lightbox-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1.5rem;
}

@media (max-width: 576px) {
  .lightbox-modal {
    padding: 0.75rem;
  }
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Container principale del lightbox */

.lightbox-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1280px;
  max-height: 85vh;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  position: relative;
  z-index: 10001;
}

@media (max-width: 991px) {
  .lightbox-container {
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Pulsante di chiusura */

.close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10020;
  width: 38px;
  height: 38px;
  background: #ffffff;
  border: 1px solid #fff !important;
  color: #000000;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #000000;
  color: #ffffff;
}

/* Area Media / Immagine */

.lightbox-media {
  position: relative;
  flex: 1 1 65%;
  background-color: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 1.5rem 1rem;
  min-height: 260px;
}

@media (max-width: 991px) {
  .lightbox-media {
    padding-top: 3.5rem;
    padding-bottom: 2.25rem;
    overflow: visible;
  }
}

.lightbox-content {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 991px) {
  .lightbox-content {
    max-height: 45vh;
  }
}

/* Pulsanti Navigazione Precedente / Successiva */

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10005;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #000000;
  color: #000000;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: #000000;
  color: #ffffff;
}

.prev-btn {
  left: 1rem;
}

.next-btn {
  right: 1rem;
}

/* Spostate subito sotto la foto */

@media (max-width: 991px) {
  .nav-btn {
    top: calc(100% - 22px);
    transform: none;
  }
}

@media (max-width: 991px) {
  .prev-btn {
    left: 1.25rem;
  }
}

@media (max-width: 991px) {
  .next-btn {
    right: 1.25rem;
  }
}

/* Colonna Informazioni & EXIF */

.lightbox-info {
  flex: 0 0 35%;
  min-width: 300px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #ffffff;
  border-left: 1px solid #f0f0f0;
}

@media (max-width: 991px) {
  .lightbox-info {
    flex: 1 1 auto;
    border-left: none;
    border-top: 1px solid #f0f0f0;
    padding: 1.5rem 1.25rem 1.25rem;
  }
}

.photo-title {
  font-family: 'Volkhov', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111111;
  margin: 0 0 1.25rem 0;
  line-height: 1.3;
}

/* Griglia Dati EXIF */

.exif-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: #f9f9f9;
  padding: 1rem;
  border: 1px solid #eeeeee;
}

.exif-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exif-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.exif-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.exif-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666666;
  font-weight: 600;
}

.exif-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111111;
}

/* Copyright */

.copyright-container {
  margin-bottom: 1.25rem;
}

.photo-copyright {
  font-size: 0.8rem;
  color: #777777;
  font-style: italic;
  display: block;
}

/* Bottone Vai alla pagina completa */

.btn-full-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #000000;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #000000;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-full-page:hover {
  background-color: #ffffff;
  color: #000000;
}

.btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Ottimizzazioni specifiche per display stretti (< 380px) */

@media (max-width: 380px) {
  .lightbox-info {
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 380px) {
  .photo-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 380px) {
  .exif-grid {
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 380px) {
  .exif-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 380px) {
  .exif-value {
    font-size: 0.8rem;
  }
}

@media (max-width: 380px) {
  .photo-copyright {
    font-size: 0.75rem;
  }
}

@media (max-width: 380px) {
  .btn-full-page {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    padding: 0.6rem 0.5rem;
    gap: 0.35rem;
  }
}

@media (max-width: 380px) {
  .btn-icon {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 380px) {
  .nav-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
    top: calc(100% - 18px);
  }
}

@media (max-width: 380px) {
  .close-btn {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}

