/* =========================================================
   BABA STUDIO — GALLERY PAGE STYLES
   ========================================================= */

/* ===== GALLERY HERO ===== */
.gallery-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/gallery_wedding.png');
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.05);
  transition: transform 6s ease;
}

.gallery-hero:hover .gallery-hero-bg {
  transform: scale(1.08);
}

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5,0,0,0.82) 0%,
    rgba(10,2,2,0.72) 50%,
    rgba(12,3,3,0.92) 100%
  );
  z-index: 1;
}

.gallery-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 24px 48px;
  max-width: 760px;
  animation: fade-up 0.9s ease 0.2s both;
}

.gallery-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 16px 0 18px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.8);
}

.gallery-hero-sub {
  font-size: 1rem;
  color: rgba(244,240,236,0.72);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 50px;
  border: 1.5px solid rgba(255,255,255,0.18);
  color: rgba(244,240,236,0.7);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
  padding: 60px 0 100px;
  background: var(--bg-primary);
}

.gallery-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Stats bar */
.gallery-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 40px;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.stat-count { color: var(--text-secondary); font-weight: 500; }
.stat-divider-sm { color: var(--accent); font-weight: 700; }

/* ===== MASONRY / CSS GRID GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 16px;
}

/* Variants */
.gallery-item        { grid-row: span 1; }
.gallery-item.gi-wide { grid-column: span 2; }
.gallery-item.gi-tall { grid-row: span 2; }

/* Item base styles */
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
  border-color: var(--border-color);
  box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 0 1px var(--border-color);
  z-index: 2;
}

/* Background image fill */
.gi-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

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

/* Overlay */
.gi-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5,0,0,0.88) 0%,
    rgba(5,0,0,0.4) 40%,
    transparent 70%
  );
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover .gi-overlay {
  opacity: 1;
}

.gi-info {
  flex: 1;
  min-width: 0;
}

.gi-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 50px;
  margin-bottom: 6px;
}

.gi-info h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gi-info p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
}

/* Zoom button */
.gi-zoom {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(200,16,46,0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 12px;
  transition: all var(--transition);
  border: 1.5px solid rgba(255,255,255,0.3);
  cursor: pointer;
}

.gi-zoom:hover {
  background: var(--accent);
  transform: scale(1.15);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* Hidden items (filtered) */
.gallery-item.hidden {
  display: none;
}

/* ===== NO RESULTS ===== */
.no-results {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.no-results span { font-size: 3rem; display: block; margin-bottom: 12px; }
.no-results p { font-size: 1rem; }

/* ===== GALLERY CTA ===== */
.gallery-cta {
  background: linear-gradient(135deg, #0e0202, #1a0508, #0e0202);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 72px 0;
}

.gallery-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.gcta-text h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.gcta-text p {
  font-size: 0.97rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.8;
}

.gcta-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(37,211,102,0.12);
  color: #25d366;
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 32px;
  border-radius: 50px;
  border: 1.5px solid rgba(37,211,102,0.3);
  transition: all var(--transition);
}

.btn-whatsapp:hover {
  background: #25d366;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.3);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 0, 0, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: lb-fade-in 0.25s ease;
  backdrop-filter: blur(8px);
}

@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox[hidden] { display: none; }

/* Close / Nav buttons */
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(200,16,46,0.85);
  border: 2px solid rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.lb-close { top: 24px; right: 24px; }
.lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }

.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.lb-prev:hover  { transform: translateY(-50%) scale(1.1); }
.lb-next:hover  { transform: translateY(-50%) scale(1.1); }

/* Content area */
.lb-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 200px);
  animation: lb-slide-up 0.3s ease;
}

@keyframes lb-slide-up {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.lb-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.lb-img {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 240px);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
  transition: opacity 0.25s ease;
}

.lb-img.loading { opacity: 0; }

/* Loader */
.lb-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lb-loader.hidden { display: none; }

.lb-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(200,16,46,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Caption */
.lb-caption {
  text-align: center;
  padding: 0 20px;
}

.lb-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--accent);
  padding: 3px 12px;
  border-radius: 50px;
  margin-bottom: 8px;
}

#lb-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

#lb-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Counter */
.lb-counter {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.5);
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid var(--border-subtle);
}

/* Thumbnails strip */
.lb-thumbnails {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.5);
  border-radius: var(--radius);
  max-width: calc(100vw - 40px);
  overflow-x: auto;
  scrollbar-width: thin;
}

.lb-thumb {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  opacity: 0.55;
}

