/* ── GALLERY PAGE ── */

main {
  padding: 100px 0 0 0;
  background: #f8faf6;
  min-height: 100vh;
}

/* PAGE HEADER */
.galerija-header {
  background: linear-gradient(135deg, #4a5639 0%, #5f6e4c 45%, #6b7a58 100%);
  padding: 64px 20px 72px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
  clip-path: ellipse(110% 100% at 50% 0%);
}

.galerija-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 280px at 15% 60%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(700px 220px at 85% 30%, rgba(255,255,255,0.12), transparent 50%);
  pointer-events: none;
}

.galerija-header-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.9);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
  font-family: 'Nunito', sans-serif;
  position: relative;
}

.galerija-header h1 {
  font-size: 2.8em;
  margin: 0 0 12px;
  font-weight: 800;
  position: relative;
}

.galerija-header p {
  font-size: 1.05em;
  opacity: 0.82;
  margin: 0;
  position: relative;
}

/* GRID */
.galerija-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 52px 24px 70px;
  background: #f8faf6;
}

.galerijos-tinklelis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.galerijos-item {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 14px;
  line-height: 0;
}

.galerijos-item:focus-visible {
  outline: 3px solid #4a5639;
  outline-offset: 3px;
}

.galerijos-tinklelis img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  cursor: pointer;
  display: block;
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}

.galerijos-item:hover img {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 44px rgba(0,0,0,0.14);
  filter: brightness(1.04);
}

.galerijos-tinklelis video {
  width: 100%;
  height: 240px;
  display: block;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.galerijos-tinklelis video:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 44px rgba(0,0,0,0.14);
}

/* LIGHTBOX */
#lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(15,18,15,0.95);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#lightbox img.lightbox-img {
  max-height: 84vh;
  max-width: 88vw;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

#lightbox .lightbox-video {
  display: none;
  max-height: 74vh;
  max-width: 82vw;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  pointer-events: none;
  user-select: none;
}

#lightbox .close,
#lightbox .prev,
#lightbox .next {
  border: none;
  padding: 0;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

#lightbox .close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

#lightbox .close:hover {
  background: rgba(255,255,255,0.2);
}

#lightbox .prev,
#lightbox .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

#lightbox .prev:hover,
#lightbox .next:hover {
  background: rgba(255,255,255,0.22);
}

#lightbox .prev { left: 20px; }
#lightbox .next { right: 20px; }

/* TABLET */
@media only screen and (min-width: 481px) and (max-width: 1024px) {
  .galerija-header { padding: 52px 24px 46px; }
  .galerija-header h1 { font-size: 2.3em; }
  .galerija-body { padding: 40px 24px 56px; }
  .galerijos-tinklelis { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .galerijos-tinklelis img,
  .galerijos-item,
  .galerijos-tinklelis video { height: 220px; }
}

/* PHONE */
@media (max-width: 480px) {
  .galerija-header { padding: 40px 16px 36px; }
  .galerija-header h1 { font-size: 1.9em; }
  .galerija-body { padding: 28px 14px 44px; }
  .galerijos-tinklelis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .galerijos-tinklelis img,
  .galerijos-item,
  .galerijos-tinklelis video { height: 148px; border-radius: 11px; }
  #lightbox .prev { left: 8px; }
  #lightbox .next { right: 8px; }
}
