.nive-gallery {
  background: var(--archeo-light);
}
.nive-gallery__intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.nive-gallery__intro p {
  max-width: 620px;
  margin: 0;
  color: var(--archeo-gray);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(.65rem, 1.5vw, 1rem);
  margin-top: 2rem;
}
.gallery-item {
  position: relative;
  grid-column: span 4;
  min-height: 250px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #dfe5e2;
  cursor: zoom-in;
  box-shadow: 0 6px 20px rgba(24,55,45,.08);
}
.gallery-item.featured {
  grid-column: span 8;
  grid-row: span 2;
  min-height: 516px;
}
.gallery-item:nth-child(5n+4),
.gallery-item:nth-child(5n+5) {
  grid-column: span 6;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.035);
}
.gallery-item:focus-visible {
  outline: 3px solid var(--archeo-primary);
  outline-offset: 3px;
}
.gallery-item__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 2.2rem 1rem .85rem;
  background: linear-gradient(transparent, rgba(18,26,23,.8));
  color: #fff;
  font-size: .85rem;
  text-align: left;
}
.nive-gallery__more {
  margin-top: 1.5rem;
  text-align: center;
}
.nive-lightbox {
  box-sizing: border-box;
  width: min(1100px, 94vw);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #121614;
  color: #fff;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.nive-lightbox::backdrop {
  background: rgba(6,10,8,.82);
  backdrop-filter: blur(4px);
}
.nive-lightbox__figure {
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  height: min(86vh, 820px);
  margin: 0;
}
.nive-lightbox__figure img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.nive-lightbox__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: .7rem 1rem;
  background: #1d2421;
}
.nive-lightbox__meta figcaption { line-height: 1.35; }
.nive-lightbox__meta span { color: #cdd7d2; white-space: nowrap; }
.nive-lightbox__control {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 50%;
  background: rgba(20,25,23,.7);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.nive-lightbox__control:hover,
.nive-lightbox__control:focus-visible { background: var(--archeo-primary); }
.nive-lightbox__control.close { top: 12px; right: 12px; }
.nive-lightbox__control.prev { top: 50%; left: 12px; }
.nive-lightbox__control.next { top: 50%; right: 12px; }
@media(max-width:800px) {
  .nive-gallery__intro { align-items: flex-start; flex-direction: column; }
  .gallery-item,
  .gallery-item:nth-child(n) { grid-column: span 6; min-height: 210px; }
  .gallery-item.featured { grid-column: span 12; min-height: 330px; }
  .nive-lightbox__control.prev { left: 6px; }
  .nive-lightbox__control.next { right: 6px; }
}
@media(max-width:520px) {
  .gallery-item,
  .gallery-item:nth-child(n),
  .gallery-item.featured { grid-column: 1/-1; min-height: 260px; }
  .nive-lightbox__meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .nive-lightbox__control { width: 40px; height: 40px; }
}
