.gallery-card__image {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #dfeef5, #e8f4f9);
  cursor: zoom-in;
}

.gallery-card__image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 350ms ease;
}

/* Gradiente overlay al passaggio del mouse */
.gallery-card__image::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(30, 60, 80, 0.22) 0%, transparent 55%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.gallery-card:hover .gallery-card__image::before {
  opacity: 1;
}

/* Icona zoom */
.gallery-card__image::after {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 12px rgba(45, 88, 119, 0.22);
  color: var(--ink);
  content: "⊕";
  font-size: 1.1rem;
  line-height: 34px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: scale(0.8);
  transition: opacity 180ms ease, transform 180ms ease;
}

.gallery-card__image:hover::after,
.gallery-card__image:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

@media (hover: none) {
  .gallery-card__image::after {
    opacity: 0.7;
    transform: scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Lightbox
   ═══════════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 28, 0.94);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  border: 0;
}

.lightbox__figure {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: min(92vw, 1280px);
  max-height: 92dvh;
  margin: 0;
  padding: 0;
  flex-direction: column;
  align-items: center;
  animation: lightboxIn 0.22s ease both;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(92dvh - 56px);
  object-fit: contain;
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.lightbox__caption {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--caps);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: fixed;
  z-index: 2;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: background 150ms ease;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox__close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  width: 46px;
  height: 66px;
  border-radius: 4px;
  font-size: 2rem;
  transform: translateY(-50%);
}

.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }

.lightbox__prev:disabled,
.lightbox__next:disabled {
  opacity: 0.2;
  cursor: default;
}

.lightbox__counter {
  position: fixed;
  top: 20px;
  left: 50%;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--caps);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateX(-50%);
  pointer-events: none;
}

body.lightbox-open {
  overflow: hidden;
}
