/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Wrapper */
#wrapper {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Container */
.container {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.container h1 {
  margin: 20px 100px;
  text-align: center;
  margin-bottom: 20px;
  font-size: 3rem;
}

/* Gallery */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Card */
.card {
  width: 32%;
  position: relative;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.5s;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0%);
  box-shadow: 0 0 20px #333;
  transition: filter 0.5s, transform 0.5s;
}

.card:hover {
  transform: scale(1.03);
}

.card:hover img {
  filter: grayscale(0%);
}

/* Gradient Overlay */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::after {
  opacity: 1;
}

/* Figcaption */
.card figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 25px;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  z-index: 1; /* Make sure the text is above the gradient */
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}

.card:hover figcaption {
  opacity: 1;
  transform: scale(1.03);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  /* Adjust container padding for smaller screens */
  .container {
    padding: 10px;
  }
  
  .container h1 {
    font-size: 2.5rem;
    margin: 10px 50px;
  }

  /* Make the cards stack vertically on medium screens */
  .card {
    width: 48%;
  }

  /* Adjust figcaption for readability on smaller screens */
  .card figcaption {
    font-size: 12px;
    padding: 15px;
  }
}

@media (max-width: 768px) {
  /* Make the cards take up full width on small screens */
  .card {
    width: 100%;
  }

  .container h1 {
    font-size: 2rem;
    margin: 10px 20px;
  }

  /* Adjust figcaption font size for small screens */
  .card figcaption {
    font-size: 11px;
    padding: 10px;
  }
}
