

/* Gallery Container */
.gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important; 
  gap: 15px !important;
  padding: 20px !important;
  background: #000 !important; 
}

/* 2. The Card Styling */
.gallery-item {
  height: 450px !important; 
  position: relative !important;
  overflow: hidden !important;
  background: #000 !important; 
  border-bottom: 8px solid #7ed321 !important; 
}

/* 3. Image Handling - FORCED TO FILL */
.gallery-item img {
  width: 100% !important;
  height: 100% !important; 
  /* 'cover' ensures no black gaps; 'top' ensures faces aren't cut off */
  object-fit: cover !important; 
  object-position: top !important; 
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* 4. The JCC Hover Effect */
.gallery-item:hover img {
  transform: scale(1.1) !important; 
  opacity: 0.8;
}

/* 5. Caption Placement */
.gallery-overlay {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  background: linear-gradient(transparent, rgba(0,0,0,0.9)) !important;
  padding: 30px 20px !important;
  opacity: 1 !important; /* Text always visible or transitions in */
  text-align: left !important;
}

.gallery-overlay p {
  color: #7ed321 !important; /* Green text */
  font-weight: bold !important;
  text-transform: uppercase !important;
  letter-spacing: 1.5px !important;
  margin: 0 !important;
  font-size: 1.2rem !important;
}

/* --- MOBILE RESPONSIVENESS --- */

/* For Tablets (Screens smaller than 1024px) */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    padding: 15px !important;
  }
  
  .gallery-item {
    height: 350px !important;
  }
}

/* For Tablets (Screens smaller than 992px) */
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 10px !important;
  }
  
  .gallery-item {
    height: 300px !important;
  }
}

/* For Mobile Tablets (Screens smaller than 768px) */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 10px !important;
  }
  
  .gallery-item {
    height: 280px !important;
  }
  
  .gallery-overlay {
    padding: 20px !important;
  }
  
  .gallery-overlay p {
    font-size: 1.05rem !important;
  }
}

/* For Mobile Phones (Screens smaller than 600px) */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 8px !important;
  }

  .gallery-item {
    height: 250px !important;
    border-bottom: 5px solid #7ed321 !important;
  }

  .gallery-overlay {
    padding: 15px !important;
  }

  .gallery-overlay p {
    font-size: 0.95rem !important;
  }
}

/* Extra Small Phones */
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 5px !important;
  }
  
  .gallery-item {
    height: 220px !important;
    border-bottom: 4px solid #7ed321 !important;
  }
  
  .gallery-overlay {
    padding: 12px !important;
  }
  
  .gallery-overlay h3 {
    font-size: 1rem !important;
  }
  
  .gallery-overlay p {
    font-size: 0.85rem !important;
  }
}


/* Style for the 'More' button to match your other links */
.dropbtn {
  display: inline-block;
  text-decoration: none;
}

/* Hide the dropdown content by default */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #ffffff; /* Change to match your theme */
  min-width: 160px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}

/* Links inside the dropdown */
.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

/* Hover effects */
.dropdown-content a:hover { background-color: #f1f1f1; }
.dropdown:hover .dropdown-content { display: block; }

/* --- GALLERY VISUAL REFINEMENT PATCH --- */

.gallery-item img {
  /* CHANGED: 'center' framing balances group photos and landscape pictures much better than 'top' */
  object-position: center !important; 
  
  /* Adds a premium hardware-accelerated rendering filter */
  filter: brightness(0.95) contrast(1.05) !important;
}

/* Enhances the hover effect to feel smooth, clean, and high-end */
.gallery-item:hover img {
  transform: scale(1.04) !important; 
  filter: brightness(1.05) contrast(1.05) !important;
  opacity: 0.9 !important;
}

/* Captions Adjustment: Make the gradient overlay smoother and easier to read */
.gallery-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%) !important;
  padding: 40px 20px 20px !important; /* Deeper bottom padding for text safety */
}

/* Style for items that don't have text descriptions yet so they don't look empty */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.05); /* Soft inner border */
  pointer-events: none;
}
