/* math_intro レイアウト - 左メニュー */

/* 全体コンテナ */
.container-with-sidebar {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

/* 左サイドバーメニュー */
.sidebar-menu {
    width: 260px;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background-color: #fdfcf9;
    border-right: 1px solid #d4c5a9;
    z-index: 1000;
}

/* サイドバー内スクロールラッパー */
.sidebar-nav-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

/* サイドバータイトル */
.sidebar-title {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: #1a365d;
    text-decoration: none;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #1a365d;
}

.sidebar-title:hover {
    text-decoration: underline;
}

/* ナビゲーションリスト */
.sidebar-nav-unified {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* トップページリンク */
.sidebar-nav-unified .nav-top {
    margin-bottom: 0.75rem;
}

.sidebar-nav-unified .nav-top a {
    display: block;
    padding: 0.4rem 0.5rem;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
    border-left: 3px solid transparent;
}

.sidebar-nav-unified .nav-top a:hover {
    text-decoration: underline;
}

.sidebar-nav-unified .nav-top.current-page a {
    border-left-color: #1a365d;
    background-color: #f0ebe0;
}

/* 章レベル */
.sidebar-nav-unified .nav-chapter {
    margin-bottom: 0.5rem;
}

/* 章タイトル */
.sidebar-nav-unified .chapter-title-text {
    display: block;
    padding: 0.3rem 0.5rem;
    font-weight: bold;
    font-size: 0.75rem;
    color: #1a365d;
    background-color: #f0ebe0;
    border-left: 3px solid #999;
}

.sidebar-nav-unified .nav-chapter.current-chapter .chapter-title-text {
    border-left-color: #1a365d;
    background-color: #e5ddd0;
}

/* 章内のページリスト */
.sidebar-nav-unified .chapter-pages {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 3px solid #ddd;
    margin-left: 0;
}

.sidebar-nav-unified .chapter-pages li {
    margin: 0;
}

.sidebar-nav-unified .chapter-pages a {
    display: block;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    color: #555;
    text-decoration: none;
    font-size: 0.7rem;
    line-height: 1.4;
    transition: background-color 0.15s ease;
}

.sidebar-nav-unified .chapter-pages a:hover {
    background-color: #f5f2eb;
    text-decoration: underline;
}

.sidebar-nav-unified .chapter-pages .current-page a {
    background-color: #e8f0f8;
    color: #000;
    font-weight: bold;
    border-left: 2px solid #1a365d;
    margin-left: -2px;
}

/* 外部リンク */
.sidebar-nav-unified .nav-external {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #d4c5a9;
}

.sidebar-nav-unified .nav-external a {
    display: block;
    padding: 0.4rem 0.5rem;
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
}

.sidebar-nav-unified .nav-external a:hover {
    text-decoration: underline;
    color: #333;
}

/* メインコンテンツエリア */
.main-content {
    margin-left: 280px;
    padding: 20px 30px;
    flex: 1;
    min-width: 0;
    max-width: 900px;
}

/* ヘッダー調整 */
.main-content .site-header {
    max-width: none;
    margin: 0 0 1rem 0;
    padding: 1.5rem;
    border-bottom: none;
    background: none;
}

/* パンくず非表示 */
.main-content .breadcrumb {
    display: none;
}

/* ハンバーガーメニュー */
.menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    background: #fdfcf9;
    border: 1px solid #d4c5a9;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #1a365d;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* レスポンシブ */
@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-menu.active {
        transform: translateX(0);
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 60px 15px 30px;
    }
}
