* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

}

body {
    height: 100%;
    width: 100%;
}

.gallery {
    position: relative;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 3rem 1.5rem;
}

.gallery h1 {
    position: relative;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 5px;
    line-height: 2rem;
}

/* Creating border element below title */
.gallery h1::before{
    content:"";
    position: absolute;
    width:30%;
    height:2rem;
    margin: auto auto;
    top:0;
    left:50%;
    transform: translateX(-50%);
    border-bottom: 3px solid blue;

    animation: borderAnim 5s infinite ease-in-out
}

/* Animation for border element  */

@keyframes borderAnim{
   0%{
    width:30%;
   } 
   50%{
    width:60%;
   }
   100%{
    width:30%;
   }
}

.gallery p{
    position: relative;
    font-size: 0.8rem;
    line-height: 1.4rem;
    width:80%;
    text-align: center;
    color:gray;
}

/* container style from here */

.container{
    position: relative;
    margin: 2rem 0.5rem;
    display:flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: row;
}

.image{
    position: relative;
    height:350px;
    width:350px;
    margin: 0.7rem;
    object-fit: cover;
    cursor:pointer;
}

/* few pseudo classes on image class */

.image::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: radial-gradient(circle, rgba(0,0,0,.3) 0%, rgba(0,0,0,.5) 100%);
    opacity: 1;
    transition: all 0.25s ease-in-out;
    border-radius: 5px;
}

.image:hover::before{
   opacity:0;
}

.image::after{
    content:"Click to enlarge";
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    color:lightgray;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.25s ease-in-out;
    border-radius: 5px;
}
.image:hover::after{
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.image img{
    width:100%;
    height:100%;
    border-radius: 5px;
}

/* Style for full image */

.zoom-image{
    position: fixed;
    width:100vw;
    height: 100vh;
    top:0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
    transform: scale(0) perspective(500px) rotateX(-50deg);
}

.zoom-image .close-btn{
    position: absolute;
    top:1.5rem;
    right:2.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    transition: color 0.4s ease-in-out;
    visibility: hidden;
}

.zoom-image .close-btn:hover{
    color:gray;
}

.zoom-image img{
    position: relative;
    width:80%;
    max-width: 800px;
}

.show{
    visibility: visible !important;
    transform: scale(1) perspective(500px) rotateX(0deg);
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
  }

  img {
    width: 100%;
    height: auto;
  }
