/* 新しいハンバーガーメニュー用CSS */

/* ハンバーガーボタン */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: white;
    font-size: 1.5rem;
    display: none; /* デフォルトは非表示、スマホで表示 */
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s ease;
    position: fixed;
    top: 20px;
    right: -330px;
    z-index: 1002;
}

.hamburger-line {
    width: 25px;
    height: 4px;
    background-color: #3D525C;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background-color: #ffffff;
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background-color: #ffffff;
}

/* メニューオーバーレイ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
    transition: left 0.3s ease;
}

.menu-overlay.active {
    left: 0;
}

/* メニューコンテナ */
.menu-container {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background-color: #34495e;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1001;
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', sans-serif;
}

.menu-container.active {
    left: 0;
}

/* メニューヘッダー */
.menu-header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    border-bottom: 1px solid #3d566e;
    height: 65px;
    display: flex;
    align-items: center;
}

.menu-title {
    font-size: 14px;
    font-weight: bold;
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}

/* メニューリスト */
.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    border-bottom: 1px solid #3d566e;
}

.menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

.menu-link:hover {
    background-color: #3d566e;
    color: #ecf0f1;
}

.menu-text {
    flex: 1;
    font-size: 14px;
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}

/* 展開ボタン */
.expand-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 2.5rem;
    padding: 0.2rem;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    color: #ecf0f1;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.expand-btn.active {
    transform: rotate(45deg);
    color: #e74c3c;
}

/* サブメニュー */
.submenu {
    max-height: 0;
    overflow: hidden;
    background-color: #2c3e50;
    transition: max-height 0.3s ease;
    margin: 0;
    padding: 0;
    list-style: none;
}

.submenu.active {
    max-height: 800px; /* 十分な高さを確保 */
}

.submenu-item {
    border-bottom: 1px solid #34495e;
}

.submenu-link {
    display: block;
    padding: 0.8rem 2rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    line-height: 1.3;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.submenu-link:before {
    content: '・';
    margin-right: 0.5rem;
}

.submenu-link:hover {
    background-color: #34495e;
    color: #ecf0f1;
    padding-left: 2.5rem;
}

/* ソーシャルアイコン */
.social {
    padding: 1rem;
    border-top: 1px solid #3d566e;
    margin-top: auto; /* メニューの最下部に配置 */
    position: sticky;
    bottom: 0;
    background-color: #34495e;
}

.social a {
    margin-right: 1rem;
}

.social img {
    width: 30px;
    height: 30px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* スマホでハンバーガーボタンを表示 */
    .hamburger-btn {
        display: flex;
    }
    
    /* 既存のSP用ハンバーガーメニューを非表示 */
    .openbtn1 {
        display: none !important;
    }
    
    #g-nav {
        display: none !important;
    }
    
    /* メニューコンテナをフル幅に */
    .menu-container {
        width: 100%;
        left: -100%;
    }
    
    .menu-container.active {
        left: 0;
    }
}

@media (min-width: 769px) {
    /* PC表示時は新しいメニューを非表示 */
    .hamburger-btn,
    .menu-overlay,
    .menu-container {
        display: none !important;
    }
}

/* アニメーション効果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-container.active .menu-item {
    animation: fadeIn 0.3s ease forwards;
}

.menu-container.active .menu-item:nth-child(1) { animation-delay: 0.1s; }
.menu-container.active .menu-item:nth-child(2) { animation-delay: 0.15s; }
.menu-container.active .menu-item:nth-child(3) { animation-delay: 0.2s; }
.menu-container.active .menu-item:nth-child(4) { animation-delay: 0.25s; }
.menu-container.active .menu-item:nth-child(5) { animation-delay: 0.3s; }
.menu-container.active .menu-item:nth-child(6) { animation-delay: 0.35s; }
.menu-container.active .menu-item:nth-child(7) { animation-delay: 0.4s; }
.menu-container.active .menu-item:nth-child(8) { animation-delay: 0.45s; }
.menu-container.active .menu-item:nth-child(9) { animation-delay: 0.5s; }
.menu-container.active .menu-item:nth-child(10) { animation-delay: 0.55s; }
.menu-container.active .menu-item:nth-child(11) { animation-delay: 0.6s; }
.menu-container.active .menu-item:nth-child(12) { animation-delay: 0.65s; }
.menu-container.active .menu-item:nth-child(13) { animation-delay: 0.7s; }

/* スクロールバーのスタイリング（Webkit系ブラウザ） */
.menu-container::-webkit-scrollbar {
    width: 6px;
}

.menu-container::-webkit-scrollbar-track {
    background: #2c3e50;
}

.menu-container::-webkit-scrollbar-thumb {
    background: #3d566e;
    border-radius: 3px;
}

.menu-container::-webkit-scrollbar-thumb:hover {
    background: #4a6078;
}