/* =========================================================
   学習ページ（目次・章本文）
   styles.css の変数（色・書体）をそのまま使う
   ========================================================= */

/* ---------- 目次 ---------- */
.learn-hero {
  padding: 72px 0 60px;
  background:
    radial-gradient(900px 420px at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(700px 420px at 5% 0%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 62%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.learn-hero-title {
  font-family: var(--serif); font-weight: 700; line-height: 1.45;
  font-size: clamp(26px, 5vw, 40px); margin: 0 0 20px; letter-spacing: .02em;
}
.learn-hero-lead {
  color: var(--ink-soft); max-width: 640px; margin: 0 0 28px; font-size: 15.5px;
}

.series-subtitle-lg {
  font-family: var(--serif); color: var(--ink-soft); font-size: 15px;
  margin: -8px 0 18px; letter-spacing: .02em;
}

/* ---------- シリーズ一覧 ---------- */
.series-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.series-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.series-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--accent), var(--teal)); opacity: .85;
}
.series-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.series-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.series-label {
  font-family: var(--serif); font-weight: 600; font-size: 13px; letter-spacing: .1em;
  color: #fff; background: var(--teal); padding: 4px 12px; border-radius: 999px;
}
.series-count {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  padding: 3px 10px; border-radius: 999px;
}
.series-title { font-family: var(--serif); font-weight: 600; font-size: 20px; margin: 0 0 8px; line-height: 1.5; }
.series-title a { text-decoration: none; color: inherit; }
.series-title a:hover { color: var(--accent-deep); }
.series-subtitle { font-size: 13px; color: var(--ink-faint); margin: 0 0 12px; font-family: var(--serif); }
.series-desc { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.8; }
.series-cta { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.series-cta a { text-decoration: none; font-weight: 700; font-size: 14px; color: var(--accent-deep); }
.series-cta a:hover { text-decoration: underline; }

/* ---------- パンくず ---------- */
.breadcrumb {
  border-bottom: 1px solid var(--line); background: var(--paper-2);
  font-size: 12.5px; padding: 12px 0;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-deep); }
.breadcrumb span { color: var(--ink-faint); margin: 0 8px; }

.toc-group { margin-bottom: 40px; }
.toc-part {
  font-family: var(--serif); font-weight: 600; font-size: 17px; color: var(--teal);
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  letter-spacing: .02em;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-item { margin-bottom: 8px; }
.toc-link {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 18px; border-radius: 12px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.toc-link:hover {
  transform: translateX(3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
}
.toc-no {
  flex: 0 0 auto; font-family: var(--serif); font-weight: 600; font-size: 15px;
  color: #fff; background: var(--teal); width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 9px;
}
.toc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.toc-title { font-weight: 700; font-size: 15.5px; color: var(--ink); line-height: 1.6; }
.toc-summary { font-size: 13px; color: var(--ink-faint); line-height: 1.7; }

/* ---------- 章ページ ---------- */
.chapter { padding: 56px 0 72px; }
.chapter .wrap { max-width: 760px; }   /* 読み物なので本文幅を絞る */
.chapter-part {
  font-size: 12px; letter-spacing: .18em; font-weight: 700;
  color: var(--accent-deep); margin: 0 0 12px;
}
.chapter-title {
  font-family: var(--serif); font-weight: 700; line-height: 1.5;
  font-size: clamp(24px, 4.6vw, 34px); margin: 0 0 18px; letter-spacing: .02em;
}
.chapter-meta {
  display: flex; align-items: center; gap: 14px; margin-bottom: 40px;
  font-size: 12.5px; color: var(--ink-faint);
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.progress {
  flex: 1; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.progress-bar { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.chapter-video {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  margin-bottom: 40px; border-radius: 12px; overflow: hidden;
  background: var(--paper-2);
}
.chapter-video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* --- 本文タイポグラフィ --- */
.chapter-body { font-size: 16.5px; line-height: 2.0; color: var(--ink); }
.chapter-body > *:first-child { margin-top: 0; }

.chapter-body h2 {
  font-family: var(--serif); font-weight: 600; font-size: 23px;
  margin: 56px 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--accent);
  letter-spacing: .02em; line-height: 1.5;
}
.chapter-body h3 {
  font-family: var(--serif); font-weight: 600; font-size: 16.5px;
  margin: 44px 0 14px; letter-spacing: .02em; line-height: 1.6;
  padding-left: 14px; border-left: 4px solid var(--teal);
}
.chapter-body h4 {
  font-weight: 700; font-size: 16.5px; margin: 32px 0 10px; color: var(--teal);
}
.chapter-body p { margin: 0 0 22px; }
.chapter-body strong { font-weight: 700; color: var(--ink); }

.chapter-body ul, .chapter-body ol { margin: 0 0 24px; padding-left: 1.5em; }
.chapter-body li { margin-bottom: 8px; }
.chapter-body li::marker { color: var(--accent); }

/* 引用＝プロンプト例・強調のかたまり */
.chapter-body blockquote {
  margin: 26px 0; padding: 20px 24px;
  background: var(--paper-2); border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0; color: var(--ink-soft);
}
.chapter-body blockquote p { margin: 0 0 12px; }
.chapter-body blockquote p:last-child { margin-bottom: 0; }
.chapter-body blockquote strong { color: var(--accent-deep); }

.chapter-body hr {
  border: 0; height: 1px; margin: 40px 0;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* 表は横スクロールで守る */
.chapter-body table {
  width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14.5px;
}
.chapter-body table th, .chapter-body table td {
  border: 1px solid var(--line); padding: 10px 14px; text-align: left; line-height: 1.7;
}
.chapter-body table th { background: var(--paper-2); font-weight: 700; }

.chapter-body pre {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.8; margin: 24px 0;
}
.chapter-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em;
  background: var(--paper-2); padding: 2px 6px; border-radius: 5px;
}
.chapter-body pre code { background: none; padding: 0; }

/* チェックリスト（- [ ] 記法） */
.chapter-body input[type="checkbox"] { margin-right: 8px; accent-color: var(--accent); }
.chapter-body li:has(input[type="checkbox"]) { list-style: none; margin-left: -1.2em; }

/* ---------- 前後の章 ---------- */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 56px 0 24px; padding-top: 32px; border-top: 1px solid var(--line);
}
.pager-link {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
  background: var(--card); transition: border-color .18s ease, transform .18s ease;
}
a.pager-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px);
}
.pager-next { text-align: right; }
.pager-dir { font-size: 12px; font-weight: 700; color: var(--accent-deep); letter-spacing: .04em; }
.pager-title { font-size: 14px; color: var(--ink); line-height: 1.6; }
.pager-link.is-disabled { opacity: .5; }
.pager-link.is-disabled .pager-title { color: var(--ink-faint); }

.back-to-toc { text-align: center; margin: 0; font-size: 14px; }
.back-to-toc a { color: var(--ink-soft); text-decoration: none; }
.back-to-toc a:hover { color: var(--accent-deep); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
  .series-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .learn-hero { padding: 52px 0 44px; }
  .series-card { padding: 22px 20px; }
  .series-title { font-size: 18.5px; }
  .breadcrumb { font-size: 12px; }
  .chapter { padding: 40px 0 56px; }
  .chapter-body { font-size: 16px; line-height: 1.95; }
  .chapter-body h2 { font-size: 20px; margin-top: 44px; }
  .chapter-body h3 { font-size: 16px; margin-top: 36px; }
  .chapter-body blockquote { padding: 16px 18px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
  .toc-link { padding: 14px 15px; gap: 12px; }
  .toc-title { font-size: 15px; }
}
