@charset "utf-8";
/* CSS Document */
:root {
  --center-w: 38%;
  --side-w:   22%;
  --center-h: 800px;
  --side-h:   500px;
}

/* ── GALLERY WRAPPER ── */
.gallery-section {
  position: relative;
  overflow: hidden;
  padding: 0;
  user-select: none;
}

.gallery-track-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Track */
.gallery-track {
  display: flex;
  align-items: center;
  gap: 0;
  transition: transform 0.55s cubic-bezier(0.77, 0, 0.18, 1);
  will-change: transform;
}

/* ── ITEMS ── */
.gallery-item {
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.gallery-item.side {
  width: var(--side-w);
  height: var(--side-h);
  opacity: 0.55;
  transform: scale(0.96);
}

.gallery-item.center {
  width: var(--center-w);
  height: var(--center-h);
  opacity: 1;
  transform: scale(1);
  z-index: 2;
  cursor: zoom-in;
}

.gallery-item.far {
  width: var(--side-w);
  height: var(--side-h);
  opacity: 0;
  pointer-events: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ── SCRUBBER ── */
.gallery-scrubber {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 28px auto 0;
  width: 60%;
  max-width: 500px;
  position: relative;
}

.scrubber-arrows {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #aaa8a0;
  border-radius: 20px;
  padding: 4px 10px;
  background: transparent;
  flex-shrink: 0;
  z-index: 2;
}

.scrubber-arrows button {
  background: none;
  border: none;
  padding: 2px 5px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  line-height: 1;
  transition: color 0.2s;
}
.scrubber-arrows button:hover { color: #000; }

.scrubber-arrows span {
  width: 1px;
  height: 12px;
  background: #aaa;
  display: inline-block;
  margin: 0 2px;
}

.scrubber-track {
  flex: 1;
  height: 1px;
  background: #aaa8a0;
  position: relative;
  margin-left: -1px;
  cursor: pointer;
}

.scrubber-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: #555;
  border-radius: 2px;
  transition: left 0.55s cubic-bezier(0.77, 0, 0.18, 1), width 0.55s ease;
  pointer-events: none;
}

/* ── LIGHTBOX ── */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox.active { display: flex; }

/* lightbox-inner: contiene tutto — close, nav e img sono DENTRO */
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-inner img {
  max-width: 90vw;
  max-height: 92vh;
  object-fit: contain;
  display: block;
}

/* Chiudi — angolo in alto a destra, sovrapposto all'immagine */
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  line-height: 1;
}
.lightbox-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.7); }

/* Frecce nav — sovrapposte ai lati dell'immagine */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  border: none;
  color: #fff;
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
  line-height: 1;
}
.lightbox-nav:hover { background: rgba(0, 0, 0, 0.65); }

/* dentro l'immagine, non fuori */
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }

/* ── MOBILE ── */
@media (max-width: 767px) {
  :root {
    --center-w: 90vw;
    --center-h: 70vw;
    --side-w:   0px;
    --side-h:   0px;
  }

  .gallery-item.side,
  .gallery-item.far {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  .gallery-item.center {
    width: 90vw;
    height: 70vw;
    margin: 0 auto;
  }

  .gallery-track {
    justify-content: center;
  }

  .gallery-scrubber {
    width: 85%;
  }
}
