/* 独学ロードマップ キット｜SWELLにない部品のスタイル。クラス名はすべて kb- で始まる */
:root {
  --kb-ink: #14233b;
  --kb-soft: #46556b;
  --kb-line: #dfe5ec;
  --kb-bg: #f6f8fa;
  --kb-brand: #0b7a5c;
  --kb-brand-dark: #075a44;
  --kb-brand-pale: #e6f4ef;
  --kb-accent: #e8590c;
  --kb-accent-pale: #fff1e6;
  --kb-note: #fff9db;
  --kb-radius: 12px;
}

/* このキットのページは1カラムで読ませる（サイドバーを出さない） */
.kb-page #sidebar, .kb-page .l-sidebar { display: none; }
.kb-page .l-mainContent { width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; float: none; }
.kb-page.kb-wide .l-mainContent { max-width: 1080px; }
.kb-page.kb-slug-index .c-pageTitle { display: none; }

/* 部品の中の見出しは、SWELLの見出し装飾を外す */
.post_content :is(.kb-card, .kb-phase, .kb-route-list, .kb-diag, .kb-hero, .kb-band, .kb-steps) :is(h2, h3) {
  background: none; border: 0; padding: 0; color: var(--kb-ink); letter-spacing: 0;
}
.post_content :is(.kb-card, .kb-phase, .kb-route-list, .kb-diag, .kb-hero, .kb-band, .kb-steps) :is(h2, h3)::before,
.post_content :is(.kb-card, .kb-phase, .kb-route-list, .kb-diag, .kb-hero, .kb-band, .kb-steps) :is(h2, h3)::after { content: none; }
.post_content .wp-block-table.kb-wide { overflow-x: auto; }
.post_content .wp-block-table.kb-wide table { min-width: 520px; }
.kb-kw { font-weight: 700; background: linear-gradient(transparent 62%, #ffe9a8 62%); }

/* ページ冒頭のラベルと更新日 */
.kb-head { margin-bottom: 1.25em; }
.kb-tag { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.9; border-radius: 6px; padding: 0 8px; background: var(--kb-brand-pale); color: var(--kb-brand-dark); margin-bottom: 8px; }
.kb-tag.kb-s { background: #fde8e8; color: #b42318; }
.kb-tag.kb-a { background: var(--kb-accent-pale); color: #b54708; }
.kb-tag.kb-b { background: #eef2f6; color: var(--kb-soft); }
.post_content .kb-meta { font-size: 13px; color: var(--kb-soft); display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }

/* 結論ボックス・囲み */
.post_content .kb-answer { background: var(--kb-brand-pale); border-left: 5px solid var(--kb-brand); border-radius: 0 var(--kb-radius) var(--kb-radius) 0; padding: 16px 18px; }
.post_content .kb-answer .kb-ttl { font-weight: 800; color: var(--kb-brand-dark); font-size: 14px; margin: 0 0 4px; }
.post_content .kb-answer ul { margin: 0; padding-left: 20px; }
.post_content .kb-box { border: 1px solid var(--kb-line); border-radius: var(--kb-radius); padding: 16px 18px; }
.post_content .kb-box .kb-ttl { font-weight: 800; font-size: 14px; margin: 0 0 6px; }
.post_content .kb-box.kb-case { background: #f3f7ff; border-color: #cfdcf5; }
.post_content .kb-box.kb-cta { background: var(--kb-accent-pale); border-color: #f6cfae; }
.post_content .kb-box.kb-warn { background: var(--kb-note); border-color: #f0e2a0; }
.post_content :is(.kb-box, .kb-answer, .kb-srcs, .kb-phase) :is(p, ul, ol) { margin-bottom: .6em; }
.post_content :is(.kb-box, .kb-answer, .kb-srcs) :is(p, ul, ol):last-child { margin-bottom: 0; }
.post_content .kb-srcs { font-size: 13px; color: var(--kb-soft); border-top: 1px solid var(--kb-line); padding-top: 14px; }
.post_content .kb-srcs p { margin: 0 0 4px; font-weight: 700; }
.post_content .kb-srcs ul { margin: 0; padding-left: 18px; }
.post_content .kb-src { font-size: 12px; color: var(--kb-soft); margin: 8px 0 0; }

/* 棒グラフ・手順・1日の例 */
.kb-bars { display: grid; gap: 8px; }
.kb-bars div { display: grid; grid-template-columns: 9.5em 1fr 4.5em; gap: 10px; align-items: center; font-size: 14px; }
.kb-bars i { display: block; height: 18px; border-radius: 4px; background: var(--kb-brand); min-width: 4px; }
.kb-bars div.kb-sub i { background: #9fb3c8; }
.kb-bars strong { text-align: right; font-variant-numeric: tabular-nums; }
.kb-cycle { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: kbcy; }
.kb-cycle div { counter-increment: kbcy; background: var(--kb-brand-pale); border-radius: var(--kb-radius); padding: 12px; font-size: 14px; line-height: 1.6; }
.kb-cycle div::before { content: counter(kbcy); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--kb-brand); color: #fff; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.kb-cycle strong { display: block; }
.kb-day { display: grid; gap: 6px; }
.kb-day div { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; font-size: 14px; background: var(--kb-bg); border-radius: 8px; padding: 8px 12px; }
.kb-day div strong { color: var(--kb-brand-dark); }

/* 参考書ルート */
.post_content .kb-route-list { list-style: none; padding: 0; position: relative; }
.kb-route-list::before { content: ""; position: absolute; left: 17px; top: 10px; bottom: 10px; width: 2px; background: var(--kb-line); }
.post_content .kb-route-list > li { position: relative; padding: 0 0 22px 52px; margin: 0; }
.post_content .kb-route-list > li:last-child { padding-bottom: 0; }
.post_content .kb-route-list > li::before { content: none; }
.kb-route-list .kb-no { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--kb-brand); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.post_content .kb-route-list h3 { margin: 2px 0 4px; font-size: 16px; }
.post_content .kb-route-list .kb-book { font-weight: 700; margin: 0; }
.post_content .kb-route-list dl { margin: 8px 0 0; display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; font-size: 14px; }
.post_content .kb-route-list dt { color: var(--kb-soft); font-weight: 400; margin: 0; }
.post_content .kb-route-list dd { margin: 0; padding: 0; }
.kb-goal { display: inline-block; background: var(--kb-accent-pale); color: #b54708; font-weight: 700; border-radius: 6px; padding: 0 8px; }

/* 時期の帯 */
.kb-phases { display: grid; gap: 4px; margin-bottom: 6px; font-size: 13px; }
.post_content .kb-phases a { text-decoration: none; color: #fff; padding: 10px 12px; line-height: 1.5; background: var(--kb-brand); }
.post_content .kb-phases a:nth-child(2) { background: #0f6b8c; }
.post_content .kb-phases a:nth-child(3) { background: #7a4fb5; }
.post_content .kb-phases a:nth-child(4) { background: var(--kb-accent); }
.kb-phases a:first-child { border-radius: 10px 0 0 10px; }
.kb-phases a:last-child { border-radius: 0 10px 10px 0; }
.kb-phases strong { display: block; font-size: 14px; }
.kb-months { display: grid; font-size: 11px; color: var(--kb-soft); text-align: center; }

/* 進み具合とチェックリスト */
.kb-progress { position: sticky; top: calc(var(--swl-offset_y, 0px) + 8px); z-index: 10; background: #fff; border: 1px solid var(--kb-line); border-radius: var(--kb-radius); padding: 10px 14px; display: flex; align-items: center; gap: 12px; font-size: 13px; box-shadow: 0 4px 12px rgba(20, 35, 59, .06); }
.kb-bar { flex: 1; height: 10px; background: #e7ecf1; border-radius: 999px; overflow: hidden; }
.kb-bar i { display: block; height: 100%; width: 0; background: var(--kb-brand); border-radius: 999px; transition: width .3s; }
.kb-progress strong { font-size: 15px; min-width: 44px; text-align: right; }
.kb-progress button { background: none; border: 0; color: var(--kb-soft); font-size: 12px; text-decoration: underline; cursor: pointer; font-family: inherit; padding: 0; }
.post_content .kb-phase { border: 1px solid var(--kb-line); border-radius: var(--kb-radius); padding: 0 16px 16px; overflow: hidden; margin-bottom: 16px; }
.post_content .kb-phase h3 { margin: 0 -16px; padding: 12px 16px 0; background: #eef2f6; font-size: 16px; }
.post_content .kb-phase .kb-period { margin: 0 -16px 12px; padding: 0 16px 10px; background: #eef2f6; font-size: 13px; color: var(--kb-soft); }
.post_content .kb-phase p { font-size: 14px; }
.post_content .kb-checks { list-style: none; margin: 0 0 .6em; padding: 0; }
.post_content .kb-checks li { border-top: 1px solid var(--kb-line); margin: 0; padding: 10px 2px; font-size: 15px; line-height: 1.6; }
.post_content .kb-checks li::before { content: none; }
.post_content .kb-checks li:first-child { border-top: 0; }
.kb-checks label { display: flex; gap: 12px; cursor: pointer; align-items: flex-start; }
.kb-checks input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--kb-brand); flex: none; }
.kb-checks small { display: block; color: var(--kb-soft); font-size: 13px; }
.kb-checks input:checked ~ span { color: var(--kb-soft); text-decoration: line-through; text-decoration-color: #b7c2cf; }
.kb-checks input:checked ~ span small { text-decoration: none; }
.post_content .kb-gate { background: var(--kb-accent-pale); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.kb-gate strong { color: #b54708; }
.post_content .kb-phase .kb-box { margin-top: 12px; }

/* よくある質問 */
.post_content .kb-faq details { background: #fff; border: 1px solid var(--kb-line); border-radius: var(--kb-radius); margin: 0 0 10px; padding: 0; }
.kb-faq summary { cursor: pointer; font-weight: 700; padding: 14px 44px 14px 18px; position: relative; list-style: none; }
.kb-faq summary::-webkit-details-marker { display: none; }
.kb-faq summary::after { content: "+"; position: absolute; right: 18px; top: 10px; font-size: 22px; color: var(--kb-brand); font-weight: 400; }
.kb-faq details[open] summary::after { content: "−"; }
.post_content .kb-faq details p { margin: 0; padding: 0 18px 16px; font-size: 15px; color: var(--kb-soft); }

/* 監修者 */
.kb-author { border: 1px solid var(--kb-line); border-radius: var(--kb-radius); padding: 16px 18px; font-size: 14px; }
.post_content .kb-author p { margin: 0; }
.kb-author .kb-author-ttl strong { display: inline-block; margin-right: 10px; padding: 1px 10px; border-radius: 999px; background: var(--kb-brand-pale); color: var(--kb-brand-dark); font-size: 12px; }
.post_content .kb-author .kb-kanshu { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.post_content .kb-author .kb-kanshu li { display: flex; gap: 10px; align-items: center; margin: 0; padding: 0; }
.post_content .kb-author .kb-kanshu li::before { content: none; }
.kb-author .kb-kanshu img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: #e7ecf1; }
.kb-author .kb-kanshu span { display: flex; flex-direction: column; line-height: 1.5; min-width: 0; }
.kb-author .kb-kanshu small { color: var(--kb-soft); font-size: 12px; }
.kb-author .kb-author-more { font-size: 13px; color: var(--kb-soft); }
@media (max-width: 720px) { .post_content .kb-author .kb-kanshu { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .post_content .kb-author .kb-kanshu { grid-template-columns: 1fr; } }

/* カード */
.kb-grid { display: grid; gap: 16px; }
.kb-g2 { grid-template-columns: repeat(2, 1fr); }
.kb-g3 { grid-template-columns: repeat(3, 1fr); }
.kb-g4 { grid-template-columns: repeat(4, 1fr); }
.post_content a.kb-card { background: #fff; border: 1px solid var(--kb-line); border-radius: var(--kb-radius); padding: 18px; text-decoration: none; color: var(--kb-ink); display: block; transition: border-color .15s, transform .15s; }
.post_content a.kb-card:hover { border-color: var(--kb-brand); transform: translateY(-2px); }
.post_content .kb-card h3 { font-size: 16px; margin: 0 0 6px; line-height: 1.5; }
.post_content .kb-card p { font-size: 14px; color: var(--kb-soft); margin: 0; line-height: 1.7; }
.post_content .kb-sec-lead { color: var(--kb-soft); }

/* ---------- トップページ ---------- */
.kb-wrap { max-width: 1040px; margin: 0 auto; }
.kb-hero, .kb-band { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding-left: calc(50vw - 50%); padding-right: calc(50vw - 50%); }
.post_content > .kb-hero, .post_content > .kb-band { margin-bottom: 0; }
.kb-hero { background: linear-gradient(180deg, #fff 0%, var(--kb-brand-pale) 100%); padding-top: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--kb-line); }
.kb-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: start; }
.kb-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; color: var(--kb-brand-dark); background: var(--kb-brand-pale); border: 1px solid #bfe3d6; border-radius: 999px; padding: 2px 12px; margin-bottom: 14px; }
.post_content .kb-hero-ttl { font-size: clamp(26px, 4.2vw, 38px); line-height: 1.4; margin: 0 0 16px; word-break: auto-phrase; }
.kb-hero-ttl em { font-style: normal; color: var(--kb-brand); }
.post_content .kb-lead { color: var(--kb-soft); margin: 0 0 20px; }
.post_content .kb-hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 15px; }
.post_content .kb-hero-points li { padding-left: 28px; position: relative; margin: 0; }
.post_content .kb-hero-points li::before { content: "✓"; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; background: var(--kb-brand); color: #fff; font-size: 12px; font-weight: 700; }
.kb-band { padding-top: 44px; padding-bottom: 44px; background: var(--kb-bg); }
.kb-band.kb-alt { background: #fff; border-top: 1px solid var(--kb-line); border-bottom: 1px solid var(--kb-line); }
.post_content h2.kb-sec { font-size: clamp(21px, 3vw, 26px); line-height: 1.5; margin: 0 0 8px; }
.post_content .kb-band .kb-sec-lead { margin: 0 0 24px; max-width: 720px; }
.post_content .kb-steps { counter-reset: kbst; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.post_content .kb-steps li { counter-increment: kbst; background: #fff; border: 1px solid var(--kb-line); border-radius: var(--kb-radius); padding: 16px 14px; font-size: 14px; margin: 0; }
.post_content .kb-steps li::before { content: "STEP " counter(kbst); display: block; font-size: 12px; font-weight: 800; color: var(--kb-brand); letter-spacing: .06em; position: static; background: none; width: auto; height: auto; }
.kb-steps strong { display: block; font-size: 15px; margin-bottom: 4px; }
.kb-steps span { color: var(--kb-soft); font-size: 13px; line-height: 1.7; display: block; }
.kb-tbl-wrap { overflow-x: auto; border: 1px solid var(--kb-line); border-radius: var(--kb-radius); background: #fff; }
.post_content .kb-tbl-wrap table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 520px; margin: 0; border: 0; }
.post_content .kb-tbl-wrap :is(th, td) { padding: 10px 14px; text-align: left; border: 0; border-bottom: 1px solid var(--kb-line); vertical-align: top; background: none; color: inherit; }
.post_content .kb-tbl-wrap thead th { background: #eef2f6; font-size: 13px; white-space: nowrap; }
.post_content .kb-tbl-wrap tbody th { font-weight: 700; white-space: nowrap; }

/* 診断 */
.kb-diag { background: #fff; border: 1px solid var(--kb-line); border-radius: 16px; padding: 22px; box-shadow: 0 8px 24px rgba(20, 35, 59, .08); }
.post_content .kb-diag h2 { font-size: 18px; margin: 0 0 4px; }
.post_content .kb-diag .kb-sub { font-size: 13px; color: var(--kb-soft); margin: 0 0 14px; }
.kb-q { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.kb-q legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 6px; }
.kb-q legend span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--kb-ink); color: #fff; font-size: 12px; margin-right: 6px; }
.kb-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-opts label { cursor: pointer; position: relative; }
.kb-opts input { position: absolute; opacity: 0; }
.kb-opts span { display: block; border: 1.5px solid var(--kb-line); border-radius: 10px; padding: 7px 12px; font-size: 14px; line-height: 1.5; background: #fff; }
.kb-opts small { font-size: 12px; }
.kb-opts input:checked + span { border-color: var(--kb-brand); background: var(--kb-brand-pale); color: var(--kb-brand-dark); font-weight: 700; }
.kb-opts input:focus-visible + span { outline: 2px solid var(--kb-brand); outline-offset: 2px; }
.kb-result { border-top: 1px dashed var(--kb-line); margin-top: 6px; padding-top: 14px; }
.kb-result[hidden] { display: none; }
.post_content .kb-result .kb-route { font-weight: 800; font-size: 17px; margin: 0 0 6px; }
.post_content .kb-result dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 14px; margin: 0 0 12px; }
.post_content .kb-result dt { color: var(--kb-soft); font-weight: 400; margin: 0; }
.post_content .kb-result dd { margin: 0; padding: 0; font-weight: 700; }
.post_content .kb-pace { font-size: 13px; border-radius: 8px; padding: 8px 10px; margin: 0 0 12px; background: var(--kb-brand-pale); }
.post_content .kb-pace.kb-warn { background: var(--kb-accent-pale); }
.post_content .kb-diag .kb-alt-link { font-size: 13px; margin: 10px 0 0; text-align: center; }
.post_content a.kb-btn { display: inline-block; background: var(--kb-brand); color: #fff; text-decoration: none; font-weight: 700; border-radius: 10px; padding: 11px 20px; font-size: 15px; }
.post_content a.kb-btn:hover { background: var(--kb-brand-dark); }
.post_content a.kb-btn.kb-block { display: block; text-align: center; }

@media (max-width: 860px) {
  .kb-hero { padding-top: 28px; padding-bottom: 28px; }
  .kb-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .kb-g3, .kb-g4 { grid-template-columns: repeat(2, 1fr); }
  .post_content .kb-steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kb-g2, .kb-g3, .kb-g4 { grid-template-columns: 1fr; }
  .kb-phases { grid-template-columns: 1fr !important; }
  .kb-phases a, .kb-phases a:first-child, .kb-phases a:last-child { border-radius: 8px; }
  .kb-months { display: none; }
  .kb-band { padding-top: 32px; padding-bottom: 32px; }
  .post_content .kb-route-list dl { grid-template-columns: 1fr; gap: 0; }
  .post_content .kb-route-list dt { margin-top: 6px; font-size: 12px; }
  .kb-cycle { grid-template-columns: 1fr 1fr; }
  .kb-bars div { grid-template-columns: 7em 1fr 4em; }
}
