/* ============================================================
   ISORYX – Galeria zdjęć + Lightbox
   ============================================================ */

/* Filtry */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.gallery-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 100px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}

.gallery-filter:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
}

.gallery-filter.is-active {
  background: rgba(252,119,8,0.15);
  border-color: rgba(252,119,8,0.6);
  color: #FC7708;
}

.gallery-filter__count {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 1px 7px;
  color: var(--text-dim);
  transition: color 0.2s;
}

.gallery-filter.is-active .gallery-filter__count {
  color: #FC7708;
}

/* Siatka */
.gallery-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.gallery-item[hidden] {
  display: none;
}

.gallery-item__btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.gallery-item__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.gallery-item__btn:hover .gallery-item__img {
  transform: scale(1.05);
  opacity: 0.75;
}

.gallery-item__zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-item__btn:hover .gallery-item__zoom {
  opacity: 1;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lb-in 0.2s ease;
}

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

.lightbox[hidden] {
  display: none;
}

.lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 80px);
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  animation: lb-img-in 0.22s ease;
  object-fit: contain;
}

@keyframes lb-img-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
  z-index: 2;
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.18);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s, opacity 0.2s;
  z-index: 2;
}

.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

.lightbox__nav:hover {
  background: rgba(255,255,255,0.18);
}

.lightbox__nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin: 0;
  letter-spacing: 0.04em;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .lightbox__stage {
    max-width: 100vw;
  }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}

@media (max-width: 420px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}
