#galeria {
  background: rgba(255, 255, 255, 0.55);
}

gallery-section {
  display: block;
  scroll-margin-top: 90px;
}

.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 130px;
  grid-auto-flow: dense;
  gap: var(--space-3);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  background: var(--color-primary-soft);
  border-radius: 12px;
  transition: box-shadow var(--transition-base);
}

.gallery-item:hover {
  box-shadow: var(--shadow-warm);
}

.gallery-wide {
  grid-column: span 2;
}

.gallery-tall {
  grid-row: span 2;
}

.gallery-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.gallery-trigger picture,
.gallery-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.gallery-trigger:hover img,
.gallery-trigger:focus-visible img {
  transform: scale(1.06);
}

@media (max-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
  }

  .gallery-wide {
    grid-column: span 2;
  }
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 14, 15, 0.92);
  padding: var(--space-6);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: min(900px, 90vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: var(--fs-base);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-close svg,
.lightbox-nav svg {
  width: 20px;
  height: 20px;
}

.lightbox-close {
  top: var(--space-5);
  right: var(--space-5);
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}

.lightbox-prev {
  left: var(--space-5);
  transform: translateY(-50%) rotate(90deg);
}

.lightbox-next {
  right: var(--space-5);
  transform: translateY(-50%) rotate(-90deg);
}

@media (max-width: 640px) {
  .lightbox-nav {
    width: 38px;
    height: 38px;
  }

  .lightbox-prev {
    left: var(--space-2);
  }

  .lightbox-next {
    right: var(--space-2);
  }

  .lightbox-close {
    top: var(--space-3);
    right: var(--space-3);
  }
}
