.container {
  position: relative;
  width:200px;

    flex-basis: 
}

.image {
  display: block;
  width:200px;
  height: auto;
    margin-top: 20px;
    margin-bottom: 10px;
    
}

.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  width: 200px;;
  opacity: 0;
  transition: .5s ease;
  background-color: #333;

}

.container:hover .overlay {
  opacity: .8;


    
}

.text {
  color: white;
  font-size: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

@media all and (min-width: 600px) {
    
    .container {

        flex-basis: 25%;

}
.image {
        margin-bottom: 10px;
 
}

.overlay {
        margin-top: 20px;
    
}

}