/* Gallery Styles */

/* Homepage Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.gallery-grid .gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

/* Full Gallery Page */
.galleries-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.gallery-section {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid #eee;
}

.gallery-section:last-child {
  border-bottom: none;
}

.gallery-title {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 300;
}

.gallery-description {
  font-size: 1.1rem;
  color: #666;
  text-align: center;
  margin-bottom: 30px;
  font-style: italic;
}

.gallery-grid-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.gallery-item-full {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  background: #fff;
}

.gallery-item-full:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.gallery-item-full .gallery-lightbox {
  display: block;
  position: relative;
  overflow: hidden;
}

.gallery-item-full .gallery-lightbox::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.gallery-item-full .gallery-lightbox::after {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.gallery-item-full .gallery-lightbox:hover::before,
.gallery-item-full .gallery-lightbox:hover::after {
  opacity: 1;
}

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

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

/* No galleries message */
.no-galleries {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.no-galleries h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #333;
}

.no-galleries p {
  font-size: 1.1rem;
}

.no-images {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 20px;
}

/* Admin styles for gallery meta box */
#gallery-images-container .gallery-image-item {
  display: inline-block;
  margin: 10px;
  position: relative;
}

#gallery-images-container .gallery-image-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 5px;
}

#gallery-images-container .gallery-image-item .remove-gallery-image {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 12px;
}

#gallery-images-container .gallery-image-item .remove-gallery-image:hover {
  background: #c82333;
}

/* Lightbox Styles */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 5px 10px;
  transition: opacity 0.3s ease;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: 15px;
  font-size: 1.1rem;
  max-width: 600px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }
  
  .gallery-grid .gallery-item .gallery-image {
    height: 150px;
  }
  
  .gallery-grid-full {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
  
  .gallery-item-full .gallery-image-full {
    height: 200px;
  }
  
  .gallery-title {
    font-size: 2rem;
  }
  
  .lightbox-content {
    max-width: 95%;
  }
  
  .lightbox-image {
    max-height: 70vh;
  }
  
  .lightbox-close {
    top: -30px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-grid-full {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .galleries-container {
    padding: 10px;
  }
}
