body{
  margin: 100px;
  padding: 0;
  height: 100vh;
  width: 100%;
  font-family: cursive;
  display: flex;
  justify-content: center;
  margin-top: 3%;
}

.contain {
  position: relative;
  display: inline-block;
  width: 35%;
  margin: 10px;
}

.img {
  width: 100%;
  height: 200px; /* set a fixed height for the images */
  object-fit: cover; /* make the images cover the entire container */
  border-radius: 10px; /* add a border radius for a nicer look */
}

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
h1{
  transition: 0.7s;
  position: absolute;
  top: 50%;
  left: 24px;
  opacity: 0.7;
  color: rgb(255, 255, 255);
  font-size: 25px;
}
p{
  transition: 0.5s;
  position: absolute;
  top: 50%;
  left: 24px;
  margin-bottom: -100%;
  opacity: 0;
  font-size: 14px;
}
strong{
  letter-spacing: 2px;
  font-size: 14px;
}
.overlay {
  border-radius: 10px;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgb(91, 128, 145);
  height: 99%; /* change from 50% to 100% */
  width: 100%;
  opacity: 0;
  transition: 1.5s;
}
.contain:hover .overlay{
  opacity: 0.4;
  transition: 0.5s;
}
.contain:hover h1{
  transition: 0.5s;
  color: white;
  opacity: 1;
  margin-top:-15px ;
}
.contain:hover p{
  top: 60%;
  opacity: 1;
  color: white;
}
.container2{
  justify-content: center;
  padding-top: 60px;
  padding-left: 150px;
}

.container1 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease-in-out;
  }
  
  .btn {
    background-color: #fff;
    color: #000;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
  }
  
  .btn:hover {
    background-color: #000;
    color: #fff;
  }
  
  .btn.selected {
    background-color: #000;
    color: #fff;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    text-align: center;
  }
  
  /* Add animation effect when navigating to another page */
  .container1 {
    animation: fade-in 0.5s ease-in-out;
  }
  
  @keyframes fade-in {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
  /* Media queries for responsive design */
@media (max-width: 768px) {
  .container1 {
      padding: 0.5em;
      flex-direction: row;
  }
  .btn {
      padding: 0.5em 1em;
      width: 100%;
  }
  .container2 {
      flex-direction: column;
  }
  .contain {
      width: 100%;
      margin: 1em 0;
      top: 10%;
      right: 50%;
  }
  .img {
      height: 100px;
  }
  h1 {
      font-size: 1.2em;
      top: 25%;
      transform: translateY(10px);
  }
  p {
      font-size: 0.8em;
      margin-bottom:50%;
      transform: translateY(-18px);
  }
  .overlay{
    width: 100%;
    height: 96%;
  }
}

@media (max-width: 480px) {
  .container1 {
      padding: 0.2em;
  }
  .btn {
      padding: 0.2em 0.5em;
  }
  .img {
      height: 80px;
  }
  h1 {
      font-size: 1em;
  }
  p {
      font-size: 0.6em;
      transform: translateY(-18px);
    }

}