/* ==========================================================================
   GALLERY PAGES — Beautiful Lightbox + Full Responsive
   ========================================================================== */

/* ── Gallery Tabs Header ─────────────────────────────────────────────────── */
.gallery-tabs {
  text-align: center;
  margin-top: clamp(80px, 10vw, 100px);
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.gallery-tabs .tab-bar {
  display: flex;
  gap: clamp(0.5rem, 2vw, 1rem);
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 1rem;
}

/* ── Gallery Grid ────────────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(220px, 28vw, 300px), 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  display: block;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.gallery-item:hover {
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Overlay on hover */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.7) 0%,
    rgba(255,255,255,0.2) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.gallery-item-overlay i,
.gallery-item-overlay svg {
  width: clamp(24px, 4vw, 32px);
  height: clamp(24px, 4vw, 32px);
  color: #000000;
  background: #ffffff;
  padding: clamp(0.6rem, 1.5vw, 0.875rem);
  border-radius: 50%;
  transform: translateY(16px) scale(0.85);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-item:hover .gallery-item-overlay i,
.gallery-item:hover .gallery-item-overlay svg {
  transform: translateY(0) scale(1);
}

.gallery-item-overlay .overlay-title {
  color: var(--color-white);
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease 0.05s;
}

.gallery-item:hover .gallery-item-overlay .overlay-title {
  opacity: 1;
  transform: translateY(0);
}

/* ── GLightbox Premium Override ──────────────────────────────────────────── */
.glightbox-container .goverlay {
  background: rgba(0, 0, 0, 0.96) !important;
}

.glightbox-clean .gslide-image img {
  border-radius: var(--radius-md) !important;
  box-shadow:
    0 0 0 1px rgba(212,175,55,0.3),
    0 30px 80px rgba(0,0,0,0.8) !important;
  max-height: 85vh;
  object-fit: contain;
}

.glightbox-clean .gclose {
  top: 16px !important;
  right: 16px !important;
  width: 42px !important;
  height: 42px !important;
  background: rgba(255,255,255,0.15) !important;
  border: 1.5px solid var(--color-white) !important;
  border-radius: 50% !important;
  transition: all 0.25s ease !important;
}

.glightbox-clean .gclose:hover {
  background: var(--color-white) !important;
  transform: rotate(90deg) scale(1.1) !important;
}

.glightbox-clean .gclose svg,
.glightbox-clean .gclose path {
  fill: var(--color-white) !important;
}

.glightbox-clean .gclose:hover svg,
.glightbox-clean .gclose:hover path {
  fill: #000 !important;
}

.glightbox-clean .gnext,
.glightbox-clean .gprev {
  width: 48px !important;
  height: 48px !important;
  background: rgba(14,14,14,0.85) !important;
  border: 1.5px solid rgba(255,255,255,0.4) !important;
  border-radius: 50% !important;
  transition: all 0.25s ease !important;
}

.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover {
  background: var(--color-white) !important;
  border-color: transparent !important;
}

.glightbox-clean .gnext svg,
.glightbox-clean .gprev svg {
  color: var(--color-white) !important;
}

.glightbox-clean .gnext:hover svg,
.glightbox-clean .gprev:hover svg {
  color: #000 !important;
}

.glightbox-clean .gdesc-inner {
  background: rgba(10,10,10,0.95) !important;
  backdrop-filter: blur(16px) !important;
  border-top: 1px solid rgba(255,255,255,0.2) !important;
  padding: clamp(0.875rem, 2vw, 1.25rem) clamp(1rem, 3vw, 2rem) !important;
}

.glightbox-clean .gslide-title {
  color: var(--color-white) !important;
  font-family: var(--font-heading) !important;
  font-size: clamp(1rem, 2.5vw, 1.4rem) !important;
  font-weight: 500 !important;
  margin-bottom: 0.35rem !important;
}

.glightbox-clean .gslide-desc {
  color: var(--color-text-muted) !important;
  font-family: var(--font-body) !important;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem) !important;
}

/* Gallery counter dots */
.glightbox-clean .gbtn.gprev { left: 8px !important; }
.glightbox-clean .gbtn.gnext { right: 8px !important; }

/* ── Before / After Slider ───────────────────────────────────────────────── */
.before-after-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(300px, 42vw, 480px), 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.ba-card {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: clamp(0.875rem, 2vw, 1.25rem);
  transition: border-color var(--transition-normal), transform 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.ba-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.ba-info {
  margin-top: 1rem;
  padding: 0 0.5rem;
}

.ba-title {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

img-comparison-slider {
  border-radius: var(--radius-sm);
  overflow: hidden;
  outline: none;
  width: 100%;
  display: block;
}

img-comparison-slider img {
  width: 100%;
  height: clamp(200px, 30vw, 320px);
  object-fit: cover;
}

.custom-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(212,175,55,0.5);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1168px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 968px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 0.875rem; }
  .before-after-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

@media (max-width: 868px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .before-after-grid { gap: 1rem; }
}

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .before-after-grid { grid-template-columns: 1fr; max-width: 560px; margin-left: auto; margin-right: auto; }
  img-comparison-slider img { height: clamp(180px, 40vw, 260px); }
  .glightbox-clean .gnext, .glightbox-clean .gprev { width: 38px !important; height: 38px !important; }
}

@media (max-width: 668px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .gallery-tabs .tab-bar { gap: 0.5rem; }
}

@media (max-width: 568px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .gallery-item { border-radius: var(--radius-sm); }
  .before-after-grid { max-width: 100%; }
}

@media (max-width: 468px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  img-comparison-slider img { height: clamp(150px, 45vw, 200px); }
  .ba-card { padding: 0.75rem; }
  .glightbox-clean .gnext { right: 4px !important; }
  .glightbox-clean .gprev { left: 4px !important; }
}

@media (max-width: 368px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
  img-comparison-slider img { height: 150px; }
}
