/* リプトン式 スピ×AIマーケ完全攻略講座 共通スタイル */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --ink: #1f2328;
  --ink-2: #4a4f57;
  --ink-3: #7a7f87;
  --line: #dcd7cc;
  --accent: #1d4e5f;
  --accent-soft: #e2edef;
  --gold: #b0852d;
  --gold-soft: #f6eedb;
  --todo: #9a3b2e;
  --todo-soft: #fbece8;
  --ok: #2f6b3b;
  --ok-soft: #e7f1e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181c; --surface: #1d2126; --surface-2: #252a30; --ink: #ecebe7; --ink-2: #c3c5c9; --ink-3: #8d9197;
    --line: #333940; --accent: #7fb6c7; --accent-soft: #1f3239; --gold: #d8b36a; --gold-soft: #2d2718;
    --todo: #f0a497; --todo-soft: #3a2522; --ok: #8fcf99; --ok-soft: #1f2e22;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #15181c; --surface: #1d2126; --surface-2: #252a30; --ink: #ecebe7; --ink-2: #c3c5c9; --ink-3: #8d9197;
  --line: #333940; --accent: #7fb6c7; --accent-soft: #1f3239; --gold: #d8b36a; --gold-soft: #2d2718;
  --todo: #f0a497; --todo-soft: #3a2522; --ok: #8fcf99; --ok-soft: #1f2e22;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 16px; line-height: 1.95; letter-spacing: .02em;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
img { max-width: 100%; }

/* ヘッダー */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; line-height: 1.4; }
.brand small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; letter-spacing: .08em; }
.site-header .spacer { flex: 1; }
.back-link { font-size: 13px; text-decoration: none; white-space: nowrap; }

/* トップページ */
.hero { max-width: 1080px; margin: 0 auto; padding: 48px 16px 32px; }
.hero .eyebrow { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .15em; }
.hero h1 { font-size: clamp(26px, 5.5vw, 40px); line-height: 1.45; margin: 8px 0 16px; }
.hero p { color: var(--ink-2); max-width: 640px; margin: 0; }
.notice { max-width: 1080px; margin: 0 auto 8px; padding: 0 16px; }
.notice p { margin: 0; font-size: 13px; color: var(--ink-3); border-left: 3px solid var(--line); padding-left: 12px; line-height: 1.8; }

