/* =========================================================
   Galeria realizacji — brak makiety w Figmie; strona złożona
   z komponentów systemu (page-head, pasek jak filtry listingu,
   zdjęcia jak "Stoły u naszych klientów" na Home)
   ========================================================= */

/* ---------- Pasek pod nagłówkiem (wzór: filtry listingu) ---------- */
.gallery-bar {
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.gallery-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-block: 12px;
}
.gallery-bar__count { font-size: 13px; line-height: 16px; color: var(--c-muted); }
.gallery-bar__count strong { font-weight: 500; color: var(--c-ink); }

/* ---------- Siatka (masonry na kolumnach) ---------- */
.gallery-section { padding: 32px 0 96px; }
.gallery {
  columns: 4;
  column-gap: 8px;
}
.gallery__item {
  position: relative;
  display: block;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  overflow: hidden;
  break-inside: avoid;
  background: var(--c-soft);
  cursor: zoom-in;
}
.gallery__item img {
  width: 100%;
  height: auto;
  transition: transform .5s ease;
}
.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.35) 100%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.gallery__caption {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--c-white);
  color: var(--c-ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .25s;
}
.gallery__item:hover img,
.gallery__item:focus-visible img { transform: scale(1.04); }
.gallery__item:hover::after,
.gallery__item:focus-visible::after { opacity: 1; }
.gallery__item:hover .gallery__caption,
.gallery__item:focus-visible .gallery__caption { opacity: 1; transform: none; }
.gallery__item:focus-visible { outline-offset: 2px; }

@media (hover: none) {
  .gallery__caption { opacity: 1; transform: none; }
}

/* ---------- Sekcja SEO (wzór: "Dlaczego warto…" na listingu) ---------- */
.about-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 48px;
  margin-top: 32px;
}
.about-cols__title {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 500;
  line-height: 18px;
}
.about-cols p { font-size: 14px; line-height: 22px; color: var(--c-muted); }
.about-cols a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(35, 31, 32, .96);
  color: var(--c-white);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  touch-action: pan-y pinch-zoom;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
}
.lightbox__counter {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--c-on-dark);
}
.lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 96px;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--r-sm);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity .2s;
}
.lightbox__img.is-loading { opacity: .35; }
.lightbox__bottom {
  display: flex;
  justify-content: center;
  padding: 20px 24px 28px;
}
.lightbox__caption { font-size: 14px; line-height: 20px; color: var(--c-on-dark); text-align: center; }
.lightbox__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  transition: background-color .2s, color .2s, border-color .2s;
}
.lightbox__close { border: 1px solid rgba(255, 255, 255, .5); color: var(--c-white); }
.lightbox__close:hover { border-color: var(--c-white); }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-white);
  color: var(--c-ink);
}
.lightbox__nav:hover { background: var(--c-green); }
.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }

/* ---------- Responsywność ---------- */
@media (max-width: 1024px) {
  .gallery { columns: 3; }
  .about-cols { grid-template-columns: 1fr 1fr; }
  .gallery-section { padding-bottom: 72px; }
}
@media (max-width: 768px) {
  .about-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .gallery { columns: 2; column-gap: 6px; }
  .gallery__item { margin-bottom: 6px; }
  .gallery__caption { left: 8px; bottom: 8px; max-width: calc(100% - 16px); font-size: 11px; padding: 3px 8px; }
  .gallery-section { padding: 24px 0 56px; }
  .gallery-bar__inner { flex-direction: column; align-items: flex-start; gap: 8px; padding-block: 16px; }

  .lightbox__top { padding: 12px 16px; }
  .lightbox__stage { padding: 0; }
  .lightbox__img { border-radius: 0; }
  .lightbox__nav { top: auto; bottom: -64px; transform: none; }
  .lightbox__nav--prev { left: 16px; }
  .lightbox__nav--next { right: 16px; }
  .lightbox__bottom { padding: 20px 72px 28px; min-height: 92px; align-items: center; }
}
