/* =========================================================
   Claude Code 開発 教材ページ 共通スタイル
   TOP（index）のミニマル・エディトリアル意匠を踏襲。
   紙色 × 墨色 × 朱。余白・極細罫線・明朝見出し。
   ========================================================= */

/* ---------------------------------------------------------
   期間限定 無料公開中 バッジ（朱の細枠）
   --------------------------------------------------------- */
.free-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(182, 80, 42, 0.45);
  border-radius: 1px;
  color: #b6502a;
  background: rgba(182, 80, 42, 0.04);
  line-height: 1;
  white-space: nowrap;
}
.free-badge .lead {
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.free-badge .main {
  font-family: "Shippori Mincho", serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}
/* スクロールでヘッダーが紙色になっても馴染むよう、わずかに濃く */
#site-header.scrolled .free-badge {
  background: rgba(182, 80, 42, 0.06);
}
/* ヒーロー用の大きめバッジ */
.free-badge-lg {
  padding: 0.55rem 1.1rem;
  gap: 0.7rem;
}
.free-badge-lg .lead {
  font-size: 0.6rem;
}
.free-badge-lg .main {
  font-size: 0.95rem;
}
/* 狭い画面では英字リードを隠して省スペースに */
@media (max-width: 400px) {
  .free-badge .lead { display: none; }
  .free-badge { padding: 0.4rem 0.7rem; }
}

/* ---------------------------------------------------------
   パンくず
   --------------------------------------------------------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: #8a857c;
}
.crumb a {
  color: #8a857c;
  transition: color 0.3s ease;
}
.crumb a:hover {
  color: #1c1b19;
}
.crumb .sep {
  opacity: 0.5;
}
.crumb .current {
  color: #1c1b19;
}

/* ---------------------------------------------------------
   この章のゴール（朱の縦罫＋余白）
   --------------------------------------------------------- */
.goal {
  border-left: 1px solid #b6502a;
  padding-left: 1.75rem;
}
.goal-label {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #b6502a;
}
.goal ul {
  margin-top: 1.25rem;
}
.goal li {
  position: relative;
  padding-left: 1.4rem;
  padding-bottom: 0.9rem;
  font-size: 0.9rem;
  line-height: 1.9;
  font-weight: 300;
}
.goal li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #b6502a;
}

/* ---------------------------------------------------------
   本文（教材プローズ）
   --------------------------------------------------------- */
.prose h3 {
  font-family: "Shippori Mincho", serif;
  font-size: 1.25rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
  margin-top: 3.5rem;
}
.prose h4 {
  font-family: "Shippori Mincho", serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}
.prose p {
  font-size: 0.9375rem;
  line-height: 2.1;
  font-weight: 300;
  color: rgba(28, 27, 25, 0.82);
  margin-top: 1.25rem;
}
.prose strong {
  font-weight: 500;
  color: #1c1b19;
}
/* 墨色ブロック内の強調は紙色に（暗背景で読めるように） */
.pitfall strong {
  font-weight: 500;
  color: #f6f4ef;
}
.prose ol.steps {
  margin-top: 1.75rem;
  counter-reset: step;
}
.prose ol.steps > li {
  position: relative;
  padding-left: 3rem;
  padding-bottom: 1.75rem;
  font-size: 0.9375rem;
  line-height: 2;
  font-weight: 300;
}
.prose ol.steps > li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-family: "Shippori Mincho", serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: #b6502a;
}

/* ---------------------------------------------------------
   コードブロック（プロンプト例・コマンド）
   --------------------------------------------------------- */
.code {
  margin-top: 1.5rem;
  background: #1c1b19;
  color: #f6f4ef;
  border-radius: 2px;
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid rgba(246, 244, 239, 0.12);
}
.code-head .label {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(246, 244, 239, 0.55);
}
.code-copy {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 244, 239, 0.7);
  cursor: pointer;
  transition: color 0.3s ease;
  background: none;
  border: none;
  padding: 0;
}
.code-copy:hover {
  color: #f6f4ef;
}
.code pre {
  margin: 0;
  padding: 1.2rem 1.3rem;
  overflow-x: auto;
}
.code code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.85;
  color: #f6f4ef;
  white-space: pre;
}
/* プロンプト（日本語の指示）は折り返す */
.code.prompt code {
  white-space: pre-wrap;
  word-break: break-word;
  color: #f0ddd2;
}

