/* サイドバー全体 */
.sidebar {
    width: 250px;
    /* サイドバーの幅 */
    background-color: #1e293b;
    /* 背景色 */
    color: #f8fafc;
    /* 文字色 */
    padding: 1rem;
    overflow-y: auto;
    /* 縦スクロール可能 */
    border-right: 1px solid #334155;
}

/* body を横並びにする */
body {
    display: flex;
    flex-direction: row;
    /* サイドバーとメインを横並び */
    height: 100vh;
    margin: 0;
}

/* メインコンテンツ部分 */
.main-content {
    flex: 1;
    /* 残り幅を全て使用 */
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background-color: #0f172a;
}

/* サイドバー内の章・節・小節 */
.sidebar .chapter {
    font-weight: bold;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.sidebar .section {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.sidebar .subsection {
    margin-left: 2rem;
    font-size: 0.85rem;
    color: #cbd5e1;
    cursor: pointer;
}

.sidebar .subsection:hover {
    color: #38bdf8;
    text-decoration: underline;
}


/* サイドバーの階層表示 */
.section-container {
    margin-left: 1rem;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.subsection-container {
    margin-left: 2rem;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

/* 開閉アニメーション用クラス */
.open {
    display: block;
    max-height: 500px;
    /* 適度な高さに制限 */
}

.closed {
    display: none;
    max-height: 0;
}