.gallery {
    display: -ms-flexbox; 
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    flex-direction:column;
}
.gallery_item {
    display: flex;
    flex-wrap: wrap;
    gap:5px;
}
.gallery_item > div{
    position: relative;
    /* width: 33%;
    height:300px; */
    overflow: hidden;
}
.gallery_item > div span{
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    height: 80%;
    right: 0;
    bottom: 0;
    margin: auto;
    cursor: pointer;
    transition: all 0.3s;
}
.gallery_item > div span::before{
    content:'';
    background:red;
}
.gallery_item img {
  vertical-align: middle;
  width: 100%;
  height:100%;
  cursor: pointer;
  transition: all 0.3s;
}
.gallery_item > div:hover span{
    border: 1px solid pink;
}
.gallery_item > div:hover img{
    transform: scale(1.5);
}
.modal1{
    position: fixed;
    z-index: 1000;
    width: 100%;
    height: 100%;
    top:0;
    left:0;
   display:none;
    overflow: hidden;
    background-color: rgb(0 0 0 / 75%);
    transition: all 0.4s;  
}
.modal1 #next{
    position: absolute;
    top: 50%;
    right: 0;
}
.modal1 #previous{
    position: absolute;
    top: 50%;
    left: 20px;
}
.modal1 img{
    display:block;
    width:900px;
    height: 500px;
    margin:auto;
  
   -webkit-animation-name: zoom;
  -webkit-animation-duration: 0.6s;
  animation-name: zoom;
  animation-duration: 0.6s;

}
@-webkit-keyframes zoom {
  from {-webkit-transform:scale(0)} 
  to {-webkit-transform:scale(1)}
}

@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

.modal1 span{
    font-size: 57px;
    color: white;
    cursor: pointer;
    display: block;
    text-align: end;
    margin-right: 20px;
}
@media screen and (max-width:992px){
    .gallery_item > div{
        flex:44%;
    }
    .modal1 img{
        margin-top: 42%;
    }
}
@media screen and (max-width:768px){
    .modal1 img{
        margin-top: 28%;
        width:100%;
    }
}