/* ============================================
   PHOTO GALLERY - CSS MASONRY + PHOTOSWIPE
   Created: assets/css/gallery-masonry.css
   ============================================ */

/* Masonry Layout using CSS Columns */
.gallery-masonry {
  column-count: 4;
  column-gap: 1.5rem;
  padding: 2rem 0;
}

@media (max-width: 1200px) {
  .gallery-masonry {
    column-count: 3;
  }
}

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

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

/* Gallery Item */
.gallery-item {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: visible !important; /* Змінено з hidden щоб тінь була видима */
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  text-decoration: none;
}

.gallery-item:hover {
  transform: translateY(-5px) scale(1.02);
  /* Яскравіша золотава тінь */
  box-shadow: 0 10px 40px rgba(212, 175, 55, 0.6),
              0 5px 20px rgba(212, 175, 55, 0.4),
              0 0 60px rgba(212, 175, 55, 0.3) !important;
}

/* Gallery Image */
.gallery-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  transition: filter 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .gallery-img {
  filter: brightness(0.8);
  /* Додаткова тінь безпосередньо на зображення */
  box-shadow: 0 15px 50px rgba(212, 175, 55, 0.7),
              0 8px 25px rgba(212, 175, 55, 0.5) !important;
}

/* Hover Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--transition-smooth);
  pointer-events: none;
  border-radius: 12px;
}

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

.gallery-overlay i {
  font-size: 3rem;
  color: var(--accent-gold);
  animation: zoomPulse 2s infinite;
}

@keyframes zoomPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Border Glow Effect - Golden Shadow like Video */
.gallery-item::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(135deg, #D4AF37, rgba(212, 175, 55, 0.7));
  border-radius: 16px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  filter: blur(15px);
}

.gallery-item:hover::before {
  opacity: 0.8 !important;
}

/* ============================================
   PHOTOSWIPE 5 CUSTOM STYLING
   ============================================ */

/* PhotoSwipe Root Container */
.pswp {
  --pswp-bg: rgba(18, 18, 18, 0.95);
  --pswp-icon-color: var(--accent-gold);
  --pswp-icon-color-secondary: var(--text-primary);
  --pswp-placeholder-bg: var(--bg-secondary);
}

/* PhotoSwipe Buttons */
.pswp__button {
  background: rgba(212, 175, 55, 0.1) !important;
  backdrop-filter: blur(5px);
  transition: all var(--duration-normal);
}

.pswp__button:hover {
  background: rgba(212, 175, 55, 0.2) !important;
  transform: scale(1.1);
}

.pswp__button--close {
  top: 20px;
  right: 20px;
}

.pswp__button--arrow {
  width: 60px;
  height: 60px;
}

.pswp__button--arrow--prev {
  left: 20px;
}

.pswp__button--arrow--next {
  right: 20px;
}

/* PhotoSwipe Caption */
.pswp__caption {
  background: linear-gradient(
    0deg,
    rgba(18, 18, 18, 0.95) 0%,
    rgba(18, 18, 18, 0.7) 50%,
    transparent 100%
  ) !important;
  padding: 2rem 1.5rem 1.5rem !important;
}

.pswp__caption__center {
  color: var(--text-primary) !important;
  font-size: 1rem !important;
  font-family: var(--font-body) !important;
  text-align: center !important;
  max-width: 800px;
  margin: 0 auto;
}

/* PhotoSwipe Counter */
.pswp__counter {
  color: var(--accent-gold) !important;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  top: 20px;
  left: 20px;
}

/* PhotoSwipe Preloader */
.pswp__preloader {
  color: var(--accent-gold);
}

/* PhotoSwipe Zoom Icon */
.pswp__icn {
  fill: var(--accent-gold);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .gallery-masonry {
    padding: 1rem 0;
  }

  .gallery-item {
    margin-bottom: 1rem;
  }

  .gallery-overlay i {
    font-size: 2.5rem;
  }

  .pswp__caption {
    padding: 1.5rem 1rem 1rem !important;
  }

  .pswp__caption__center {
    font-size: 0.9rem !important;
  }

  .pswp__button--arrow {
    width: 50px;
    height: 50px;
  }
}

/* Print Optimization */
@media print {
  .gallery-overlay {
    display: none;
  }

  .gallery-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Accessibility: Focus States */
.gallery-item:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}

/* Loading State */
.gallery-img[loading="lazy"] {
  background: var(--bg-secondary);
}

/* Performance: GPU Acceleration */
.gallery-item,
.gallery-overlay,
.gallery-img {
  will-change: transform;
}

/* ============================================
   GLIGHTBOX CUSTOM STYLING
   ============================================ */

.glightbox-clean .gslide-description {
  background: linear-gradient(
    0deg,
    rgba(18, 18, 18, 0.95) 0%,
    rgba(18, 18, 18, 0.7) 50%,
    transparent 100%
  );
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 2rem 1.5rem;
}

.glightbox-clean .gslide-title {
  color: var(--accent-gold);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