.lb-thumb:hover   { opacity: 0.85; }
.lb-thumb.active  { border-color: var(--accent); opacity: 1; }

/* ===== RESPONSIVE GALLERY GRID ===== */

/* Large tablets */
@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 220px;
  }
  .gallery-item.gi-wide { grid-column: span 2; }
}

/* Tablets */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 210px;
    gap: 12px;
  }
  .gallery-item.gi-wide { grid-column: span 2; }
  .gallery-item.gi-tall { grid-row: span 1; }

  .gallery-cta-inner { flex-direction: column; text-align: center; }
  .gcta-btns { justify-content: center; width: 100%; }
}

/* Mobile / iPhone (≤768px) */
@media (max-width: 768px) {
  /* Gallery Hero */
  .gallery-hero { min-height: 58vh; }
  .gallery-hero-title { font-size: clamp(1.75rem, 7vw, 2.8rem); }
  .gallery-hero-sub { font-size: 0.88rem; margin-bottom: 24px; }
  .gallery-hero-content { padding: 52px 16px 36px; }

  /* Filter bar */
  .filter-bar { gap: 8px; }
  .filter-btn { font-size: 0.78rem; padding: 8px 16px; }

  /* Gallery grid */
  .gallery-section { padding: 40px 0 72px; }
  .gallery-container { padding: 0 16px; }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
    gap: 10px;
  }
  .gallery-item.gi-wide { grid-column: span 2; }
  .gallery-item.gi-tall { grid-row: span 1; }

  /* Item text */
  .gi-info h3 { font-size: 0.9rem; }
  .gi-info p  { font-size: 0.7rem; }
  .gi-tag     { font-size: 0.6rem; }
  .gi-zoom    { width: 34px; height: 34px; }

  /* Stats bar */
  .gallery-stats-bar { font-size: 0.78rem; gap: 10px; }

  /* Lightbox */
  .lb-prev  { left: 6px; width: 44px; height: 44px; }
  .lb-next  { right: 6px; width: 44px; height: 44px; }
  .lb-close { top: 10px; right: 10px; width: 44px; height: 44px; }
  .lb-content { max-width: calc(100vw - 108px); }
  .lb-img { max-width: calc(100vw - 108px); max-height: 52vh; }
  .lb-thumbnails { display: none; }
  .lb-counter { bottom: 16px; }
  #lb-title { font-size: 1rem; }
  #lb-desc  { font-size: 0.8rem; }

  /* CTA */
  .gallery-cta { padding: 52px 0; }
  .gcta-text h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .gcta-text p  { font-size: 0.9rem; }
  .btn-whatsapp { font-size: 0.95rem; padding: 14px 24px; }
}

/* iPhone 16 Pro and small phones (≤430px) */
@media (max-width: 430px) {
  .gallery-hero-content { padding: 48px 14px 28px; }
  .gallery-hero-title { font-size: clamp(1.6rem, 8vw, 2rem); }
  .gallery-hero-sub { font-size: 0.84rem; }
  .gallery-hero-bg { background-position: center center; }

  /* Single-column grid on very small phones */
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
    gap: 10px;
  }
  .gallery-item.gi-wide,
  .gallery-item.gi-tall { grid-column: span 1; grid-row: span 1; }

  /* Always show overlay on mobile (no hover) */
  .gi-overlay { opacity: 1; background: linear-gradient(to top, rgba(5,0,0,0.80) 0%, transparent 60%); }
  .gi-zoom { display: none; } /* hide zoom icon on small screens — tap card instead */

  /* Filter bar – horizontal scroll on tiny screens */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; padding: 0 14px 4px; gap: 8px; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }

  /* Gallery container */
  .gallery-container { padding: 0 14px; }

  /* Lightbox full-screen on small phones */
  .lb-content { max-width: calc(100vw - 96px); }
  .lb-img { max-width: calc(100vw - 96px); max-height: 50vh; border-radius: 8px; }
  .lb-caption { padding: 0 10px; }
  #lb-title { font-size: 0.95rem; }
  #lb-desc  { font-size: 0.76rem; }

  /* CTA */
  .gcta-btns { flex-direction: column; width: 100%; }
  .btn-primary, .btn-whatsapp { width: 100%; justify-content: center; }
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
  .gallery-hero { min-height: 50vh; }
  .gallery-hero-content { padding: 44px 20px 28px; }
  .gallery-hero-title { font-size: clamp(1.4rem, 5vw, 1.8rem); }
  .gallery-grid { grid-auto-rows: 160px; }
}

