/* ============================================================
   Srutashakha — Gallery Styles
   Matches site theme: sage #7BAE7F, mist #A8DADC, sand #F6F1EB
   ============================================================ */

/* ---------- Filter bar ---------- */
.gal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gal-filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4a4d6a;
  cursor: pointer;
  transition: all .18s ease;
}
.gal-filter-btn:hover { border-color: #7BAE7F; color: #5E9E63; }
.gal-filter-btn.active {
  background: #7BAE7F;
  border-color: #7BAE7F;
  color: #fff;
}

/* ---------- Grid ---------- */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
@media (max-width: 640px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ---------- Photo card ---------- */
.gal-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #f1f1f4;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform;
}
.gal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(123,174,127,.45);
}
.gal-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
  background: #EAF4EC;
}
.gal-card:hover img { transform: scale(1.06); }

.gal-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(43,45,66,.78) 0%, rgba(43,45,66,0) 55%);
  opacity: 0;
  transition: opacity .25s ease;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.gal-card:hover .gal-card-overlay { opacity: 1; }
.gal-card-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.gal-card-cat {
  display: inline-block;
  font-size: 11px;
  color: #A8DADC;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

/* play badge for video cards */
.gal-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px -6px rgba(0,0,0,.35);
  transition: transform .22s ease, background .22s ease;
  z-index: 2;
}
.gal-card:hover .gal-play { transform: translate(-50%,-50%) scale(1.12); background:#fff; }
.gal-play svg { width: 22px; height: 22px; fill: #5E9E63; margin-left: 3px; }

.gal-duration {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(43,45,66,.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 2;
}

/* video card aspect (16:9) */
.gal-card.is-video { aspect-ratio: 16 / 10; }

/* ---------- Lightbox / Modal ---------- */
.gal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20,22,30,.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  animation: galFade .25s ease;
}
.gal-lightbox.open { display: flex; }
@keyframes galFade { from { opacity:0 } to { opacity:1 } }

.gal-lightbox-inner {
  position: relative;
  max-width: 1000px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gal-lightbox img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.gal-lightbox-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.gal-lightbox-video iframe,
.gal-lightbox-video video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.gal-lightbox-caption {
  margin-top: 14px;
  color: #fff;
  text-align: center;
  max-width: 700px;
}
.gal-lightbox-caption h3 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.gal-lightbox-caption p  { font-size: 13px; color: #c7cad8; margin: 0; }

.gal-close {
  position: absolute;
  top: -46px; right: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s ease;
}
.gal-close:hover { background: rgba(255,255,255,.25); }

.gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s ease;
  z-index: 3;
}
.gal-nav:hover { background: rgba(255,255,255,.28); }
.gal-prev { left: -64px; }
.gal-next { right: -64px; }
@media (max-width: 900px) {
  .gal-prev { left: 6px; }
  .gal-next { right: 6px; }
  .gal-close { top: 8px; right: 8px; }
}

/* ---------- Empty + loading ---------- */
.gal-empty {
  text-align: center;
  padding: 60px 20px;
  color: #4a4d6a;
}
.gal-empty .emoji { font-size: 56px; margin-bottom: 12px; }

.gal-skeleton {
  border-radius: 20px;
  aspect-ratio: 1/1;
  background: linear-gradient(110deg, #eef1f0 8%, #f6f7f7 18%, #eef1f0 33%);
  background-size: 200% 100%;
  animation: galShimmer 1.4s linear infinite;
}
@keyframes galShimmer { to { background-position-x: -200%; } }

/* lazy-load fade */
.gal-card img.lazy { opacity: 0; transition: opacity .4s ease; }
.gal-card img.lazy.loaded { opacity: 1; }
