.gallery{
    display: grid;
    grid-template-columns: 
      repeat(auto-fit, minmax(12.5rem, 1fr));
    grid-auto-rows: 12.5rem;
    gap: 0.74rem;
    grid-auto-flow: dense;
}
.gallery figure{
    overflow: hidden;
    display: grid;
    
    grid-template-columns: minmax(0 ,1fr);
    grid-template-rows: minmax(0, 1fr);
}
.gallery figure:hover img{
    scale: 1.125;
}

.gallery img{
   border-radius: 5px;
    grid-row: 1/ -1;
    grid-column: 1/ -1;
    width: 100%;
    height: auto;
object-fit: cover;
    transition: scale 0.5s ease-in-out
}
@media (width > 600px){
    .gallery figure:nth-child(1){
        grid-area: span 2/ span 2;
    }
    .gallery figure:nth-child(4n+1){
        grid-row: span 2;
    }
    .gallery figure:nth-child(4n+2){
        grid-column: span 2;
    }
}
@media screen and (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Adjust column width */
        grid-auto-rows: 200px; /* Adjust row height */
        gap: 10px; /* Reduce spacing */
    }
    

    .gallery img {
        border-radius: 5px;
        
        width: 100%; /* Ensure images fit their containers */
        height: 100%; /* Ensure images fit their containers */
        object-fit: cover; /* Maintain aspect ratio */
    }
}

 

