/* ===== GALLERY PAGE STYLES ===== */

.gallery-section {
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  background: #ffffff;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

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

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

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

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

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

/* Lightbox Styles */
#lback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: all ease 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lback.show {
  opacity: 1;
  visibility: visible;
}

#lfront {
  position: relative;
  max-width: 80vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lfront img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  object-fit: contain;
}

.lightbox-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10000;
}

.lightbox-close {
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #333;
}

.lightbox-close:hover {
  background: rgba(255,255,255,1);
  transform: scale(1.1);
}

/* Navigation Controls */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #333;
  z-index: 10001;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,1);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  #lfront {
    max-width: 95vw;
    max-height: 85vh;
  }
  
  .lightbox-nav {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
}

@media (max-width: 480px) {
  #lfront {
    max-width: 98vw;
    max-height: 80vh;
  }
  
  .lightbox-nav {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
  
  .lightbox-prev {
    left: 5px;
  }
  
  .lightbox-next {
    right: 5px;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.2rem;
  }
  
  .gallery-image {
    height: 220px;
  }
  
}

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

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
  }
  
  .gallery-image {
    height: 180px;
  }
  
  
  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* Loading Animation */
.gallery-item {
  animation: fadeInUp 0.6s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessibility */
.gallery-item:focus {
  outline: 3px solid #3498db;
  outline-offset: 2px;
}

.gallery-image:focus {
  outline: none;
}

/* Print Styles */
@media print {
  .gallery-overlay,
  #lback {
    display: none;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  
  .gallery-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
