/* ============================================================
   実例 — 顧客案件を CCAGI で作る型
   example.html 専用。トークンは styles.css の :root を使う。
   ============================================================ */

/* ---------- ヒーロー ---------- */

.ex-hero { max-width: 760px; }
.ex-hero .hero-lede { display: block; max-width: 660px; margin-bottom: 24px; }

.ex-meta {
  display: flex; flex-wrap: wrap;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
}
.ex-meta > div {
  flex: 1 1 180px;
  padding: 10px 16px 10px 0;
}
.ex-meta > div + div { border-left: 1px solid var(--hairline); padding-left: 16px; }
.ex-meta dt { font-size: 11px; letter-spacing: 0.12em; color: var(--ink-2); }
.ex-meta dd { font-size: 14px; font-weight: 600; line-height: 1.6; }
.ex-meta dd .ex-meta-mono { font-family: var(--font-mono); font-size: 13px; font-weight: 400; }

/* ---------- 全体図: 二つのレーン ---------- */

.ex-split {
  display: grid;
  grid-template-columns: 1fr 96px 1fr;
  align-items: stretch;
  border: 1px solid var(--ink);
  background: var(--paper-2);
}

.ex-lane { padding: 20px 22px 22px; }

.ex-lane-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ex-lane-mark {
  width: 12px; height: 12px; flex: none;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: var(--lane);
}
.ex-lane-name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--lane);
}
.ex-lane-sub { font-size: 12px; color: var(--ink-2); }

.ex-lane-items { list-style: none; margin-top: 14px; }
.ex-lane-items li {
  position: relative;
  padding: 8px 0 8px 20px;
  font-size: 14px; line-height: 1.7;
  border-bottom: 1px solid var(--hairline);
}
.ex-lane-items li:last-child { border-bottom: none; }
.ex-lane-items li::before {
  content: "";
  position: absolute; left: 2px; top: 17px;
  width: 8px; height: 8px;
  background: var(--lane);
}
.ex-lane-items li b { font-weight: 600; }

.ex-lane-foot {
  margin-top: 14px;
  font-size: 12.5px; line-height: 1.8;
  border-left: 3px solid var(--lane);
  padding-left: 10px;
  color: var(--ink-2);
}

.ex-lane-human { --lane: var(--room-check); }
.ex-lane-ai {
  --lane: var(--room-make);
  background: var(--paper);
}

/* 受け渡しの列 */
.ex-handoff {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  padding: 20px 0;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  background: var(--paper-deep);
}
.ex-handoff p {
  font-size: 11.5px; line-height: 1.6; text-align: center;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.ex-handoff svg { display: block; }

/* ---------- 全体図: 担当の帯 (0〜9) ---------- */

.ex-strip-caption {
  font-size: 12px; letter-spacing: 0.08em; color: var(--ink-2);
  margin: 32px 0 10px;
}

.ex-strip {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1px;
  border: 1px solid var(--ink);
  background: var(--ink);
}
.ex-strip li { display: flex; }
.ex-strip a {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 8px 12px;
  text-decoration: none;
  background: var(--paper);
  color: var(--ink);
  border-top: 4px solid var(--lane);
}
.ex-strip a:hover { background: var(--lane); color: #FFFFFF; }
.ex-strip a:hover .ex-strip-label { color: rgba(255, 255, 255, 0.9); }
.ex-strip-no {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; line-height: 1;
  color: var(--lane);
}
.ex-strip a:hover .ex-strip-no { color: #FFFFFF; }
.ex-strip-label { font-size: 11px; line-height: 1.45; color: var(--ink-2); }
.ex-strip .is-human { --lane: var(--room-check); }
.ex-strip .is-ai { --lane: var(--room-make); }

.ex-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px; color: var(--ink-2);
}
.ex-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ex-legend i {
  display: inline-block;
  width: 14px; height: 6px; flex: none;
  background: var(--lane);
}
.ex-legend .lg-human { --lane: var(--room-check); }
.ex-legend .lg-ai { --lane: var(--room-make); }

/* ---------- タイムライン (0〜9) ---------- */

.ex-timeline { list-style: none; position: relative; }

.ex-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 72px;
}
.ex-step:last-child { border-bottom: none; }

.ex-step-mark { position: relative; }
.ex-step-no {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600; line-height: 1;
  color: #FFFFFF;
  background: var(--lane);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
/* 縦の導線 */
.ex-step-mark::after {
  content: "";
  position: absolute;
  left: 21px; top: 52px; bottom: -40px;
  width: 1px;
  background: var(--hairline);
}
.ex-step:last-child .ex-step-mark::after { display: none; }

.ex-step.is-human { --lane: var(--room-check); }
.ex-step.is-ai { --lane: var(--room-make); }

.ex-step-body { min-width: 0; }

.ex-step-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ex-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: #FFFFFF; background: var(--lane);
  padding: 2px 10px;
  border-radius: 2px;
  white-space: nowrap;
}
.ex-phase-tag {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-2);
  border: 1px solid var(--hairline);
  padding: 1px 8px;
  white-space: nowrap;
}

.ex-step-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: 0.03em;
  line-height: 1.4;
  margin-bottom: 10px;
}
.ex-step-body p { max-width: 660px; font-size: 14.5px; margin-bottom: 10px; }
.ex-step-body p:last-child { margin-bottom: 0; }
.ex-step-body code { font-size: 13px; background: var(--paper-2); border: 1px solid var(--hairline); padding: 0 5px; }

