#gallery_section {
    padding: 85px 5%;
}

@media (max-width: 480px) {
    #gallery_section {
        padding-inline: 20px;
    }
}

.gallery-wrapper {
    max-width: 1450px;
    width: 100%;
    margin-inline: auto;
}
.gallery-noscript {
    font-size: 1.05rem;
    text-align: center;
}
.gallery-loader {
    display: block;
    margin: 50px auto -50px;
    border-radius: 50%;
    transition: opacity .4s;
    animation: spin 1s linear infinite;
    width: 20px;
    height: 20px;
    box-shadow: 20px 0 0 #e2e4e8, -20px 0 0 #e2e4e8, 0 20px 0 #e2e4e8, 0 -20px 0 var(--accent-color-red);
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 2%;
    margin: 20px auto;
    padding: 0;
    transform: translateY(50px);
    opacity: 0;
    min-height: 500px;
    transition: transform .4s, opacity .4s;
}
.gallery-fade-in {
    transform: translateY(0);
    opacity: 1;
}
.gallery-fade-out {
    opacity: 0;
}
.gallery-item {
    position: relative;
    width: calc(25% - (6% / 4));
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-block: 12px;
}
.gallery-item img {
    width: auto;
    height: 115%;
    transition: opacity .4s, transform .4s;
}
.gallery-item img.vertical-img {
    width: 115%;
    height: auto;
}
.gallery-item img.small-img {
    width: auto;
    height: 140%;
}
.gallery-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    fill: #111;
    opacity: 0;
    transition: opacity .4s;
}
.gallery-item:hover .gallery-icon {
    opacity: 1;
}
.gallery-item:hover img {
    opacity: .6;
    transform: scale(1.05);
}

@media screen and (max-width: 1200px) {
    .gallery-item {
        width: calc(33.3333333333% - (4% / 3));
    }
}

@media screen and (max-width: 900px) {
    .gallery-item {
        width: calc(50% - (2% / 2));
    }
}

@media screen and (max-width: 600px) {
    .gallery-item,
    .gallery-item img {
        width: 100%;
        height: auto;
    }
}