/* ==========================================================================
   Block 11 — Więcej realizacji (galeria)
   ========================================================================== */

.gallery {
  background: var(--color-paper);
  border-top: 1px solid var(--color-border);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}
.gallery__grid .gallery-card:nth-child(n+13) { display: none; }
.gallery__grid.is-expanded .gallery-card:nth-child(n+13) { display: block; }

.gallery-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-ink-soft);
}
.gallery-card__inner {
  position: absolute;
  inset: -2px;
  background-size: cover;
  background-position: center;
  transition: transform var(--dur-med) var(--ease-out);
}
.gallery-card:hover .gallery-card__inner { transform: scale(1.06); }
.gallery-card video {
  display: block;
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  object-fit: cover;
}

.gallery-card__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(21,21,19,0.6);
  color: var(--color-white);
  font-size: var(--fs-micro);
  font-weight: 600;
}
.gallery-card__badge svg { width: 12px; height: 12px; stroke: currentColor; fill: none; }
.gallery-card__badge svg.is-play { fill: currentColor; stroke: none; }

.gallery__more-wrap {
  margin-top: var(--space-lg);
  text-align: center;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(10,10,9,0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-out), visibility var(--dur-fast) var(--ease-out);
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.lightbox__frame img,
.lightbox__frame video {
  display: block;
  max-width: 92vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__close {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(21,21,19,0.6);
  color: var(--color-white);
  line-height: 0;
  z-index: 400;
}
.lightbox__close svg { width: 20px; height: 20px; stroke: currentColor; }
.lightbox__close:hover { color: var(--color-accent); background: rgba(21,21,19,0.85); }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(21,21,19,0.6);
  color: var(--color-white);
  border-radius: 50%;
  line-height: 0;
}
.lightbox__nav svg { width: 20px; height: 20px; stroke: currentColor; }
.lightbox__nav[hidden] { display: none; }
.lightbox__nav--prev { left: -22px; }
.lightbox__nav--next { right: -22px; }

.lightbox__dots {
  margin-top: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lightbox__dot {
  width: 6px; height: 6px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
.lightbox__dot.is-active { background: var(--color-accent); }

@media (max-width: 900px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .lightbox__nav--prev { left: 4px; }
  .lightbox__nav--next { right: 4px; }
}
