* {
    box-sizing: border-box;
}
body {
    padding: 50px;
    font-family: sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 5px 0;
}

p{
    margin: 0 0 20px 0;
}

.close {
    
    background: rgb(43, 57, 145);
    color: white;
    border: 0;
    position: absolute;
    right: 0;
    
}

.gallery {
    display: grid;
    /* grid-template-columns: repeat(auto-fill, 100px); /* a repenser*/
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-gap: 20px;
    grid-auto-rows: 100px; 

}

.item{
    /* grid-column: span 2;/* a repenser*/
    /* grid-row: span 2;/* a repenser*/
    overflow: hidden; 
    display: grid;
    grid-template-columns: 1;
    grid-template-rows: 1;
}

.item img{
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    
    
}

.item__overlay{
    background:rgba(43, 57, 145, 0.452);
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    position: relative;
    display: grid;
    justify-items: center;
    align-items: center;
    transition: 0.5s;
    transform: translatey(100%);
   
}



.item:hover .item__overlay{
    transform: translateY(0);
}
.gallery img{
   border: 1px solid #ccc;
   box-shadow: 2px 2px 6px 0px rgba(0,0,0,0.3);
   max-width: 100%;
   border-radius: 10px;
}
.overlay{
    position:fixed;
    background: rgba(0, 0, 0, 0.7);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    z-index: 2;
}

.overlay.open{
    display: grid;

}

.overlay.open img{
    
    padding-top: 15px;
    width: 75%;
    height: 75%;
    object-fit: contain;
   
    
}

.overlay figure {
    background: white;
    width: 700px;
    padding: 20px;

}

.overlay img {

    width: 100%;

    

}

.centreimg{
    margin: 10px auto 20px;
    display: block;
}
