.gallery { display: flex; flex-direction: row; flex-flow: row wrap; justify-content: center; list-style-type: none; margin-top: 1rem; padding: 0px; } .gallery li { margin: 0.2rem; margin-bottom: 1rem; border: 1px solid var(--text_border); float: left; border-radius: 1rem; box-shadow: 0px 5px 5px 0px #00000040; background: var(--bg_2); height: auto; transition: 0.3s; z-index: 1; } .gallery li:hover { border: 1px solid var(--text_1); transform: scale(1.02); } #main_content_wrapper .gallery img { width: 100%; height: 15rem; margin: 0; border-radius: 1rem 1rem 0 0; object-fit: cover; } @media screen and (max-width: 48rem) { .gallery li { width: 45%; } #main_content_wrapper .gallery img { height: 100%; width: auto; } #main_content_wrapper .gallery figure { height: auto; } } .gallery figcaption { padding: 0.1rem; text-align: center; }