/* 設計書入門 - レイアウト */

.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: #f8fafc;
    border-right: 1px solid #cbd5e0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-hidden .sidebar-menu {
    transform: translateX(-100%);
}

.sidebar-nav-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-title {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: #2d3748;
    text-decoration: none;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #2d3748;
}

.sidebar-title:hover { text-decoration: underline; }

.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-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: #2d3748;
    background-color: #edf2f7;
}

.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: #2d3748;
    background-color: #e2e8f0;
    border-left: 3px solid #a0aec0;
}

.sidebar-nav-unified .nav-chapter.current-chapter .chapter-title-text {
    border-left-color: #2d3748;
    background-color: #cbd5e0;
}

.sidebar-nav-unified .chapter-pages {
    list-style: none;
    padding: 0; margin: 0;
    border-left: 3px solid #e2e8f0;
}

.sidebar-nav-unified .chapter-pages li { margin: 0; }

.sidebar-nav-unified .chapter-pages a {
    display: block;
    padding: 0.3rem 0.5rem 0.3rem 1rem;
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.5;
    transition: background-color 0.15s ease;
}

.sidebar-nav-unified .chapter-pages a:hover {
    background-color: #f7fafc;
    text-decoration: underline;
}

.sidebar-nav-unified .chapter-pages .current-page a {
    background-color: #edf2f7;
    color: #000;
    font-weight: bold;
    border-left: 2px solid #2d3748;
    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 #cbd5e0;
}

.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: #f7fafc;
}

.sidebar-nav-unified .nav-utility.current-page a {
    background-color: #edf2f7;
    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: 850px;
    transition: margin-left 0.3s ease;
}

.sidebar-hidden .main-content {
    margin-left: 50px;
}

.menu-toggle {
    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-hidden .menu-toggle {
    left: 10px;
}

.menu-toggle span {
    display: block;
    width: 100%; height: 2px;
    background: #333;
    margin: 4px 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 { left: 10px; }
    .sidebar-menu {
        transform: translateX(-100%);
    }
    .sidebar-menu.active { transform: translateX(0); }
    .sidebar-hidden .sidebar-menu { transform: translateX(-100%); }
    .menu-overlay.active { display: block; }
    .main-content {
        margin-left: 0;
        padding: 60px 15px 30px;
    }
    .sidebar-hidden .main-content {
        margin-left: 0;
    }
}
