/* ポップアップバナー */
.popup-banner {
    position: fixed;
    inset: 0; /* 画面全体を覆う */
    background-color: #3a3a3acc;
    z-index: 1000000;

    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px; /* 画面端に少し余白 */
    box-sizing: border-box;
    overflow: hidden; /* 万一はみ出してもスクロールバー出さない */

    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-banner.show {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 中身の箱はサイズを持たせない（画像に合わせる） */
.popup-banner-content {
    position: relative;
}

/* 画像を「画面いっぱいまで縮小」して表示 */
.popup-banner-content img {
    display: block;
    width: auto;
    height: auto;

    max-width: 90vw; /* 横は画面の90%まで */
    max-height: 90vh; /* 縦は画面の90%まで → 下が欠けない */
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* クリック範囲は画像いっぱい */
.popup-banner-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* 閉じるボタン */
.popup-banner-close {
    position: absolute;
    top: -33px;
    right: 0px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-banner-close::before,
.popup-banner-close::after {
    content: "";
    position: absolute;
    width: 1px;
    height: 30px;
    background-color: #fff;
    top: 50%;
    left: 50%;
}

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

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

/* レスポンシブ対応（スマホは少しだけマージン広めでもOK） */
@media (max-width: 768px) {
    .popup-banner-content img {
        max-width: 95vw;
        max-height: 95vh;
    }
}
