/* =========================================
   GALLERY SPECIFIC STYLES
   ========================================= */

/* Controls and Status */
.gallery-controls {
  text-align: center;
  margin-bottom: 2rem;
}

.gallery-status {
  font-size: 1rem;
  color: var(--text-secondary);
  padding: 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  display: inline-block;
  border: 1px solid var(--border-color);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes galleryPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Premium Masonry Grid */
.gallery-masonry {
  column-count: 1;
  column-gap: 1.5rem;
  padding: 1rem 0;
}

@media (min-width: 600px) { .gallery-masonry { column-count: 2; } }
@media (min-width: 900px) { .gallery-masonry { column-count: 3; } }
@media (min-width: 1200px) { .gallery-masonry { column-count: 4; } }

/* Gallery Items */
.gallery-item {
  position: relative;
  break-inside: avoid;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transform: translateZ(0);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-hover);
  z-index: 10;
}

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

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

/* Overlay for hover */
.gallery-item__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 50%);
  opacity: 0; transition: opacity 0.3s ease;
  display: flex; align-items: flex-end; padding: 1.5rem;
  pointer-events: none;
}

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

.gallery-item__title {
  color: #ffffff; font-weight: 600; font-size: 1.1rem;
  margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Play icon for videos */
.gallery-item__play-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; pointer-events: none;
  transition: transform 0.3s ease, background 0.3s ease;
}

.gallery-item:hover .gallery-item__play-icon {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.1);
}

/* =========================================
   LIGHTBOX STYLES
   ========================================= */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active { opacity: 1; visibility: visible; }

.lightbox__close {
  position: absolute; top: 24px; right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: none; color: white;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s, transform 0.2s;
  z-index: 10000;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2); transform: scale(1.1);
}

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

.lightbox__content img,
.lightbox__content video {
  max-width: 100%; max-height: 85vh; object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.95); opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.lightbox.active .lightbox__content img,
.lightbox.active .lightbox__content video {
  transform: scale(1); opacity: 1;
}

.lightbox__caption {
  color: white; margin-top: 16px; font-size: 1.1rem;
  font-weight: 500; text-align: center; max-width: 800px;
}
