/* ==========================================================================
   WORK GALLERY STYLES - معرض الأعمال
   4 Columns Desktop | 2 Columns Tablet & Mobile
   Immediate Visibility & High-Fidelity Rendering
   ========================================================================== */

.gallery-section {
  background-color: #ffffff;
  position: relative;
}

.gallery-filter-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.gallery-filter-btn {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  background: var(--color-bg-light-alt);
  color: var(--color-text-dark);
  border: 1px solid #e2dacd;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gallery-filter-btn:hover {
  background: #ebe2d3;
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.gallery-filter-btn.active {
  background: var(--color-primary);
  color: #120e22;
  border-color: var(--color-primary);
  box-shadow: 0 4px 18px rgba(212, 163, 64, 0.4);
}

/* --------------------------------------------------------------------------
   GALLERY GRID: 4 COLUMNS DESKTOP, 2 COLUMNS TABLET & MOBILE
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  position: relative;
  width: 100%;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1c1633;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  border: 1px solid rgba(212, 163, 64, 0.2);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  opacity: 1 !important;
  visibility: visible !important;
  display: block;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 20px rgba(212, 163, 64, 0.35);
  border-color: var(--color-primary);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1 !important;
  visibility: visible !important;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter var(--transition-fast);
}

.gallery-item:hover img {
  transform: scale(1.08);
  filter: brightness(0.85);
}

/* Hover Overlay */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 14, 34, 0) 25%, rgba(18, 14, 34, 0.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.gallery-zoom-icon {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(212, 163, 64, 0.95);
  color: #120e22;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.6);
  opacity: 0;
  transition: all var(--transition-normal);
  pointer-events: none;
}

.gallery-item:hover .gallery-zoom-icon {
  transform: scale(1);
  opacity: 1;
}

.gallery-zoom-icon svg {
  width: 18px;
  height: 18px;
}

.gallery-title {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
  transform: translateY(8px);
  transition: transform var(--transition-normal);
}

.gallery-tag {
  color: var(--color-primary-light);
  font-size: 0.82rem;
  font-weight: 600;
  transform: translateY(8px);
  transition: transform var(--transition-normal) 0.05s;
}

.gallery-item:hover .gallery-title,
.gallery-item:hover .gallery-tag {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   LIGHTBOX STYLES
   -------------------------------------------------------------------------- */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 15, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.lightbox-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(212, 163, 64, 0.3);
}

.lightbox-caption {
  margin-top: 14px;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
}

.lightbox-counter {
  color: var(--color-primary-light);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 4px;
}

.lightbox-close {
  position: absolute;
  top: -45px;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox-close:hover {
  background: var(--color-primary);
  color: #120e22;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: var(--color-primary);
  color: #120e22;
  border-color: var(--color-primary);
}

.lightbox-prev {
  right: -70px;
}

.lightbox-next {
  left: -70px;
}

/* --------------------------------------------------------------------------
   RESPONSIVE: EXACT USER REQUIREMENT: 4 COLS DESKTOP, 2 COLS TABLET & MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }
  .lightbox-prev {
    right: 10px;
  }
  .lightbox-next {
    left: 10px;
  }
  .lightbox-nav-btn {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .gallery-title {
    font-size: 0.9rem;
  }
  .gallery-tag {
    font-size: 0.75rem;
  }
  .gallery-overlay {
    padding: 10px;
  }
}
