/* Events Gallery Section Styles */
.events-gallery-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
  padding: clamp(3rem, 6vw, 4.5rem) 1rem;
  position: relative;
  overflow: hidden;
}

.events-gallery-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" opacity="0.03"><path d="M30,30 Q50,10 70,30 T90,50 Q70,70 50,90 T10,50 Q30,30 50,10 T90,30" fill="none" stroke="%232a7f62" stroke-width="1"/></svg>');
  background-size: 120px;
  background-repeat: repeat;
  z-index: 0;
}

.events-gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.events-gallery-header {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.events-gallery-subtitle {
  display: inline-block;
  font-size: 0.82rem;
  color: #2a7f62;
  background: rgba(42, 127, 98, 0.1);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.events-gallery-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: #142c25;
  margin-bottom: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.events-gallery-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #2a7f62 0%, #66bb6a 100%);
  border-radius: 2px;
  margin: 1.5rem auto;
}

.events-gallery-description {
  color: #5a6a67;
  font-size: clamp(1rem, 1.9vw, 1.08rem);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.75;
}

/* Gallery Grid & Cards */
.events-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 0 auto;
}

.events-gallery-card {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  border: 1px solid rgba(42, 127, 98, 0.12);
}

.events-gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 42px rgba(22, 45, 38, 0.16);
}

/* Carousel Styles */
.events-gallery-carousel {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 3;
}

.carousel-prev, 
.carousel-next {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 4;
}

.carousel-prev:focus-visible,
.carousel-next:focus-visible,
.events-gallery-view-btn:focus-visible,
.events-gallery-load-more:focus-visible,
.events-gallery-lightbox-prev:focus-visible,
.events-gallery-lightbox-next:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.carousel-prev:hover, 
.carousel-next:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 3;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: white;
  transform: scale(1.2);
}

/* Card Content Styles */
.events-gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
  z-index: 2;
}

.events-gallery-content {
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.events-gallery-card:hover .events-gallery-content {
  transform: translateY(0);
}

.events-gallery-caption {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.events-gallery-date {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.events-gallery-view-btn {
  background: transparent;
  color: white;
  border: 2px solid white;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.events-gallery-view-btn:hover {
  background: white;
  color: #2a7f62;
}

/* Footer & Load More */
.events-gallery-footer {
  text-align: center;
  margin-top: 3rem;
}

.events-gallery-load-more {
  background: white;
  color: #2a7f62;
  border: 2px solid #2a7f62;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.events-gallery-load-more:hover {
  background: rgba(42, 127, 98, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Lightbox Styles */
.events-gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.events-gallery-lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.events-gallery-lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 1002;
}

.events-gallery-lightbox-close:hover {
  color: #2a7f62;
}

.events-gallery-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.events-gallery-lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.events-gallery-lightbox-caption {
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 1.2rem;
}

.events-gallery-lightbox-prev,
.events-gallery-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1001;
}

.events-gallery-lightbox-prev:hover,
.events-gallery-lightbox-next:hover {
  background: rgba(42, 127, 98, 0.7);
}

.events-gallery-lightbox-prev {
  left: 30px;
}

.events-gallery-lightbox-next {
  right: 30px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .events-gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .events-gallery-section {
    padding: 3rem 1rem;
  }
  
  .events-gallery-title {
    font-size: 2rem;
  }
  
  .carousel-controls {
    padding: 0 0.5rem;
  }
  
  .carousel-prev, 
  .carousel-next {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .events-gallery-lightbox-prev,
  .events-gallery-lightbox-next {
    width: 50px;
    height: 50px;
    font-size: 2rem;
  }
  
  .events-gallery-lightbox-close {
    font-size: 2.5rem;
    top: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .events-gallery-title {
    font-size: 1.8rem;
  }
  
  .events-gallery-subtitle {
    font-size: 0.8rem;
  }
  
  .events-gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .events-gallery-lightbox-prev {
    left: 10px;
  }
  
  .events-gallery-lightbox-next {
    right: 10px;
  }
  
  .events-gallery-view-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}