/* ---------------------------------------------------------
   「となりに座って一言」コラム
   --------------------------------------------------------- */
.aside {
  margin-top: 2.25rem;
  padding: 1.6rem 1.8rem;
  background: rgba(182, 80, 42, 0.05);
  border: 1px solid rgba(182, 80, 42, 0.18);
  border-radius: 2px;
}
.aside .tag {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #b6502a;
}
.aside p {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 2;
  font-weight: 300;
  color: rgba(28, 27, 25, 0.85);
}

/* ---------------------------------------------------------
   つまずきポイント（墨色ブロック）
   --------------------------------------------------------- */
.pitfall {
  margin-top: 2.5rem;
  background: #1c1b19;
  color: #f6f4ef;
  padding: 1.8rem 2rem;
  border-radius: 2px;
}
.pitfall .tag {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #c97a55;
}
.pitfall h4 {
  font-family: "Shippori Mincho", serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-top: 0.6rem;
}
.pitfall p {
  margin-top: 0.7rem;
  font-size: 0.875rem;
  line-height: 2;
  font-weight: 300;
  color: rgba(246, 244, 239, 0.72);
}

/* ---------------------------------------------------------
   用語ミニ解説
   --------------------------------------------------------- */
.term {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.9;
}
.term dt {
  font-weight: 500;
  color: #1c1b19;
  white-space: nowrap;
}
.term dd {
  font-weight: 300;
  color: rgba(28, 27, 25, 0.75);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(28, 27, 25, 0.08);
}

/* ---------------------------------------------------------
   章ナビ（前へ／次へ）
   --------------------------------------------------------- */
.chapter-nav {
  display: grid;
  gap: 1px;
  background: rgba(28, 27, 25, 0.12);
  border-top: 1px solid rgba(28, 27, 25, 0.12);
  border-bottom: 1px solid rgba(28, 27, 25, 0.12);
}
@media (min-width: 640px) {
  .chapter-nav {
    grid-template-columns: 1fr 1fr;
  }
}
.chapter-nav a {
  background: #f6f4ef;
  padding: 1.75rem 1.5rem;
  transition: background 0.3s ease;
}
.chapter-nav a:hover {
  background: rgba(28, 27, 25, 0.03);
}
.chapter-nav .dir {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #8a857c;
}
.chapter-nav .ttl {
  margin-top: 0.6rem;
  font-family: "Shippori Mincho", serif;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: #1c1b19;
}
.chapter-nav .next {
  text-align: right;
}

/* ---------------------------------------------------------
   教材トップ：STEPカード
   --------------------------------------------------------- */
.step-block + .step-block {
  margin-top: 4.5rem;
}
.step-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
}
.step-head .no {
  font-family: "Shippori Mincho", serif;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: #b6502a;
  white-space: nowrap;
}
.step-head .name {
  font-family: "Shippori Mincho", serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}
.lesson-row {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid rgba(28, 27, 25, 0.12);
  transition: padding-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.lesson-row:last-child {
  border-bottom: 1px solid rgba(28, 27, 25, 0.12);
}
a.lesson-row:hover {
  padding-left: 0.75rem;
}
.lesson-row .ln {
  flex-shrink: 0;
  font-family: "Shippori Mincho", serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #8a857c;
}
.lesson-row .lt {
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}
.lesson-row .ld {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 300;
  color: #8a857c;
}
.lesson-row .arrow {
  margin-left: auto;
  color: #b6502a;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
a.lesson-row:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}
.lesson-row.soon {
  opacity: 0.45;
}
.lesson-row.soon .badge {
  margin-left: auto;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a857c;
}
