/* Zdjęcia na karcie oferty / nieruchomości + pokaz zdjęć w okienku.
   Markup: templates/components/_v6_gallery.html, zachowanie: static/js/components/gallery.js.
   Wygląd samej miniatury (.img-card: proporcje, ramka) daje szablon karty - tu tylko to,
   co robi z niej przycisk, i okno galerii. */

.v6-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .v6-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.img-card--btn {
  padding: 0;
  margin: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  display: block;
  width: 100%;
}

.img-card--btn:focus-visible {
  outline: 2px solid var(--v6-green, #13352c);
  outline-offset: 2px;
}

.img-card__main {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--green-primary, #13352c);
  color: #fff;
  padding: 2px 6px;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 4px;
}

.img-card__zoom {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 160ms ease;
}

.img-card--btn:hover .img-card__zoom,
.img-card--btn:focus-visible .img-card__zoom {
  opacity: 1;
}

/* Okno pokazu - pełny ekran, ciemne tło, zdjęcie w całości (contain). */
.v6-gallery {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 12, 9, 0.92);
  padding: 24px;
}

.v6-gallery[hidden] {
  display: none;
}

.v6-gallery__stage {
  position: relative;
  max-width: 1100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.v6-gallery__img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  user-select: none;
}

.v6-gallery__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 30, 25, 0.7);
  color: #fff;
  cursor: pointer;
}

.v6-gallery__btn:hover {
  background: var(--green-primary, #13352c);
  border-color: var(--green-primary, #13352c);
}

.v6-gallery__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.v6-gallery__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.v6-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.v6-gallery__nav--prev {
  left: 8px;
}

.v6-gallery__nav--next {
  right: 8px;
}

.v6-gallery__counter {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  color: #e6efe9;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .img-card__zoom {
    transition: none;
  }
}
