/**
 * ハンバーガーメニューナビゲーション スタイル
 */

/* ==========================================
   1. ハンバーガーボタン（左上固定）
   ========================================== */

.hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(39, 40, 51, 0.9);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    transition: background 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hamburger-btn:hover {
    background: rgba(39, 40, 51, 1);
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

/* ハンバーガーボタンがアクティブな時（×マークに変形） */
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==========================================
   2. 背景オーバーレイ
   ========================================== */

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.menu-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   3. ナビゲーションパネル（左側からスライドイン）
   ========================================== */

.nav-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    max-width: 85vw;
    height: 100%;
    background: #272833;
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.nav-panel.open {
    transform: translateX(0);
}

/* ==========================================
   4. パネルヘッダー
   ========================================== */

.nav-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.nav-panel-header h2 {
    color: #fff;
    font-size: 1.5em;
    margin: 0;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   5. 目次リスト
   ========================================== */

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-list li:last-child {
    border-bottom: none;
}

.nav-list a {
    display: block;
    padding: 15px 25px;
    color: #ccc;
    text-decoration: none;
    font-size: 1em;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s, padding-left 0.3s;
}

.nav-list a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding-left: 30px;
}

/* ==========================================
   6. レスポンシブ対応
   ========================================== */

/* タブレット */
@media screen and (max-width: 980px) {
    .nav-panel {
        width: 350px;
    }
}

/* スマートフォン */
@media screen and (max-width: 736px) {
    .hamburger-btn {
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
    }
    
    .nav-panel {
        width: 85vw;
        max-width: 320px;
    }
    
    .nav-panel-header {
        padding: 15px 20px;
    }
    
    .nav-panel-header h2 {
        font-size: 1.3em;
    }
    
    .nav-list a {
        padding: 12px 20px;
        font-size: 0.95em;
    }
    
    .nav-list a:hover {
        padding-left: 25px;
    }
}

/* 非常に小さい画面 */
@media screen and (max-width: 480px) {
    .hamburger-btn {
        width: 40px;
        height: 40px;
    }
    
    .hamburger-btn span {
        width: 22px;
    }
}

/* ==========================================
   7. メニューオープン時のbodyスクロール制御
   ========================================== */

body.menu-open {
    overflow: hidden;
}
