/* =========================
   ライトボックス
   ========================= */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    box-sizing: border-box;
}

.lightbox.is-open {
    display: flex;
}


/* 背景 */

.lightbox-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}


/* コンテンツ */

.lightbox-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    margin: 0;
}

.lightbox-image {
    display: block;
    max-width: 90vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
}


/* キャプション */

.lightbox-caption {
    margin-top: 12px;
    background:var(--accent);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    padding:8px;
    font-weight:600;
    border-radius:4px;
}


/* =========================
   閉じるボタン
   ========================= */

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;

    z-index: 3;

    width: 45px;
    height: 45px;

    padding: 0;

    border: none;
    background: transparent;

    color: #fff;

    font-size: 40px;
    font-weight: 300;
    line-height: 45px;

    cursor: pointer;
}


/* =========================
   前後ボタン
   ========================= */

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;

    z-index: 3;

    width: 60px;
    height: 80px;

    padding: 0;

    transform: translateY(-50%);

    border: none;
    background: transparent;

    color: #fff;

    font-size: 70px;
    font-weight: 200;
    line-height: 80px;

    cursor: pointer;

    transition: opacity 0.2s;
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
    opacity: 0.7;
}


/* 先頭・末尾では矢印を消す */

.lightbox-prev.is-hidden,
.lightbox-next.is-hidden {
    display: none;
}


/* =========================
   本体スクロール停止
   ========================= */

body.lightbox-open {
    overflow: hidden;
}


/* =========================
   スマートフォン
   ========================= */

@media screen and (max-width: 767px) {

    .lightbox {
        padding: 50px 40px;
    }

    .lightbox-content {
        max-width: 100%;
        max-height: 90vh;
    }

    .lightbox-image {
        max-width: 90vw;
        max-height: 80vh;
    }

    .lightbox-caption {
        font-size: 13px;
    }

    .lightbox-close {
        top: 8px;
        right: 10px;

        width: 40px;
        height: 40px;

        font-size: 35px;
        line-height: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 35px;
        height: 60px;

        font-size: 50px;
        line-height: 60px;
    }

    .lightbox-prev {
        left: 2px;
    }

    .lightbox-next {
        right: 2px;
    }
}