/* ==========================================================================
   Hotel Kapriol — Galleria a schermo intero (lightbox)
   Si apre cliccando sulle foto delle gallerie marcate con data-lightbox.
   ========================================================================== */

/* Segnale che l'immagine è cliccabile */
.gallery[data-lightbox] { cursor: zoom-in; }

.gallery__zoom {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 3;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34, 27, 18, .45);
  border: 1px solid rgba(245, 239, 227, .35);
  border-radius: 50%;
  color: var(--on-dark);
  cursor: zoom-in;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.gallery:hover .gallery__zoom,
.gallery__zoom:focus-visible { opacity: 1; }
.gallery__zoom:hover { background: var(--pine); }
.gallery__zoom svg { width: 19px; height: 19px; }
/* Sui dispositivi touch l'hover non esiste: l'icona resta sempre visibile */
@media (hover: none) { .gallery__zoom { opacity: .9; } }
@media (max-width: 720px) { .gallery__zoom { opacity: .9; } }

/* --- Sovrapposizione --- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(14px, 3vw, 30px);
  background: rgba(20, 15, 10, .94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ease-out), visibility 0s 300ms;
}
.lb.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms var(--ease-out);
}

.lb__head {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--on-dark);
}
.lb__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 600;
}
.lb__counter {
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  color: rgba(245, 239, 227, .7);
}

/* --- Palco immagine --- */
.lb__stage {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.lb__stage picture { display: contents; }
.lb__stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
  animation: lbIn 380ms var(--ease-out);
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* --- Comandi --- */
.lb__btn {
  display: flex; align-items: center; justify-content: center;
  background: rgba(245, 239, 227, .1);
  border: 1px solid rgba(245, 239, 227, .3);
  border-radius: 50%;
  color: var(--on-dark);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.lb__btn:hover { background: var(--pine); border-color: var(--pine); }
.lb__btn svg { width: 22px; height: 22px; }

.lb__close { width: 46px; height: 46px; flex: none; }
.lb__close svg { width: 19px; height: 19px; }

.lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  z-index: 2;
}
.lb__nav--prev { left: 0; }
.lb__nav--next { right: 0; }

/* --- Miniature --- */
.lb__thumbs {
  display: flex;
  gap: 8px;
  max-width: 100%;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.lb__thumbs::-webkit-scrollbar { display: none; }
.lb__thumb {
  flex: none;
  width: 84px; height: 62px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: .5;
  transition: opacity var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.lb__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb__thumb:hover { opacity: .85; }
.lb__thumb.is-active { opacity: 1; border-color: var(--honey); }

@media (max-width: 640px) {
  .lb__nav { width: 44px; height: 44px; }
  .lb__nav--prev { left: -6px; }
  .lb__nav--next { right: -6px; }
  .lb__thumb { width: 66px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .lb { transition: none; }
  .lb__stage img { animation: none; }
}
