/**
 * My Popup Plugin - CSS
 */

/* ━━━ オーバーレイ（背景の半透明マスク） ━━━ */
.my-popup-overlay {
    /* 初期状態は非表示 */
    display: none;
    /* 画面全体を覆う固定配置 */
    position: fixed;
    inset: 0; /* top/right/bottom/left: 0 の一括指定 */
    /* 半透明の黒背景 */
    background-color: rgba(0, 0, 0, 0.6);
    /* コンテンツより手前に表示 */
    z-index: 99999;
    /* ポップアップを中央に配置 */
    display: flex;
    align-items: center;
    justify-content: center;
    /* フェードインのためのトランジション */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* JS で .is-visible が付与されたら表示 */
.my-popup-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ━━━ ポップアップ本体 ━━━ */
.my-popup-box {
    position: relative;
    /* レスポンシブ：最大幅600px、横幅はビューポートの90% */
    width: 90%;
    max-width: 600px;
    /* スケールアニメーション */
    transform: scale(0.9);
    transition: transform 0.3s ease;
    /* 角を丸める */
    border-radius: 6px;
    overflow: hidden;
    /* 背景白（画像の余白部分対策） */
    background-color: #fff;
    /* 影を付けてポップアップらしく */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 表示時はスケールを元に戻す */
.my-popup-overlay.is-visible .my-popup-box {
    transform: scale(1);
}

/* ━━━ バナー画像 ━━━ */
.my-popup-box img {
    display: block;
    width: 100%;
    height: auto;
    /* カーソルをポインターにしてクリック可能と示す */
    cursor: pointer;
}

/* ━━━ 閉じる（×）ボタン ━━━ */
.my-popup-close {
    /* ポップアップ本体の右上に絶対配置 */
    position: absolute;
    top: 8px;
    right: 10px;
    /* ボタンスタイルのリセット */
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    /* サイズと中央揃え */
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* テキストスタイル */
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    /* 重ね順：バナー画像の上に表示 */
    z-index: 1;
    transition: background 0.2s ease;
}

.my-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}
