/* ============================================================
   Varghese Luxury — Gallery page (masonry grid + lightbox)
   ============================================================ */

.gallery {
  background: linear-gradient(180deg, var(--parch-1), var(--parch-2));
  color: var(--ink-navy);
  padding: clamp(48px, 7vw, 88px) clamp(16px, 5vw, 72px) clamp(64px, 9vw, 120px);
}

/* ---------- filter bar ---------- */
.gallery__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 1240px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}

.gallery__filter {
  padding: 10px 22px;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-navy);
  background: transparent;
  border: 1px solid rgba(16, 38, 63, .22);
  border-radius: 2px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.gallery__filter span {
  margin-left: 7px;
  font-size: 10px;
  opacity: .55;
}
.gallery__filter:hover { border-color: var(--gold-deep); }
.gallery__filter.is-active {
  color: #1c1204;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: transparent;
}
.gallery__filter.is-active span { opacity: .7; }

/* ---------- masonry grid ---------- */
.gallery__grid {
  max-width: 1240px;
  margin: 0 auto;
  column-count: 4;
  column-gap: 14px;
}

.g-item {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--parch-2);
  break-inside: avoid;
  position: relative;
  box-shadow: 0 18px 36px -26px rgba(16, 38, 63, .45);
}
.g-item[hidden] { display: none; }

.g-item img {
  width: 100%;
  display: block;
  transition: transform .55s ease;
}
.g-item:hover img { transform: scale(1.06); }

.g-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 12, 24, .45));
  opacity: 0;
  transition: opacity .3s ease;
}
.g-item:hover::after { opacity: 1; }

.g-item::before {
  content: "+";
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: #1c1204;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
}
.g-item:hover::before { opacity: 1; transform: translateY(0); }

.g-item:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.gallery__empty {
  max-width: 1240px;
  margin: 40px auto 0;
  text-align: center;
  color: var(--muted);
  font-weight: 300;
}

/* ---------- closing CTA ---------- */
.gallery__cta {
  max-width: 1240px;
  margin: clamp(48px, 6vw, 76px) auto 0;
  text-align: center;
}
.gallery__cta p {
  margin: 0 0 16px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(20px, 2.6vw, 28px);
  color: var(--ink-navy);
}
.gallery__cta .btn:hover { color: #1c1204 !important; }

@media (max-width: 1100px) { .gallery__grid { column-count: 3; } }
@media (max-width: 760px)  { .gallery__grid { column-count: 2; column-gap: 10px; } }
@media (max-width: 760px)  { .g-item { margin-bottom: 10px; } }
@media (max-width: 360px)  { .gallery__grid { column-count: 1; } }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(4, 10, 20, .95);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox__stage {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox__img {
  max-width: min(92vw, 1400px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
  background: #0b1420;
}

.lightbox__caption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: rgba(242, 231, 207, .82);
}
.lightbox__count {
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--gold);
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.lightbox__close:hover { background: var(--gold); color: #1c1204; border-color: var(--gold); }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0 0 4px;
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.lightbox__nav:hover { background: var(--gold); color: #1c1204; border-color: var(--gold); }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox__nav { width: 40px; height: 40px; font-size: 22px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__img { max-height: 74vh; }
}

@media (prefers-reduced-motion: reduce) {
  .g-item img, .g-item::after, .g-item::before, .lightbox { transition: none; }
}
