/* ============================================================
   SCALA VISTA — GALLERY
   Caricare dopo style.css e pages.css
   ============================================================ */

/* Hero fotografica */
.gallery-page .gallery-hero .page-hero-media {
  object-position: center center;
}

/* Breve introduzione tra hero e griglia */
.gallery-page .gallery-lead {
  padding: clamp(4.5rem, 7vw, 7rem) 0;
}

.gallery-page .gallery-lead-grid {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: clamp(3rem, 8vw, 9rem);
  align-items: start;
}

.gallery-page .gallery-lead .eyebrow {
  margin-top: .35rem;
}

.gallery-page .gallery-lead-copy {
  max-width: 720px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 1.8vw, 1.65rem);
  line-height: 1.35;
}

.gallery-page .gallery-wall {
  width: min(94vw, 1680px);
  margin: 0 auto clamp(7rem, 11vw, 11rem);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(.8rem, 1.4vw, 1.5rem);
}

.gallery-page .gallery-item {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: var(--dark);
  cursor: zoom-in;
}

.gallery-page .gallery-item-tall {
  grid-column: span 5;
  aspect-ratio: 4 / 5;
}

.gallery-page .gallery-item-wide {
  grid-column: span 7;
  aspect-ratio: 4 / 3;
}

.gallery-page .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease), opacity .4s ease;
}

.gallery-page .gallery-item > span {
  position: absolute;
  left: 1.35rem;
  bottom: 1.25rem;
  color: rgba(255,255,255,.86);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
}

@media (hover:hover) and (pointer:fine) {
  .gallery-page .gallery-item:hover img {
    transform: scale(1.025);
    opacity: .92;
  }
}

.gallery-page .gallery-message {
  padding: clamp(8rem, 14vw, 14rem) 0;
}

.gallery-page .gallery-message h2 {
  max-width: 1100px;
  margin: 0;
  font-size: clamp(4rem, 7.2vw, 8.2rem);
  line-height: .86;
  font-weight: 500;
  letter-spacing: -.065em;
}

.gallery-page .gallery-message h2 span {
  display: block;
  margin-left: 16%;
}

.gallery-page .gallery-message p:not(.eyebrow) {
  max-width: 510px;
  margin: 2rem 0 2.5rem;
  color: rgba(255,255,255,.75);
}

/* Lightbox */
.gallery-page .lightbox {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 5vw;
  background: rgba(15,15,14,.96);
}

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

.gallery-page .lightbox figure {
  width: min(1400px, 90vw);
  height: min(86vh, 900px);
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gallery-page .lightbox img {
  width: 100%;
  height: calc(100% - 35px);
  object-fit: contain;
}

.gallery-page .lightbox figcaption {
  padding-top: .8rem;
  color: rgba(255,255,255,.6);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
}

.gallery-page .lightbox-close,
.gallery-page .lightbox-nav {
  position: absolute;
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.gallery-page .lightbox-close {
  top: 1.5rem;
  right: 1.8rem;
  font-size: 2.2rem;
  line-height: 1;
}

.gallery-page .lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  font-size: 1.8rem;
}

.gallery-page .lightbox-prev { left: 1.5rem; }
.gallery-page .lightbox-next { right: 1.5rem; }

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .gallery-page .gallery-lead-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }


  .gallery-page .gallery-item-tall,
  .gallery-page .gallery-item-wide {
    grid-column: span 6;
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 700px) {
  .gallery-page .gallery-message h2 span {
    margin-left: 0;
  }

  .gallery-page .gallery-lead-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .gallery-page .gallery-wall {
    width: calc(100% - 2rem);
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-page .gallery-item-tall,
  .gallery-page .gallery-item-wide {
    grid-column: 1;
    aspect-ratio: 4 / 5;
  }

  .gallery-page .lightbox {
    padding: 4rem .75rem 2rem;
  }

  .gallery-page .lightbox-nav {
    top: auto;
    bottom: .75rem;
  }

  .gallery-page .lightbox-prev { left: 1rem; }
  .gallery-page .lightbox-next { right: 1rem; }
}
