/* Gallery and Lightbox styles for Fotogalerie */

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Masonry Layout */
.gallery-masonry {
  column-count: 3;
  column-gap: 1.5rem;
  width: 100%;
}

@media (max-width: 900px) {
  .gallery-masonry {
    column-count: 2;
    column-gap: 1.2rem;
  }
}

@media (max-width: 600px) {
  .gallery-masonry {
    column-count: 1;
    column-gap: 0;
  }
}

.gallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(195, 155, 79, 0.15);
  background-color: var(--color-charcoal-pine);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--color-old-gold);
  box-shadow: 0 8px 25px rgba(195, 155, 79, 0.15);
}

.gallery-img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.85;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.04);
  opacity: 1;
}

/* Caption Overlay */
.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1rem;
  background: linear-gradient(to top, rgba(7, 10, 13, 0.95) 0%, rgba(7, 10, 13, 0.4) 60%, transparent 100%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

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

.gallery-item-title {
  font-family: var(--font-h2-h3);
  font-size: 1.25rem;
  color: var(--color-text-light);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  display: block;
}

/* Lightbox overlay styling */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(6, 9, 13, 0.98);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(10px);
}

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

/* Lightbox Close button */
.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: var(--color-old-gold);
  font-size: 2.5rem;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  z-index: 2100;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  transform: scale(1.1) rotate(90deg);
  color: var(--color-text-light);
}

/* Lightbox navigation buttons */
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 20, 25, 0.6);
  border: 1px solid rgba(195, 155, 79, 0.3);
  color: var(--color-old-gold);
  font-size: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  z-index: 2100;
}

.lightbox-btn:hover {
  background: var(--color-old-gold);
  color: var(--color-dark-wood);
  border-color: var(--color-old-gold);
  box-shadow: 0 0 15px rgba(195, 155, 79, 0.4);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

@media (max-width: 768px) {
  .lightbox-btn {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }
  .lightbox-prev {
    left: 1rem;
  }
  .lightbox-next {
    right: 1rem;
  }
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
  }
}

/* Lightbox content container */
.lightbox-content-wrapper {
  max-width: 85%;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  border: 1px solid rgba(195, 155, 79, 0.2);
  box-shadow: 0 10px 40px rgba(0,0,0,0.9);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-img {
  opacity: 1;
  transform: scale(1);
}

/* Lightbox caption */
.lightbox-caption {
  margin-top: 1.5rem;
  font-family: var(--font-h2-h3);
  font-size: 1.5rem;
  color: var(--color-old-gold);
  text-align: center;
  text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}
