/* Base box-sizing for consistency */
* {
  box-sizing: border-box;
}

/* Grid layout for image boxes */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* Individual image box styling */
.image-box {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  height: 100%;
}

/* Image styling with hover effect */
.image-box img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.image-box:hover img {
  opacity: 0.3;
  transform: scale(1.05);
}

/* Overlay container always visible */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: white;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

/* Title always visible */
.overlay h2 {
  margin: 0;
  font-size: 1.5em;
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Description hidden until hover */
.overlay p {
  margin-top: 10px;
  font-size: 1em;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Reveal description on hover */
.image-box:hover .overlay p {
  opacity: 1;
}

/* Handling boxes for mobile usage */
@media (max-width: 600px) {
  .overlay h2 {
    font-size: 1.2em;
  }

  .overlay p {
    font-size: 0.9em;
  }
}