.modal {
    padding: 80px 0;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

/* モーダルを開くボタン */
.modal__images {
    display: flex;
    flex-wrap: wrap;
}

.modal__images .modal__image {
    position: relative;
    width: calc((100% - (32px * 2)) / 3);
    transition: opacity .6s;
}

.modal__images .modal__image:hover {
    opacity: .6;
}

.modal__images .modal__trigger {
    cursor: pointer;
}

.modal__images .modal__image:nth-child(3n - 1),
.modal__images .modal__image:nth-child(3n) {
    margin-left: 32px;
}

.modal__images .modal__image:nth-child(n + 4) {
    margin-top: 32px;
}

.modal__images .modal__image:before {
    display: block;
    padding-top: calc((2 / 3) * 100%);
    padding-top: 100%;
    content: '';
}

.modal__images .modal__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* モーダル本体 */
.modal__wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    z-index: 20;
    width: 100%;
    height: 100%;
}

.modal__layer {
    height: 100%;
    background: rgba(50, 50, 50, .85);
    cursor: pointer;
}

.modal__container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow-y: scroll;
    width: min(calc(100% - 40px), 1000px);
    max-height: calc(100% - 40px);
}

/* モーダルを閉じるボタン */
.modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(50, 50, 50, 1);
    cursor: pointer;
    transition: opacity .6s;
}

.modal__close:hover {
    opacity: .6;
}

.modal__close:before,
.modal__close:after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 1px;
    background: #fff;
    content: '';
}

.modal__close:before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal__close:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.modal__content .modal__image img {
    width: 100%;
}

/**********************************************************************************************************************/
/**************************************** Extra small devices: Phones (<768px) ****************************************/
/**********************************************************************************************************************/
@media screen and (max-width:767px) {
    .modal {
        width: 90%;
    }

}