/*gallery*/
.g-slider-wrap {
    position: relative;
    padding: 0 4em;
}

.g-slider {
    max-width: 47.5rem;
    margin: 3.25rem auto 0;
    position: relative;
    overflow: hidden;
}

#g-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
    justify-content: center;
}

#g-list.is-initialized {
    overflow: visible;
    justify-content: flex-start;
}

#g-list li {
    flex: 0 0 100%;
    aspect-ratio: 833 / 556;
    background-color: #242424;
    display: flex;
    align-items: center;
    justify-content: center;
/*    margin: 0 10.53%;*/
}

#g-list li img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
/*    cursor: pointer;*/
}

@media (max-width: 767px) {
    .g-slider-wrap {
        padding: 0;
    }
    #g-list {
        width: 90%;
    }
    #g-list.is-initialized {
        margin-left: 5%;
    }
    #g-list li {
        position: relative;
    }
    #g-list li::after {
        content: "";
        width: 1.93rem;
        height: 1.93rem;
        display: block;
        position: absolute;
        right: 1.25rem;
        bottom: 1.25rem;
        background-image: url(../img/gallery/zoom.png);
        background-repeat: no-repeat;
        background-size: cover;
        pointer-events: none;
    }
}

/* galleryModal */
#g-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;    
}

.g-modal-wrap {
    position: relative;
    /* 1064 / 1400 = 76vw */
    width: 76vw; 
    max-width: 1064px;
    /* 795 / 1400 = 56.78vw */
    height: 56.78vw; 
    max-height: min(795px, 90vh);     
    display: flex;
    align-items: center;
    justify-content: center;
}

.g-modal-content {
    position: relative;
    width: 84.58%;
    max-width: 900px;
    height: 94.33%;
    max-height: 750px;
    overflow: hidden;
    z-index: 1; 
    margin-top: -4%;
}

#g-modal-list {
    display: flex;
    height: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

#g-modal-list li {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/*gallery slider nav*/
.g-prev, .g-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.8rem;
    height: 3.8rem;
    background-color: #1d302f;
    border-radius: 50%;
    z-index: 10;
}

.g-prev,
.g-modal-prev { left: 50%; cursor: pointer; transform: translateX(-500px) translateY(-50%); }
.g-next,
.g-modal-next { right: 50%; cursor: pointer; transform: translateX(500px) translateY(-50%); }

@media (max-width: 1050px) {
    .g-prev,
    .g-modal-prev { left: .8em; cursor: pointer; transform: translateX(0) translateY(-50%); }
    .g-next,
    .g-modal-next { right: .8em; cursor: pointer; transform: translateX(0) translateY(-50%); }
}
@media (max-width: 767px) {
    .g-prev, .g-next {
        display: none;
    }
}


.g-prev::before,
.g-next::before,
.g-modal-prev::before,
.g-modal-next::before {
    content: '';
    display: block;
    width: 1.3rem;
    height: 1.3rem;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    position: absolute;
    top: 50%;
}

.g-modal-prev::before,
.g-modal-next::before {
    width: 3rem;
    height: 3rem;
}

.g-prev::before,
.g-modal-prev::before {
    left: 50%;
    transform: translate(-30%, -50%) rotate(-45deg);
}

.g-next::before,
.g-modal-next::before {
    right: 50%;
    transform: translate(30%, -50%) rotate(135deg);
}

.g-pagination,
.g-modal-pagination {
    display: flex;
    justify-content: center;
    gap: 0.9375rem;
}

.g-pagination {
    margin-top: 1.25rem;
}

.g-pagination span,
.g-modal-pagination span {
    width: 0.625rem;
    height: 0.625rem;
    background: #1d302f;
    border-radius: 50%;
    cursor: pointer;
}

.g-pagination span.active,
.g-modal-pagination span.active {
    background: #acacac;
}

.g-modal-close,
.g-modal-prev,
.g-modal-next,
.g-modal-pagination {
    position: absolute;
    z-index: 10; 
}
.g-modal-close {
    width: 3.5rem;
    height: 3.5rem;
    right: 0;
    top: 0;
    cursor: pointer;
}
.g-modal-prev,
.g-modal-next {
    margin-top: -2%;
}

@media (max-height: 750px) {
    .g-modal-close {
        right: 0;
    }
}

.g-modal-close span {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

.g-modal-close span::before,
.g-modal-close span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #fff;
}

.g-modal-close span::before { transform: rotate(45deg); }
.g-modal-close span::after { transform: rotate(-45deg); }


.g-modal-pagination {
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
}

@media (hover: hover) {
    .g-prev:hover,
    .g-modal-prev:hover,
    .g-next:hover,
    .g-modal-next:hover,
    .g-modal-close:hover {
        opacity: 0.5;
    }
}
