/* ============================================
   Le Timatou — Gallery Styles
   ============================================ */

/* --- Page header --- */
.gallery-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-white);
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
  position: relative;
}

.gallery-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--color-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.gallery-header h1 {
  color: var(--color-white);
}

/* --- Category --- */
.gallery-category {
  margin-bottom: var(--space-xl);
}

.gallery-category h2 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 3px solid var(--color-primary-bg);
  display: inline-block;
}

/* --- Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-sm);
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.05);
}

.gallery-item .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover .play-overlay {
  background: rgba(0, 0, 0, 0.35);
}

.play-overlay svg {
  width: 50px;
  height: 50px;
  fill: var(--color-white);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* --- Empty state --- */
.gallery-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

.gallery-empty svg {
  width: 80px;
  height: 80px;
  fill: var(--color-border);
  margin-bottom: var(--space-sm);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

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

.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--color-white);
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 1001;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev { left: var(--space-md); }
.lightbox-next { right: var(--space-md); }

.lightbox-counter {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  z-index: 1001;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-xs);
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .lightbox-prev { left: var(--space-xs); }
  .lightbox-next { right: var(--space-xs); }
}
