/**
 * Bildergalerie & Lightbox Styles
 */

/* ===== GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.gallery-item {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

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

.gallery-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.05);
}

/* Video-spezifische Styles */
.gallery-item.video-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background-color: rgba(92, 64, 51, 0.9);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  transition: all 0.3s ease;
}

.gallery-item.video-item::after {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  color: white;
  font-size: 24px;
  z-index: 11;
  pointer-events: none;
}

.gallery-item.video-item:hover::before {
  background-color: var(--accent-gold);
  transform: translate(-50%, -50%) scale(1.1);
}

.gallery-item.video-item .gallery-caption::before {
  content: '🎬 ';
}

.gallery-caption {
  padding: 0.75rem;
  text-align: center;
  color: var(--text-medium);
  font-size: 0.9rem;
  background-color: var(--light-cream);
  margin: 0;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  animation: lightboxZoom 0.3s ease;
}

/* Video in Lightbox */
.lightbox-content.video-player {
  max-width: 90%;
  max-height: 90vh;
  width: auto;
  height: auto;
}

@keyframes lightboxZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: var(--accent-gold);
}

.lightbox-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  text-align: center;
  max-width: 80%;
}

/* Lightbox Navigation Arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(139, 111, 71, 0.8);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  z-index: 10000;
}

.lightbox-nav:hover {
  background-color: var(--accent-gold);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }

  .gallery-image {
    height: 150px;
  }

  .lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }

  .lightbox-nav {
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-caption {
    bottom: 10px;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-image {
    height: 200px;
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 80vh;
  }

  .lightbox-nav {
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
  }
}
