/* DevTools入門 - レイアウト */

.container-with-sidebar { display: flex; }

.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.9rem; 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: #f8f6f1; }

.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.9rem; color: #1a365d; background-color: #f0ede6; border-left: 3px solid #999; }
.sidebar-nav-unified .nav-chapter.current-chapter .chapter-title-text { border-left-color: #1a365d; background-color: #e8e4da; }

.sidebar-nav-unified .chapter-pages { list-style: none; padding: 0; margin: 0; border-left: 3px solid #ddd; }
.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.85rem; line-height: 1.4; transition: background-color 0.15s ease; }
.sidebar-nav-unified .chapter-pages a:hover { background-color: #f5f5f5; text-decoration: underline; }
.sidebar-nav-unified .chapter-pages .current-page a { background-color: #e8f0f7; color: #000; font-weight: bold; border-left: 2px solid #1a365d; margin-left: -2px; }

.sidebar-nav-unified .nav-utility { margin-top: 0.5rem; }
.sidebar-nav-unified .nav-utility:first-of-type { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid #d4c5a9; }
.sidebar-nav-unified .nav-utility a { display: block; padding: 0.4rem 0.5rem; color: #555; text-decoration: none; font-size: 0.85rem; }
.sidebar-nav-unified .nav-utility a:hover { text-decoration: underline; color: #333; background-color: #f5f5f5; }
.sidebar-nav-unified .nav-utility.current-page a { background-color: #e8f0f7; color: #000; font-weight: bold; }

.sidebar-nav-unified .nav-external { margin-top: 0.5rem; }
.sidebar-nav-unified .nav-external a { display: block; padding: 0.4rem 0.5rem; color: #666; text-decoration: none; font-size: 0.85rem; }
.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; }

.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: #333; 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; }
}


/* 検索ボックス（ドロップダウン用） */
.search-container {
    margin-bottom: 0.75rem;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Meiryo', sans-serif;
}

.search-box input:focus {
    outline: none;
    border-color: #2d3748;
}

/* ========== サイドバー折りたたみ機能 ========== */
.sidebar-collapse {
    display: block;
    position: fixed;
    top: 10px;
    left: 220px;
    z-index: 1100;
    width: 32px;
    height: 32px;
    background: #f8fafc;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
    padding: 6px;
    transition: left 0.3s ease;
}

.sidebar-collapse span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    margin: 4px 0;
    transition: all 0.3s ease;
}

.sidebar-hidden .sidebar-collapse {
    left: 10px;
}

.sidebar-hidden .sidebar-menu {
    transform: translateX(-100%);
}

.sidebar-hidden .main-content {
    margin-left: 50px;
}
