@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap");

.card-grid-container {
  display: grid;
  grid-template-columns: repeat(
    5,
    1fr
  ); /* Set up five equal columns for a total of 10 cards in 2 rows */
  gap: 20px;
  padding: 0;
  align-items: start; /* Align items at the start if they differ in height */
}
/* Tablet responsiveness */
@media (max-width: 1024px) {
  .card-grid-container {
    grid-template-columns: repeat(2, 1fr); /* Three columns for tablets */
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .card-grid-container {
    grid-template-columns: repeat(1, 1fr); /* Two columns for mobiles */
  }
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 300px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden; /* Ensures content does not overflow */
  position: relative; /* Necessary for absolute positioning of children */
  width: 100%; /* Ensure card takes up proper width */
}

.card-background {
  background-image: linear-gradient(
    to top,
    rgba(14, 4, 23, 1) 3%,
    rgba(14, 4, 23, 0.7) 15%,
    rgba(14, 4, 23, 0.5) 30%,
    rgba(14, 4, 23, 0) 100%
  );
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none; /* Allows clicking through the gradient */
}

.card-image {
  width: 100%; /* Ensures the image covers the full width of the card */
  height: auto;
  transition: transform 0.3s ease; /* Smooth transform effect for hover */
  z-index: 0; /* Keep below the title */
}

.card-title {
  margin: 0;
  position: absolute; /* Keep title on top of the image */
  bottom: 0; /* Align to the bottom of the card */
  left: 0; /* Align to the left of the card */
  width: 100%; /* Prevent overflowing the card's width */
  padding: 1.5rem; /* Padding inside the title area */
  box-sizing: border-box; /* Include padding in width calculations */
  color: #fcfcfc; /* High contrast for readability */
  font-size: 1.125rem;
  font-weight: 500;
  z-index: 2; /* Ensure it's above the background */
}

.card:hover .card-image {
  transform: scale(1.1); /* Scale up the image on hover */
}
