/* ===== Gallery page styles ===== */

.gallery {
  padding: 80px 0;
  background: var(--bg-soft);
}

/* Masonry grid via CSS columns — works with mixed aspect ratios */
.gallery-grid {
  column-count: 3;
  column-gap: 18px;
}

@media (max-width: 980px) {
  .gallery-grid { column-count: 2; }
}
@media (max-width: 600px) {
  .gallery-grid { column-count: 1; }
}

.gallery-item {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  break-inside: avoid;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .35s ease, filter .25s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 3px;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 14, 24, 0.94);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: lb-fade .2s ease;
}
.lightbox[hidden] { display: none; }

@keyframes lb-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-img {
  max-width: min(1200px, 95vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 56px;
  height: 56px;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  backdrop-filter: blur(8px);
}
.lightbox-close { top: 24px; right: 24px; font-size: 28px; }
.lightbox-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
}
.lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(3px); }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

body.lightbox-open { overflow: hidden; }

@media (max-width: 600px) {
  .lightbox { padding: 16px; }
  .lightbox-close,
  .lightbox-prev,
  .lightbox-next {
    width: 44px; height: 44px; font-size: 26px;
  }
  .lightbox-close { top: 16px; right: 16px; }
  .lightbox-prev  { left: 12px; }
  .lightbox-next  { right: 12px; }
}
