/* メニューラッパー */
.menu-wrapper {
    position: relative;
    top: 20px;
    right: 20px;
}

/* MENUボタンのスタイル */
.menu-button {
    position: fixed;
    top: 0;
    right: 0;
    width: 15px;
    height: 100%;
    background-color: #6c757d;
    color: white;
    font-size: 18px;
    writing-mode: vertical-rl;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: right 0.3s ease, background-color 0.3s ease;
    opacity: 0.3;
    z-index: 9999;
}

/* ホバー時のボタン */
.menu-button:hover {
    background-color: #5a6268;
}

/* サイドメニューのスタイル */
.menu-content {
    position: fixed;
    top: 0;
    right: -290px; /* 初期位置で画面外に隠す */
    width: 250px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2); /* 左側に影を表示 */
    transition: right 0.3s ease; /* メニューがスライドして出てくる */
    z-index: 9998;
    padding: 20px;
    overflow-y: auto; /* サイドメニュー内のスクロールを許可 */
    -webkit-overflow-scrolling: touch; /* モバイルでのスムーズスクロール */
}

/* メニューが開いているとき */
.menu-open .menu-content {
    right: 0;
}

/* メニューが開いているときのボタンの位置 */
.menu-open .menu-button {
    right: 280px; /* ボタンをメニューの左側にスライド */
}

/* メニューが開いているときに、メインコンテンツを少し縮小 */
.menu-open .main-content {
    margin-right: 250px; /* サイドメニューの幅だけ右にマージンを追加 */
}

/* メニューが開いているときのオーバーレイ */
.menu-open .overlay {
    display: block;
    pointer-events: auto; /* クリック可能にする */
}

/* メニューが閉じているときのオーバーレイ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    pointer-events: none;
}

.menu-header {
    display: flex;
    justify-content: flex-end;
    padding-right: 10px;
}

.menu-icon-close {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.menu-open body {
    overflow: hidden;
}
