/*======================================
Gallery
======================================*/

.gallery {
    padding: 0 5%;
    position: relative;
    background: var(--bg_color);
}

.gallery_inner {
    max-width: 1700px;
    margin: auto;

    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 80px 0;
    align-items: center;
}

.gallery_inner_item {
    width: calc(100% / 4 - 40px);
    position: relative;
}

.gallery_inner_item figure {
    margin: 0;
    overflow: hidden;
}

.gallery_inner_item img {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: .5s;
}

.gallery_inner_item figure.square img {
    aspect-ratio: 3/4;
}

.gallery_inner_item figure.wide img {
    aspect-ratio: 4/3;
}

/*====================*/

.gallery_item p {
    margin-top: 20px;
    font-size: 1.8rem;
    line-height: 1.8;
}

/*====================*/

.gallery_side {
    font-family: "Bebas Neue";
    font-size: 2rem;
    letter-spacing: .1em;
}

.gallery_side::before {
    content: "|";
    margin-bottom: 10px;
}



.gallery_title {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    display: table;
    vertical-align: middle;
    pointer-events: none;
}

.gallery_title::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: 0.2s ease-in-out;
    z-index: 1;
}
.gallery_title h4 {
    display: table-cell;
    vertical-align: middle;
    padding: 10px;
    line-height: 1.5;
    opacity: 0;
    transition: 0.2s ease-in-out;
    color: var(--bg_color);
    text-align: center;
    font-weight: 400;
    position: relative;
    z-index: 3;
}


.gallery_inner_item:hover .gallery_title h4,
.gallery_inner_item:hover .gallery_title::before {
    opacity: 1;
}

.gallery_inner_item:hover figure img {
    transform: scale(1.1, 1.1);
    opacity: 0.8;
}

figure img {
    transition: 0.2s ease-in-out;
    max-width: none;
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: 50% 50%;
    backface-visibility: visible;
    transition: 1s ease-out !important;
    transition-property: transform opacity !important;
    transform: scale(1.001, 1.001);
}

@media screen and (min-width: 701px) {
    .gallery_side {
        position: absolute;
        right: 3%;
        top: 80px;
        writing-mode: vertical-rl;
    }
}

@media screen and (max-width: 900px) {
    .gallery_inner {
        gap: 20px 0;
    }
    .gallery_inner_item {
        width: calc(100% / 2 - 10px);
    }
    .gallery_side {
        letter-spacing: 0;
    }
}
