/* ===== 章ページ専用の補助スタイル =====
   既存 style.css には手を加えず、本文の可読性のみ補う追加CSS。
   各章HTMLで style.css の後に読み込む。 */

.content-body h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.4rem;
    margin-top: 2.5rem;
}
.content-body h2:first-child { margin-top: 0; }

.content-body h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-top: 2rem;
    padding-left: 0.6rem;
    border-left: 5px solid var(--secondary-color);
}

.content-body p { margin: 1rem 0; }
.content-body ul, .content-body ol { margin: 1rem 0; padding-left: 1.5rem; }
.content-body li { margin-bottom: 0.5rem; }
.content-body a { color: var(--secondary-color); }

.content-body code {
    background-color: var(--accent-color);
    color: #be123c;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 0.9em;
}
.content-body pre code { background: none; color: inherit; padding: 0; }

/* 章トップの「学習のねらい」ボックス */
.goal-box {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-left: 4px solid #10b981;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.goal-box strong { color: #047857; }

/* 初学者向け「つまずきポイント」ボックス */
.pitfall {
    background-color: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}
.pitfall strong { color: #c2410c; }

/* 用語解説ボックス */
.term {
    background-color: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-left: 4px solid #8b5cf6;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}
.term strong { color: #6d28d9; }

/* ダウンロード強調ボックス */
.download-box {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}
.download-box a {
    display: inline-block;
    background: white;
    color: #1e3a8a !important;
    font-weight: 700;
    padding: 0.6rem 1.8rem;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 0.8rem;
}
.download-box .fname { font-family: monospace; font-size: 0.95rem; opacity: 0.9; }

/* 章送りナビ */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}
.chapter-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}
.chapter-nav .prev::before { content: "← "; }
.chapter-nav .next::after { content: " →"; }

/* ステップ手順 */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
}
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 1.7rem; height: 1.7rem;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
}

/* スマホ対応: 2カラムを縦積みに */
@media (max-width: 768px) {
    .main-layout, .sidebar, .content-body { display: block; width: auto; }
    .content-body { padding-left: 0; margin-top: 1.5rem; }
}
