/* ============================================================
   PREMIUM GALLERY — gallery-premium.css
   Masonry + Filter + Lightbox for bilaalsadeer.com
   ============================================================ */

/* ---- Section wrapper ---- */
.gallery-section {
  padding: 80px 0 100px;
}

.gallery-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

/* Full-width wrapper for the Isotope grid */
.gallery-grid-outer {
  width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

.gallery-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted, #767676);
  text-transform: uppercase;
  margin: -8px 0 44px;
}

/* ---- Filter buttons ---- */
.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 52px;
}

.filter-btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 22px;
  height: 40px;
  line-height: 40px;
  border: 1.5px solid var(--color-border, #e8e8e8);
  background: transparent;
  color: var(--color-text-2, #555);
  cursor: pointer;
  border-radius: 0;
  transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.filter-btn:hover {
  border-color: var(--color-text, #0d0d0d);
  color: var(--color-text, #0d0d0d);
}

.filter-btn.is-checked {
  border-color: var(--color-text, #0d0d0d);
  background: var(--color-text, #0d0d0d);
  color: #fff;
}

/* ---- Isotope grid sizers ---- */
.isotope-grid {
  /* Isotope positions items absolutely inside here */
}

.grid-sizer {
  width: 32%;
}

.gutter-sizer {
  width: 2%;
}

/* ---- Grid items ---- */
.grid-item {
  width: 32%;
  margin-bottom: 1.5%;
}

/* Isotope repositioning uses spring easing */
.grid-item {
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Inner wrap — Isotope positions .grid-item; we animate .gi-wrap */
.gi-wrap {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface, #fafaf8);
  /* stagger fade-in start state */
  opacity: 0;
  transform: translateY(22px);
  /* spring easing matches item repositioning feel */
  transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.grid-item.is-visible .gi-wrap {
  opacity: 1;
  transform: translateY(0);
}

/* Image — natural proportions, no forced crop */
.gi-wrap img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover zoom */
.gi-wrap:hover img {
  transform: scale(1.07);
}

/* ---- Hover overlay ---- */
.grid-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.54);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  opacity: 0;
  transition: opacity 0.35s ease;
  padding: 20px;
}

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

/* ---- Pinterest "Save" button ---- */
.pin-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e60023;
  color: #fff;
  border-radius: 20px;
  padding: 6px 10px 6px 7px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.18s ease;
  pointer-events: none;
  white-space: nowrap;
}

.gi-wrap:hover .pin-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pin-btn:hover {
  background: #c4001a;
}

.overlay-category {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold, #b8966a);
}

.overlay-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  font-weight: 400;
  color: #fff;
  margin: 0;
  text-align: center;
  line-height: 1.35;
}

/* ---- Gallery footer CTAs ---- */
.gallery-ctas {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .grid-sizer,
  .grid-item { width: 48.5%; }
  .gutter-sizer { width: 3%; }
  .grid-item { margin-bottom: 3%; }
}

@media (max-width: 580px) {
  .grid-sizer,
  .grid-item { width: 100%; }
  .gutter-sizer { width: 0; }
  .grid-item { margin-bottom: 14px; }

  .gallery-section { padding: 60px 0 80px; }
  .gallery-filters { gap: 6px; margin-bottom: 36px; }
  .filter-btn { font-size: 0.63rem; padding: 0 14px; height: 36px; line-height: 36px; }
  .gallery-container { padding: 0 16px; }
}

/* ============================================================
   PREMIUM LIGHTBOX
   ============================================================ */

.premium-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 7, 0.97);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 60px 70px 100px;
  box-sizing: border-box;
}

.premium-lightbox.lb-open {
  display: flex;
}

/* Backdrop click zone — sits behind content, above overlay bg */
.lb-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: zoom-out;
}

/* Inner content sits above backdrop */
.lb-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
}

/* Main image */
.lb-img {
  display: block;
  max-width: 82vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.18s ease;
}

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

/* Caption row */
.lb-caption {
  margin-top: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lb-cat {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold, #b8966a);
}

.lb-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  font-weight: 400;
  color: rgba(255,255,255,0.88);
  margin: 0;
}

/* Close button — top right */
.lb-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.22);
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lb-close:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Prev / Next buttons */
.lb-prev,
.lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,0.22);
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lb-prev { left: 18px; }
.lb-next { right: 18px; }

.lb-prev:hover,
.lb-next:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Counter e.g. "2 / 6" */
.lb-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.35);
}

/* ---- WhatsApp CTA inside lightbox ---- */
.lb-wa-cta {
  display: inline-block;
  margin-top: 18px;
  padding: 0 28px;
  height: 44px;
  line-height: 44px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--color-accent, #0e6c65);
  white-space: nowrap;
  transition: background 0.22s ease, transform 0.2s ease;
}

.lb-wa-cta:hover {
  background: #0a5550;
  transform: translateY(-1px);
}

@media (max-width: 580px) {
  .premium-lightbox { padding: 50px 12px 90px; }
  .lb-img { max-width: 95vw; max-height: 60vh; }
  .lb-prev { left: 8px; width: 38px; height: 38px; }
  .lb-next { right: 8px; width: 38px; height: 38px; }
  .lb-wa-cta { font-size: 0.65rem; padding: 0 20px; height: 40px; line-height: 40px; }
}

/* ============================================================
   GALLERY SOCIAL — heart/like + share  (gallery-social.js)
   ============================================================ */

/* ---- Heart animation ---- */
@keyframes heartPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.42); }
  70%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}

/* ---- Heart SVG transitions (shared by grid + lightbox) ---- */
.heart-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 0.18s ease;
}
.liked .heart-icon path {
  fill: currentColor;
}

/* ---- Grid overlay heart button ---- */
.gi-heart {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(13, 13, 13, 0.58);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.gi-heart:hover,
.gi-heart.liked {
  color: #e25c8a;
  border-color: #e25c8a;
  background: rgba(226, 92, 138, 0.14);
}

.gi-heart .heart-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.gi-heart .h-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.48rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  min-width: 8px;
}

.gi-heart.heart-pop,
.lb-heart-btn.heart-pop {
  animation: heartPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ---- Lightbox share row ---- */
.lb-share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.lb-heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.lb-heart-btn:hover,
.lb-heart-btn.liked {
  color: #e25c8a;
  border-color: #e25c8a;
}

.lb-heart-btn .heart-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.lb-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.lb-share-btn:hover              { color: rgba(255,255,255,0.9);  border-color: rgba(255,255,255,0.5); }
.lb-share-btn.lb-share-pinterest:hover { color: #e60023; border-color: #e60023; }
.lb-share-btn.lb-share-facebook:hover  { color: #1877f2; border-color: #1877f2; }

.lb-share-btn .link-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

@media (max-width: 580px) {
  .lb-share-row { gap: 5px; margin-top: 10px; }
  .lb-share-btn,
  .lb-heart-btn { height: 32px; font-size: 0.58rem; padding: 0 9px; }
}
