/* =========================================================
   Prilej Olej – Galérie 1.0.0
   ========================================================= */

.po-galleries {
  width: 100%;
}

.po-gallery-block + .po-gallery-block {
  margin-top: 72px;
}

.po-gallery-block__head {
  max-width: 900px;
  margin-bottom: 26px;
}

.po-gallery-block__title {
  margin: 0;
  color: var(--ink, #15191f);
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -.025em;
}

.po-gallery-block__intro {
  max-width: 780px;
  margin: 11px 0 0;
  color: var(--muted, #687078);
  font-size: .96rem;
  line-height: 1.68;
}

.po-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--po-gallery-cols, 4), minmax(0, 1fr));
  gap: var(--po-gallery-gap, 16px);
}

.po-gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f1f4f2;
  border-radius: 14px;
  text-decoration: none;
}

.po-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}

.po-gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 70, 35, 0);
  transition: background .22s ease;
}

.po-gallery__item:hover img {
  transform: scale(1.035);
}

.po-gallery__item:hover::after {
  background: rgba(0, 70, 35, .10);
}

.po-gallery__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--green-dark, #007a3d);
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}

.po-gallery__item:hover .po-gallery__zoom,
.po-gallery__item:focus-visible .po-gallery__zoom {
  opacity: 1;
  transform: translateY(0);
}

.po-gallery__item:focus-visible {
  outline: 2px solid var(--green, #00a651);
  outline-offset: 3px;
}

/* =========================================================
   LIGHTBOX – vlastný, bez externých knižníc
   ========================================================= */

.po-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 76px;
  background: rgba(8, 12, 10, .94);
}

.po-lightbox.is-open {
  display: flex;
}

.po-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.po-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .36);
}

.po-lightbox__close,
.po-lightbox__prev,
.po-lightbox__next {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-family: Arial, sans-serif;
  cursor: pointer;
  transition: background .2s ease;
}

.po-lightbox__close:hover,
.po-lightbox__prev:hover,
.po-lightbox__next:hover {
  background: rgba(255, 255, 255, .22);
}

.po-lightbox__close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  font-size: 30px;
  font-weight: 300;
}

.po-lightbox__prev,
.po-lightbox__next {
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  font-size: 34px;
  font-weight: 300;
}

.po-lightbox__prev { left: 18px; }
.po-lightbox__next { right: 18px; }

.po-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: 17px;
  z-index: 4;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .82);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
}

html.po-lightbox-lock,
html.po-lightbox-lock body {
  overflow: hidden;
}

@media (max-width: 1000px) {
  .po-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .po-gallery-block + .po-gallery-block {
    margin-top: 52px;
  }

  .po-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .po-gallery__zoom {
    opacity: 1;
    transform: none;
  }

  .po-lightbox {
    padding: 58px 12px 52px;
  }

  .po-lightbox__prev,
  .po-lightbox__next {
    top: auto;
    bottom: 10px;
    width: 42px;
    height: 42px;
    margin: 0;
    font-size: 29px;
  }

  .po-lightbox__prev { left: 12px; }
  .po-lightbox__next { right: 12px; }

  .po-lightbox__close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .po-lightbox__counter {
    bottom: 22px;
  }
}

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