/* ============================================================
   GALLERY SECTION  ·  Shivoham Retreat
   ============================================================ */

.gallery {
  margin: 1rem;
  width: calc(100% - 2rem);
  background: #FAF8F2;
  border-radius: 16px;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2.5rem);
}

/* ── Header ─────────────────────────────────── */
.gallery__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.gallery__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--f-sans, sans-serif);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #7A6C5C;
  margin-bottom: 1rem;
}

.gallery__eyebrow::before {
  content: '';
  width: 2rem;
  height: 1.5px;
  background: #111C17;
  flex-shrink: 0;
}

.gallery__title {
  font-family: var(--f-sans, sans-serif);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.2;
  color: #1C3228;
  letter-spacing: -0.02em;
}

.gallery__title em {
  font-style: normal;
  font-weight: 300;
  color: #6A5E50;
}

.gallery__all {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-sans, sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1C3228;
  border-bottom: 1.5px solid #1C3228;
  padding-bottom: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: gap 0.22s ease, opacity 0.22s ease;
  text-decoration: none;
}
.gallery__all:hover { gap: 1rem; opacity: 0.6; }

/* ── Grid ───────────────────────────────────── */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 120px;
  gap: 0.75rem;
}

/* ── Item ───────────────────────────────────── */
.gal-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  background: #E2D9CA;
}

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

.gal-item:hover img { transform: scale(1.07); }

/* Dark overlay on hover */
.gal-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gal-item:hover::after { opacity: 1; }

/* Caption */
.gal-item__caption {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  font-family: var(--f-serif, Georgia, serif);
  font-style: italic;
  font-size: 1rem;
  color: #ffffff;
  z-index: 2;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gal-item:hover .gal-item__caption {
  opacity: 1;
  transform: translateY(0);
}

/* ── Grid placements ────────────────────────── */
.gal-item:nth-child(1) { grid-column: span 5; grid-row: span 4; }
.gal-item:nth-child(2) { grid-column: span 4; grid-row: span 2; }
.gal-item:nth-child(3) { grid-column: span 3; grid-row: span 2; }
.gal-item:nth-child(4) { grid-column: span 2; grid-row: span 2; }
.gal-item:nth-child(5) { grid-column: span 2; grid-row: span 2; }
.gal-item:nth-child(6) { grid-column: span 3; grid-row: span 2; }
.gal-item:nth-child(7)  { grid-column: span 6; grid-row: span 2; }
.gal-item:nth-child(8)  { grid-column: span 6; grid-row: span 2; }
.gal-item:nth-child(9)  { grid-column: span 6; grid-row: span 2; }
.gal-item:nth-child(10) { grid-column: span 6; grid-row: span 2; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .gallery__grid {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 100px;
  }

  .gal-item:nth-child(1) { grid-column: span 6; grid-row: span 3; }
  .gal-item:nth-child(2) { grid-column: span 3; grid-row: span 2; }
  .gal-item:nth-child(3) { grid-column: span 3; grid-row: span 2; }
  .gal-item:nth-child(4) { grid-column: span 3; grid-row: span 2; }
  .gal-item:nth-child(5) { grid-column: span 3; grid-row: span 2; }
  .gal-item:nth-child(6) { grid-column: span 6; grid-row: span 2; }
  .gal-item:nth-child(7)  { grid-column: span 3; grid-row: span 2; }
  .gal-item:nth-child(8)  { grid-column: span 3; grid-row: span 2; }
  .gal-item:nth-child(9)  { grid-column: span 3; grid-row: span 2; }
  .gal-item:nth-child(10) { grid-column: span 3; grid-row: span 2; }

  .gallery__head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
  }

  .gal-item { grid-column: span 1 !important; grid-row: span 1 !important; }
  .gal-item:nth-child(1) { grid-column: span 2 !important; grid-row: span 2 !important; }
}

/* ── Lightbox ──────────────────────────────────── */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.lb-media {
  max-width: 88vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-media img {
  max-width: 88vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.lb-caption {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-sans, sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

.lb-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s;
  z-index: 10000;
}
.lb-close:hover { background: rgba(255,255,255,0.22); }

.lb-prev,
.lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s;
  z-index: 10000;
}
.lb-prev { left: 1.25rem; }
.lb-next { right: 1.25rem; }
.lb-prev:hover,
.lb-next:hover { background: rgba(255,255,255,0.22); }