.ex-step-body .ex-substep {
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--ink-2);
  margin: 18px 0 6px;
}

.ex-step-body .ex-caution {
  max-width: 660px;
  font-size: 13px; line-height: 1.85;
  border-left: 3px solid var(--stamp);
  background: var(--paper-2);
  padding: 8px 12px;
  margin: 0 0 14px;
}
.ex-caution b { color: var(--stamp); }

/* 顧客に言う言葉 */
.ex-quote {
  max-width: 660px;
  border-left: 3px solid var(--lane, var(--ink));
  padding: 4px 0 4px 14px;
  margin: 4px 0 16px;
}
.ex-quote p {
  font-family: var(--font-display);
  font-size: 17px; line-height: 1.75;
}
.ex-quote .ex-quote-src {
  font-family: var(--font-ui);
  font-size: 11.5px; line-height: 1.7;
  color: var(--ink-2);
  margin: 4px 0 0;
}

/* ---------- コードブロック ---------- */

.ex-code {
  max-width: 660px;
  margin: 6px 0 16px;
  border: 1px solid var(--hairline);
  background: var(--paper-2);
}
.ex-code-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px 7px 12px;
  border-bottom: 1px solid var(--hairline);
}
.ex-code-label {
  font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-2);
  margin-right: auto;
}
.ex-copy {
  background: none;
  border: 1px solid var(--ink-2);
  border-radius: 2px;
  font-size: 12px; font-weight: 600;
  padding: 3px 12px;
  white-space: nowrap;
}
.ex-copy:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ex-copy-status {
  font-size: 11.5px; font-weight: 600; color: var(--room-ship);
  flex-basis: 100%;
}
.ex-copy-status:empty { display: none; }
.ex-copy-status.is-manual { color: var(--stamp); }

.ex-code-pre {
  background: var(--ink);
  color: #EFE7D6;
  font-size: 13.5px; line-height: 1.9;
  padding: 14px 18px;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
.ex-code-pre code { color: inherit; background: none; border: none; padding: 0; }
/* 長い日本語1行は折り返す(改行位置は原文のまま) */
.ex-code-pre.is-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.ex-code-pre::selection, .ex-code-pre code::selection { background: var(--stamp); color: #FFFFFF; }

/* ---------- 読みどころの注釈 ---------- */

.ex-note-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .ex-note-grid { grid-template-columns: 1fr 1fr; }
}
.ex-note-card {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-left: 5px solid var(--stamp);
  padding: 18px 20px 20px;
}
/* 図版番号(.plate-no)と同じ活版の印の作り。白抜きだと明朝の細い画が沈むため陽字 */
.ex-note-num {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--stamp);
  border: 1px solid var(--stamp);
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.ex-note-card h3 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; line-height: 1.5;
  margin-bottom: 8px;
}
.ex-note-card p { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }
.ex-note-card code {
  font-size: 12.5px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--hairline); padding: 0 5px;
}

/* ---------- 導線 ---------- */

.ex-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.ex-next a {
  display: block;
  background: var(--paper-2);
  padding: 20px 22px 22px;
  text-decoration: none;
}
.ex-next a:hover { background: #F2EBDC; }
.ex-next-label { font-size: 11.5px; letter-spacing: 0.1em; color: var(--ink-2); }
.ex-next-title {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; letter-spacing: 0.03em;
  margin: 4px 0 6px;
  border-bottom: 1px solid var(--ink);
  display: inline-block;
  padding-bottom: 2px;
}
.ex-next a:hover .ex-next-title { color: var(--stamp); border-bottom-color: var(--stamp); }
.ex-next .ex-next-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.8; }

/* ---------- 出典 ---------- */

.ex-source { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.ex-source a { word-break: break-all; }

/* ---------- レスポンシブ ---------- */

@media (max-width: 900px) {
  .ex-split { grid-template-columns: 1fr; }
  .ex-lane-ai { border-left: none; border-top: 1px solid var(--hairline); }
  .ex-handoff {
    flex-direction: row;
    gap: 14px;
    padding: 10px 16px;
    border-left: none; border-right: none;
    border-top: 1px solid var(--hairline);
  }
  .ex-handoff p { text-align: left; }
  .ex-handoff svg { transform: rotate(-90deg); }

  .ex-strip { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 640px) {
  .ex-step { grid-template-columns: 1fr; gap: 12px; padding: 24px 0 26px; }
  .ex-step-mark { display: flex; align-items: center; }
  .ex-step-mark::after { display: none; }
  .ex-step-no { width: 36px; height: 36px; font-size: 17px; }
  .ex-step-title { font-size: 19px; }

  .ex-meta > div { flex: 1 1 100%; padding-right: 0; }
  .ex-meta > div + div { border-left: none; border-top: 1px solid var(--hairline); padding-left: 0; }
}

@media (max-width: 640px) {
  /* 画面が狭いときは横スクロールさせず折り返す */
  .ex-code-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}

@media (max-width: 420px) {
  .ex-strip { grid-template-columns: repeat(2, 1fr); }
  .ex-lane { padding: 16px 16px 18px; }
  .ex-code-pre { font-size: 12.5px; padding: 12px 14px; }
}
