.galerija-page {
  background: #f5f6f3;
  color: #171a1d;
}

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

.galerija-hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #111;
  color: white;
}

.galerija-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.76) 0%,
      rgba(0, 0, 0, 0.56) 45%,
      rgba(0, 0, 0, 0.34) 100%
    ),
    url("/podstrani/slike/DSC_8850.jpg");
  background-size: cover;
  background-position: center;
}

.galerija-hero-content {
  position: relative;
  z-index: 10;
  width: min(90%, 1380px);
  margin: 0 auto;
}

.hero-eyebrow {
  margin-bottom: 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.72);
}

.galerija-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1.05;
  font-weight: 500;
  color: white;
  margin-top: 24px;
}

.galerija-hero-title span {
  color: #0a5c38;
}

.galerija-hero-text {
  max-width: 620px;
  margin-top: 28px;
  font-size: 20px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 768px) {
  .galerija-hero {
    min-height: 70vh;
    padding: 120px 0 40px;
  }

  .galerija-hero-content {
    width: min(calc(100% - 28px), 1380px);
  }

  .galerija-hero-title {
    font-size: 42px;
    margin-top: 16px;
  }

  .galerija-hero-text {
    font-size: 16px;
  }
}

/* ================= GRID ================= */

.galerija-section {
  padding: 118px 6vw 130px;
  background: #f5f6f3;
}

.galerija-inner {
  max-width: 1320px;
  margin: 0 auto;
}

.galerija-heading {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.galerija-heading .section-eyebrow {
  margin-bottom: 14px;
  color: #0a5c38;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.galerija-heading h2 {
  font-family: var(--font-heading);
  font-size: clamp(38px, 3.8vw, 54px);
  font-weight: 500;
  color: #0a5c38;
}

.galerija-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.galerija-item {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.galerija-item:focus-visible {
  outline: 2px solid #0a5c38;
  outline-offset: 3px;
}

.galerija-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.galerija-item:hover img {
  transform: scale(1.08);
}

.galerija-empty {
  grid-column: 1 / -1;
  padding: 60px 0;
  text-align: center;
  color: rgba(0, 0, 0, 0.46);
}

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

@media (max-width: 720px) {
  .galerija-section {
    padding: 82px 22px 90px;
  }

  .galerija-heading {
    margin-bottom: 40px;
  }

  .galerija-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 10, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  max-width: min(92vw, 1400px);
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.lightbox.is-open .lightbox-image {
  opacity: 1;
  transform: scale(1);
}

.lightbox-image.is-switching {
  opacity: 0;
}

.lightbox-caption {
  margin-top: 22px;
  padding: 0 10vw;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  text-align: center;
  max-width: 80vw;
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-counter {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.44);
}

.lightbox-close {
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  font-size: 26px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 30px;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

body.lightbox-odprt {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox-image {
    transition: none;
  }
}

@media (max-width: 640px) {
  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-stage,
  .lightbox-image {
    max-height: 62vh;
  }

  .lightbox-caption {
    padding: 0 6vw;
    font-size: 13px;
  }
}
