/* =============================================
   AVIS Locate di Triulzi – Galleria
   ============================================= */

/* ---- Navbar link attivo ---- */
.navbar__link--active {
  color: var(--red) !important;
  font-weight: 600;
}

/* ---- Hero galleria ---- */
.gallery-hero {
  position: relative;
  padding: 140px 0 64px;
  text-align: center;
  color: var(--white);
  overflow: hidden;
}
.gallery-hero__bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #8B0000 0%, var(--red) 45%, #E8304A 100%);
  z-index: 0;
}
.gallery-hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.gallery-hero__content { position: relative; z-index: 1; }
.gallery-hero__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin: 12px 0 10px;
  letter-spacing: -.02em;
}
.gallery-hero__sub {
  font-size: 1.05rem;
  opacity: .85;
}

/* ---- Sezione galleria ---- */
.gallery-section { padding-top: 56px; }

/* ---- Tab eventi ---- */
.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}
.gallery-tab {
  padding: 10px 22px;
  border-radius: 50px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.gallery-tab:hover {
  border-color: var(--red);
  color: var(--red);
}
.gallery-tab--active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ---- Contatore ---- */
.gallery-count {
  text-align: center;
  font-size: .82rem;
  color: var(--gray-400);
  margin-bottom: 28px;
}

/* ---- Griglia foto ---- */
.gallery-grid {
  columns: 4 220px;
  column-gap: 14px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--gray-100);
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform .35s ease, filter .35s ease;
}
.gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(.85);
}
.gallery-item__overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
  background: rgba(200,16,46,.25);
}
.gallery-item:hover .gallery-item__overlay { opacity: 1; }
.gallery-item__overlay svg {
  width: 36px; height: 36px;
  color: var(--white);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}

/* ---- Stato vuoto ---- */
.gallery-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-400);
}
.gallery-empty svg {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  opacity: .35;
}
.gallery-empty p    { font-size: 1.05rem; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.gallery-empty span { font-size: .88rem; }

/* ---- Lightbox ---- */
.lightbox__overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 2000;
}
.lightbox {
  display: none;
  position: fixed; inset: 0;
  z-index: 2001;
  align-items: center;
  justify-content: center;
}
.lightbox.open,
.lightbox__overlay.open {
  display: flex;
}

.lightbox__img-wrap {
  max-width: 90vw;
  max-height: 85vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: lightboxIn .2s ease;
}
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__close {
  position: fixed; top: 20px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none; cursor: pointer;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  z-index: 2002;
}
.lightbox__close:hover { background: rgba(255,255,255,.3); }
.lightbox__close svg   { width: 22px; height: 22px; }

.lightbox__nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none; cursor: pointer;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  z-index: 2002;
}
.lightbox__nav:hover { background: rgba(255,255,255,.3); }
.lightbox__nav svg   { width: 24px; height: 24px; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

.lightbox__caption {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: .82rem;
  font-family: var(--font);
  background: rgba(0,0,0,.4);
  padding: 6px 16px;
  border-radius: 50px;
  white-space: nowrap;
  z-index: 2002;
}

@media (max-width: 600px) {
  .gallery-grid { columns: 2 140px; }
  .lightbox__nav--prev { left: 6px; }
  .lightbox__nav--next { right: 6px; }
}
