/* Galeria — siatka + lightbox */

body.ppl-premium.page-gallery .gallery-page-lead {
  max-width: 40rem;
  margin-bottom: 1.25rem;
}

.gallery-tabs .gallery-tab-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 0.15rem;
}

.gallery-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 1rem;
}

.gallery-count {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.85rem;
  }
}

.gallery-cell {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius, 10px);
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  aspect-ratio: 4 / 3;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-cell:hover,
.gallery-cell:focus-visible {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
  outline: none;
}

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

/* Lightbox — pełna wysokość pod navbar; licznik i × na wierzchu zdjęcia */
.gallery-lightbox {
  position: fixed;
  top: var(--gallery-lightbox-top, 4.5rem);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 0 3.25rem;
  box-sizing: border-box;
}

.gallery-lightbox[hidden] {
  display: none !important;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.94);
  cursor: pointer;
}

.gallery-lightbox__chrome {
  position: absolute;
  top: 0.65rem;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}

.gallery-lightbox__chrome > * {
  pointer-events: auto;
}

.gallery-lightbox__counter {
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
}

.gallery-lightbox__close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox__close:hover {
  border-color: var(--gold, #d4af37);
  color: var(--gold, #d4af37);
}

.gallery-lightbox__stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gallery-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
  pointer-events: auto;
  cursor: default;
  border-radius: 0;
  box-shadow: none;
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.gallery-lightbox__nav:hover {
  border-color: var(--gold, #d4af37);
  color: var(--gold, #d4af37);
}

.gallery-lightbox__nav--prev {
  left: 0.75rem;
}

.gallery-lightbox__nav--next {
  right: 0.75rem;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .gallery-lightbox {
    padding: 0 2.75rem;
  }

  .gallery-lightbox__nav {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }

  .gallery-lightbox__nav--prev {
    left: 0.35rem;
  }

  .gallery-lightbox__nav--next {
    right: 0.35rem;
  }
}