.group { max-width: 1080px; margin: 0 auto; padding: 24px 16px 8px; }
.group h2 { font-size: 15px; letter-spacing: .1em; color: var(--ink-3); font-weight: 700; margin: 0 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
a.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card .num {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.card .lead { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin: 0 0 4px; }
.card .title { font-weight: 700; font-size: 16px; line-height: 1.5; margin: 0; }
.card .status { display: inline-block; margin-top: 8px; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-3); }
.card .status.open { background: var(--ok-soft); color: var(--ok); }
.card.soon { opacity: .6; box-shadow: none; }

.site-footer { max-width: 1080px; margin: 48px auto 0; padding: 24px 16px 40px; color: var(--ink-3); font-size: 12px; border-top: 1px solid var(--line); }

/* 教材ページ */
.layout { max-width: 1080px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1000px) { .layout { grid-template-columns: 240px minmax(0, var(--maxw)); justify-content: center; } }
.toc { display: none; }
@media (min-width: 1000px) {
  .toc { display: block; position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; padding: 32px 0; font-size: 13px; line-height: 1.6; }
  .toc a { display: block; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-left: 2px solid var(--line); }
  .toc a:hover { color: var(--accent); border-left-color: var(--accent); }
  .toc .toc-title { font-weight: 700; color: var(--ink-3); font-size: 12px; letter-spacing: .1em; margin-bottom: 8px; }
}
.toc-mobile { margin: 16px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.toc-mobile summary { cursor: pointer; font-weight: 700; padding: 10px 0; font-size: 14px; }
.toc-mobile ol { margin: 0 0 12px; padding-left: 1.4em; font-size: 14px; line-height: 1.9; }
.toc-mobile a { text-decoration: none; }
@media (min-width: 1000px) { .toc-mobile { display: none; } }

article { padding: 32px 0 24px; min-width: 0; }
.doc-head .eyebrow { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .12em; }
.doc-head h1 { font-size: clamp(24px, 5vw, 34px); line-height: 1.45; margin: 6px 0 12px; }
.doc-head .sub { color: var(--ink-2); margin: 0; }

article h2 {
  font-size: clamp(20px, 4vw, 24px); line-height: 1.5; margin: 64px 0 16px; padding-top: 8px;
  scroll-margin-top: 16px;
}
article h2 .chap { display: block; font-size: 12px; letter-spacing: .15em; color: var(--gold); font-weight: 700; }
article h3 { font-size: 18px; line-height: 1.5; margin: 36px 0 8px; padding-left: 12px; border-left: 4px solid var(--accent); }
article p { margin: 0 0 1.1em; }
article ul, article ol { padding-left: 1.4em; margin: 0 0 1.2em; }
article li { margin: .25em 0; }
.key { font-weight: 700; background: linear-gradient(transparent 62%, var(--gold-soft) 62%); }

.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; box-shadow: var(--shadow); }
.box > :last-child { margin-bottom: 0; }
.box .box-title { font-weight: 700; margin: 0 0 8px; font-size: 15px; }
.box.point { border-left: 5px solid var(--accent); }
.box.voice { background: var(--surface-2); box-shadow: none; border-style: dashed; }
.box.warn { border-left: 5px solid var(--todo); }
.todo { background: var(--todo-soft); border: 1px dashed var(--todo); color: var(--ink); border-radius: 10px; padding: 12px 16px; margin: 18px 0; font-size: 14px; line-height: 1.8; }
.todo::before { content: "【リプトン確認】"; display: block; font-weight: 700; color: var(--todo); font-size: 12px; letter-spacing: .05em; }
.todo.example::before { content: "【実例をここに入れる】"; }

.rhythm { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; gap: 6px; }
.rhythm li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-weight: 700; }

/* 表 */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; line-height: 1.7; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* 流れ図 */
.flow { display: grid; gap: 0; margin: 20px 0 28px; }
.flow .step { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.flow .step b { display: block; font-size: 15px; }
.flow .step span { font-size: 13px; color: var(--ink-2); line-height: 1.7; display: block; }
.flow .step .tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 8px; margin-bottom: 4px; }
.flow .arrow { text-align: center; color: var(--ink-3); font-size: 13px; line-height: 1; padding: 6px 0; }
.flow .arrow::before { content: "↓"; display: block; font-size: 18px; }

.compare { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 16px 0 24px; }
@media (min-width: 640px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare .col { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); }
.compare .col.bad { border-top: 4px solid var(--todo); }
.compare .col.good { border-top: 4px solid var(--ok); }
.compare .col .lbl { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.compare pre { white-space: pre-wrap; font-family: inherit; font-size: 14px; margin: 0; line-height: 1.8; }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 30px; margin: 8px 0; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 5px; }

.next-links { display: grid; gap: 10px; margin: 16px 0; }
.next-links a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.next-links a small { display: block; color: var(--ink-3); font-size: 12px; }
.next-links a.disabled { pointer-events: none; opacity: .55; }

.signature { margin-top: 40px; text-align: right; font-weight: 700; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 48px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.pager a { text-decoration: none; }

/* ボタン */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 24px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 15px; line-height: 1.4; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--accent); border: 1.5px solid var(--accent); }
:root[data-theme="dark"] .btn.primary { color: #10181b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #10181b; } }
.steps { list-style: none; padding: 0; margin: 12px 0 20px; counter-reset: st; }
.steps li { counter-increment: st; position: relative; padding: 10px 14px 10px 50px; margin: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.steps li::before { content: counter(st); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--surface); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
kbd { font-family: inherit; font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
