/* Masonry Gallery Styling */
.masonry-gallery-wrapper {
  padding: 80px 0 100px;
  background: #ffffff;
}

.masonry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 20px;
  grid-auto-rows: 10px;
  grid-auto-flow: dense;
}

.masonry-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #f8f8f8;
  width: 100%;
}

.masonry-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.masonry-item:hover img {
  transform: scale(1.05);
}

/* Responsive Grid */
@media (max-width: 1200px) {
  .masonry-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 15px;
  }

  .masonry-gallery-wrapper {
    padding: 60px 0 80px;
  }
}

@media (max-width: 480px) {
  .masonry-grid {
    grid-template-columns: 1fr;
  }
}

.masonry-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.masonry-item:hover .masonry-item-overlay {
  opacity: 1;
}

.masonry-item-icon {
  color: white;
  font-size: 32px;
  pointer-events: none;
}

/* Lightbox Styling - Mobile Drawer Style */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #0E0E0E;
  z-index: 9999;
  overscroll-behavior-y: contain;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translate(0, 10%) rotate(0) scale(0.96);
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: visibility 1s cubic-bezier(0.575, 0.015, 0, 0.995),
    opacity 1s cubic-bezier(0.575, 0.015, 0, 0.995),
    clip-path 1s cubic-bezier(0.575, 0.015, 0, 0.995),
    transform 1s cubic-bezier(0.575, 0.015, 0, 0.995);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
  transform: translate(0, 0) rotate(0) scale(1);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.lightbox-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 80px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  border-radius: 8px;
}

.lightbox.active .lightbox-image {
  opacity: 1;
  transform: scale(1);
}

.lightbox-close {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all 0.3s ease;
  padding: 0;
  opacity: 0;
  transform: scale(0.8);
}

.lightbox.active .lightbox-close {
  opacity: 0.7;
  transform: scale(1);
  transition: opacity 0.3s ease 0.5s, transform 0.3s ease 0.5s;
}

.lightbox-close:hover {
  opacity: 1 !important;
  transform: scale(1.1) rotate(90deg);
}

.lightbox-close i {
  font-size: 28px;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
  opacity: 0;
}

.lightbox.active .lightbox-nav {
  opacity: 0.7;
  transition: opacity 0.3s ease 0.5s;
}

.lightbox-nav:hover {
  opacity: 1 !important;
  transform: translateY(-50%) scale(1.2);
}

.lightbox-nav i {
  font-size: 32px;
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-counter {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 16px;
  font-weight: 500;
  z-index: 10001;
  opacity: 0;
  letter-spacing: 0.5px;
}

.lightbox.active .lightbox-counter {
  opacity: 0.8;
  transition: opacity 0.3s ease 0.6s;
}

/* Responsive Lightbox */
@media (max-width: 768px) {
  .lightbox-content {
    padding: 100px 20px 80px;
  }

  .lightbox-nav {
    width: 50px;
    height: 50px;
  }

  .lightbox-nav i {
    font-size: 24px;
  }

  .lightbox-prev {
    left: 15px;
  }

  .lightbox-next {
    right: 15px;
  }

  .lightbox-close {
    width: 50px;
    height: 50px;
    top: 20px;
    right: 20px;
  }

  .lightbox-close i {
    font-size: 24px;
  }

  .lightbox-counter {
    bottom: 30px;
    font-size: 14px;
  }
}

/* Empty state message */
.gallery-empty-message {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.gallery-empty-message h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #333;
}

.gallery-empty-message p {
  font-size: 16px;
}