/* ============================================================
   GALERIA.CSS — Dom Opieki Jantar
   ------------------------------------------------------------
   Style specyficzne wyłącznie dla podstrony galeria.html.
   Style globalne (zmienne, nav, footer, przyciski, typografia)
   znajdują się w css/global.css.
   ------------------------------------------------------------
   BREAKPOINTY — Bootstrap 5 (mobile-first)
   xs  < 576px   – bazowe (telefon pionowo)
   sm  ≥ 576px
   md  ≥ 768px
   lg  ≥ 992px
   xl  ≥ 1200px
   xxl ≥ 1400px
============================================================ */


/* ============================================================
   HERO GALERII
============================================================ */

.gallery-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--gray-line);
  min-height: 380px;
}

.gallery-hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/galeria-hero.webp');
  background-size: cover;
  background-position: center 35%;
  z-index: 0;
}

.gallery-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(10, 14, 10, 0.75) 0%,
    rgba(10, 14, 10, 0.40) 60%,
    rgba(10, 14, 10, 0.15) 100%
  );
  z-index: 1;
}

.gallery-hero .container {
  position: relative;
  z-index: 2;
  padding-top: 72px;
  padding-bottom: 72px;
}

.gallery-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 560px;
}

.gallery-hero .eyebrow {
  color: var(--sage-light);
  margin-bottom: 20px;
}

.gallery-hero .eyebrow-line::before {
  background: var(--sage-light);
}

.gallery-hero__title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 300;
  color: var(--white);
  margin-bottom: 24px;
  line-height: 1.1;
}

.gallery-hero__title em {
  font-style: italic;
  color: var(--sage-light);
}

.gallery-hero__lead {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
  max-width: 440px;
}


/* ============================================================
   SEKCJA GALERII
============================================================ */

.gallery-section {
  padding: 64px 0 96px;
}


/* ── SIATKA — CSS Columns (masonry) ───────────────────────── */

.gallery-grid {
  columns: 1;
  column-gap: 14px;
}


/* ── POJEDYNCZY KAFELEK ───────────────────────────────────── */

.gallery-item {
  break-inside: avoid;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 2px;
  background-color: var(--cream);

  /* Scroll reveal — stan początkowy */
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item__img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.55s ease;
}

.gallery-item:hover .gallery-item__img {
  transform: scale(1.05);
}


/* ── PROPORCJE KAFLI ──────────────────────────────────────── */

.gallery-item--tall    .gallery-item__img { aspect-ratio: 2 / 3;  object-fit: cover; }
.gallery-item--wide    .gallery-item__img { aspect-ratio: 4 / 3;  object-fit: cover; }
.gallery-item--square  .gallery-item__img { aspect-ratio: 1 / 1;  object-fit: cover; }
.gallery-item--portrait .gallery-item__img { aspect-ratio: 3 / 4; object-fit: cover; }


/* ── OVERLAY Z PODPISEM ───────────────────────────────────── */

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: linear-gradient(to top, rgba(31, 33, 30, 0.65) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__caption {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}


/* ── IKONA POWIĘKSZENIA ───────────────────────────────────── */

.gallery-item__zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.88);
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-item:hover .gallery-item__zoom {
  opacity: 1;
  transform: scale(1);
}

.gallery-item__zoom svg {
  width: 15px;
  height: 15px;
  stroke: var(--sage-dark);
  fill: none;
}


/* ============================================================
   LIGHTBOX
============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(10, 12, 10, 0.94);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__img {
  display: block;
  max-width: 88vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  transition: opacity 0.16s ease;
}

.lightbox__caption-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px 40px;
  background: linear-gradient(to top, rgba(10, 12, 10, 0.8) 0%, transparent 100%);
}

.lightbox__caption {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.lightbox__counter {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
}

.lightbox__btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  z-index: 9100;
  transition: background-color 0.2s ease;
}

.lightbox__btn:hover {
  background-color: rgba(255, 255, 255, 0.14);
}

.lightbox__btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--white);
  fill: none;
  stroke-width: 1.5;
}

.lightbox__btn--prev { left: 20px; }
.lightbox__btn--next { right: 20px; }

.lightbox__close {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  z-index: 9100;
  transition: background-color 0.2s ease;
}

.lightbox__close:hover {
  background-color: rgba(255, 255, 255, 0.14);
}

.lightbox__close svg {
  width: 17px;
  height: 17px;
  stroke: var(--white);
  fill: none;
  stroke-width: 1.5;
}


/* ============================================================
   SEKCJA CTA
============================================================ */

.gallery-cta {
  padding: 72px 0;
  text-align: center;
  background-color: var(--sage-bg);
  border-top: 1px solid var(--gray-line);
}

.gallery-cta__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300;
  margin-bottom: 12px;
}

.gallery-cta__title em {
  font-style: italic;
  color: var(--sage-dark);
}

.gallery-cta__lead {
  font-size: 15px;
  color: var(--text-mid);
  max-width: 440px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.gallery-cta__btns {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}


/* ============================================================
   ACTIVE NAV LINK
============================================================ */

.nav-link--active {
  color: var(--sage-dark) !important;
}

.nav-link--active::after {
  width: 100% !important;
}


/* ============================================================
   SM — ≥ 576px
============================================================ */

@media (min-width: 576px) {
  .gallery-hero {
    min-height: 420px;
  }

  .gallery-grid {
    columns: 2;
  }
}


/* ============================================================
   MD — ≥ 768px
============================================================ */

@media (min-width: 768px) {
  .gallery-hero {
    min-height: 460px;
  }

  .gallery-hero .container {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .gallery-section {
    padding: 72px 0 96px;
  }
}


/* ============================================================
   LG — ≥ 992px
============================================================ */

@media (min-width: 992px) {
  .gallery-hero {
    min-height: 500px;
  }

  .gallery-grid {
    columns: 3;
  }
}


/* ============================================================
   XL — ≥ 1200px
============================================================ */

@media (min-width: 1200px) {
  .gallery-hero {
    min-height: 540px;
  }

  .gallery-hero__title {
    font-size: 72px;
  }
}


/* ============================================================
   XXL — ≥ 1400px
============================================================ */

@media (min-width: 1400px) {
  .gallery-section {
    padding: 80px 0 112px;
  }
}
