/* ==========================================================
   APT 1.12 — Galeria
   ========================================================== */

body.no-scroll {
  overflow: hidden;
}

/* ---------- GALLERY ---------- */
.apt112-gallery {
  background: #0a0a0a;
  padding: 90px 0 70px;
}

.apt112-gallery__header {
  display: flex;
  align-items: baseline;
  gap: 22px;
  width: 90%;
  margin: 0 auto 50px;
  border-bottom: 1px solid rgba(255,255,255,.2);
  padding-bottom: 14px;
}

.apt112-gallery__number {
  font-family: 'AvenirNextLTPRO-regular', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: #fff;
  opacity: .35;
}

.apt112-gallery__title {
  font-family: 'Ogg', serif;
  font-weight: 400;
  font-size: clamp(36px, 6vw, 90px);
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  color: #fff;
}

.apt112-gallery__main {
  width: 75%;
  margin: 0 auto;
  cursor: zoom-in;
}

.apt112-gallery__slide {
  outline: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.apt112-gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Miniaturki */
.apt112-gallery__thumbs {
  width: 75%;
  margin: 10px auto 0;
}

.apt112-gallery__thumb {
  padding: 3px;
  outline: none;
  cursor: pointer;
  opacity: .5;
  transition: opacity .25s;
}

.apt112-gallery__thumb.slick-current,
.apt112-gallery__thumb:hover {
  opacity: 1;
}

.apt112-gallery__thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* ---------- LIGHTBOX ---------- */
.apt112-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.93);
  align-items: center;
  justify-content: center;
}

.apt112-lightbox--open {
  display: flex;
}

.apt112-lightbox__img-wrap {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apt112-lightbox__img-wrap img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.apt112-lightbox__close,
.apt112-lightbox__prev,
.apt112-lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  transition: opacity .2s;
  padding: 10px;
}

.apt112-lightbox__close:hover,
.apt112-lightbox__prev:hover,
.apt112-lightbox__next:hover {
  opacity: .5;
}

.apt112-lightbox__close { top: 20px; right: 28px; font-size: 42px; }
.apt112-lightbox__prev  { left: 24px; top: 50%; transform: translateY(-50%); font-size: 38px; }
.apt112-lightbox__next  { right: 24px; top: 50%; transform: translateY(-50%); font-size: 38px; }

/* ---------- INLINE VARIANT (inside rzut__image column) ---------- */

/* Critical: flex child must have min-width:0 for Slick to calculate widths */
.rzut__image {
  min-width: 0;
}

.apt112-gallery--inline {
  background: #fff;
  padding: 24px 0 20px;
  margin-top: 20px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.apt112-gallery--inline .apt112-gallery__main,
.apt112-gallery--inline .apt112-gallery__thumbs {
  width: 80%;
}

/* Reset 3d.css ".rzut__image img" rules for gallery images */
.rzut__image .apt112-gallery img {
  width: 100%;
  margin: 0;
  padding: 0;
  transition: none;
}

/* Hide stacked slides before Slick initializes */
.apt112-gallery__main:not(.slick-initialized) .apt112-gallery__slide + .apt112-gallery__slide {
  display: none;
}

/* ---------- RESPONSIVE ---------- */
@media screen and (max-width: 1007px) {
  /* Remove forced aspect-ratio on mobile so images show at natural height */
  .apt112-gallery--inline .apt112-gallery__slide {
    aspect-ratio: unset;
  }

  .apt112-gallery--inline .apt112-gallery__slide img {
    height: auto;
    object-fit: contain;
  }
}

@media screen and (max-width: 768px) {
  .apt112-gallery__main,
  .apt112-gallery__thumbs {
    width: 90%;
  }

  .apt112-gallery {
    padding: 55px 0 45px;
  }

  .apt112-lightbox__prev { left: 8px; }
  .apt112-lightbox__next { right: 8px; }
}

@media screen and (max-width: 480px) {
  .apt112-gallery__main .slick-arrow-custom {
    display: none !important;
  }
}
