/* メインコンテンツの調整 */
.main__content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* 画像サイズの調整 */
.main__content img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

/* サイドバーの調整 */
.sidebar {
    padding: 1rem;
    width: 300px;
    position: sticky;
    top: 20px;
}

/* 目次ウィジェットのスタイル */
.widget-toc {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    position: sticky;
    top: 20px;
    overflow:visible
}

/* 目次の各セクションのスタイル */
.widget-toc nav > ul > li {
    margin: 1rem 0;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 最初の見出し（#）のスタイル */
.widget-toc nav > ul > li > a {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
    border-bottom: 2px solid #0066cc;
    margin-bottom: 0.5rem;
    display: block;
    padding-bottom: 0.3rem;
}

/* サブセクションのスタイル */
.widget-toc nav > ul > li > ul {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #eee;
}

/* アクティブな項目のスタイル */
.widget-toc nav a.active {
    color: #0066cc;
    background-color: rgba(0, 102, 204, 0.05);
}

/* ホバー時のスタイル */
.widget-toc nav > ul > li:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #0066cc;
    transition: all 0.3s ease;
}

.widget-toc .widget__title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.widget-toc nav {
    font-size: 0.9rem;
}

.widget-toc nav ul {
    list-style: none;
    padding-left: 0.5rem; /* ネストされたアイテムのインデント */
    margin: 0;
    border-left: 1px solid #eee; /* 階層を示す薄いライン */
}

.widget-toc nav ul ul {
    padding-left: 1rem; /* さらにネストされたアイテムのインデント */
}

.widget-toc nav li {
    margin: 0.5rem 0;
}

/* 目次のリンクスタイル */
.widget-toc nav a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.2rem 0;
    border-left: 2px solid transparent; /* 左側のラインのための余白 */
    padding-left: 10px; /* 左側の余白 */
    transition: all 0.3s ease; /* スムーズな変化のためのアニメーション */
}

.widget-toc nav a:hover {
    color: #0066cc;
    border-left: 2px solid #0066cc;
    background-color: rgba(0, 102, 204, 0.05);
}

.main__content ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6; /* 行の高さを設定 */

}

.main__content ol li::before {
    font-weight: 700;
    min-width: 2rem;
    margin-right: 0.5rem;
    text-align: right;
}

/* 通常の箇条書きのスタイル */
.main__content ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin-left: 0;
}

.main__content ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    display: list-item; /* リストアイテムのデフォルト表示に戻す */
}

/* ネストされたリストのスタイル */
.main__content ol ol {
    margin-top: 0.5rem;
    margin-left: 2.5rem;
}

.main__content ol ol li::before {
    content: counter(item, lower-alpha) ".";
}

.main__content ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

/* リストアイテム内のコンテンツ幅調整（番号付きリストのみ） */
.main__content ol li > * {
    flex: 1;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-top: 2rem;
        position: relative;
    }
    
    .widget-toc {
        position: relative;
        top: 0;
    }
    
    .main__content {
        padding: 1rem;
    }
    
    .main__content img {
        max-width: 100%;
    }
    
    .main__content ol {
        padding-left: 0.5rem;
    }
    
    .main__content ol li::before {
        min-width: 1.5rem;
    }
    
    .main__content ul {
        padding-left: 1.5rem;
    }
}

.small-text {
    font-size: 0.8em !important; /* 小さくするサイズを調整 */
}
