.academic-widget-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 55px;
}
@media (max-width: 768px) {
  .academic-widget-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
.academic-widget-item {
  position: relative;
  overflow: hidden;
  height: 250px; /* Set a fixed height for consistency */
  text-decoration: none; /* Remove underline from links */
  color: inherit; /* Ensure the link inherits color (white for text) */
  display: block; /* Make the entire box clickable */
}
.academic-widget-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the image fills the box without distortion */
  display: block;
  filter: grayscale(100%); /* Apply grayscale filter */
  transition: filter 0.3s ease; /* Smooth transition for grayscale effect */
}
.academic-widget-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 54, 166, 0.7); /* Slightly more opaque blue */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  pointer-events: none; /* Prevent cursor from changing to hover over text */
  transition: opacity 0.3s ease;
}
.academic-widget-item:hover .academic-widget-overlay {
  opacity: 0; /* Completely hide overlay on hover */
}
.academic-widget-item:hover img {
  filter: grayscale(0%); /* Remove grayscale on hover */
}
.academic-widget-overlay h3 {
  color: white;
  text-align: center;
  margin: 0;
  padding: 0;
  font-size: 18px;
}
.academic-widget-item:hover h3 {
  pointer-events: none; /* Ensure text doesn't interfere with hover state */
}
