body {
    align-content: center;
    align-items: center;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    /* max-width: 600px; */
    padding: 2em;
    align-content: center;
}

.imgcontainer {
    opacity: 1;
    height: auto;
    transition: .5s ease;
    backface-visibility: hidden;
    padding: 10px;
    max-width: 200px;
}

.caption {
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: eddcd2;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.5s;
    border-radius: 10px;
}

.imgcontainer:hover .caption {
opacity: 1;
}

.imgcontainer:hover img {
opacity: 0.3;
}

img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    margin: 10px;
}

h3 {
    text-align: center;
}