/* Gallery Categories Container */
.gallery-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
  gap: 2rem;
  width: 100%;
  max-width: 1600px;
  padding: 2rem 1rem;
  justify-content: center;
}

/* Category Card */
.category-card {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 350px;
}

/* Category Image Wrapper */
.category-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
  background-color: #102864;
}

/* Category Image */
.category-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

/* Category Overlay (Title) */
.category-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(16, 40, 100, 0.95) 0%, rgba(16, 40, 100, 0.7) 70%, transparent 100%);
  padding: 2rem 1.5rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  z-index: 2;
}

/* Category Title */
.category-title {
  color: #EFF1F2;
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hover Effects */
.category-card:hover {
  transform: scale(1.08) translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.category-card:hover .category-image {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.category-card:hover .category-overlay {
  transform: translateY(0);
}

/* Active/Click State */
.category-card:active {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-categories {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 1rem;
  }
  
  .category-card {
    max-width: 500px;
    margin: 0 auto;
  }
  
  .category-title {
    font-size: 1.1rem;
  }
  
  /* Show title by default on mobile */
  .category-overlay {
    transform: translateY(0);
    background: linear-gradient(to top, rgba(16, 40, 100, 0.9) 0%, rgba(16, 40, 100, 0.6) 80%, transparent 100%);
  }
  
  .category-card:hover {
    transform: scale(1.02);
  }
}

@media (max-width: 480px) {
  .category-image-wrapper {
    padding-bottom: 85%; /* Slightly taller on very small screens */
  }
  
  .category-title {
    font-size: 1rem;
  }
}