/*
 * プログラミングコースのカリキュラム紹介（docs/programming/*.html）
 *
 * ページの部品は yorimichi.css を流用する。ここではテーマ色と、このページ群だけの調整を書く。
 * <body class="page-yorimichi page-programming theme-◯◯">
 */
.theme-cs {
  --ym-bg: #fffaf4;
  --ym-bg-2: #fdf2e6;
  --ym-line: #f3dfc8;
  --ym-accent: #b85e00;
  --ym-accent-glow: #ffa64d;
  --ym-accent-soft: #fde9d3;
  --ym-chip: #fff5ea;
  --ym-shadow: rgba(120, 70, 10, 0.07);
}

.theme-data-science {
  --ym-bg: #f5fbfa;
  --ym-bg-2: #e9f6f3;
  --ym-line: #cfe8e3;
  --ym-accent: #0b7a6c;
  --ym-accent-glow: #3fd1bd;
  --ym-accent-soft: #dcf3ee;
  --ym-chip: #eef8f6;
  --ym-shadow: rgba(10, 80, 70, 0.07);
}

.theme-kyopro {
  --ym-bg: #f7f8fd;
  --ym-bg-2: #eceffa;
  --ym-line: #d9def3;
  --ym-accent: #3949ab;
  --ym-accent-glow: #7f8cff;
  --ym-accent-soft: #e3e7fb;
  --ym-chip: #f1f3fc;
  --ym-shadow: rgba(30, 40, 110, 0.07);
}

.theme-mod {
  --ym-bg: #f7fbf4;
  --ym-bg-2: #edf6e6;
  --ym-line: #d8eacb;
  --ym-accent: #3f8a12;
  --ym-accent-glow: #8fe05a;
  --ym-accent-soft: #e6f4da;
  --ym-chip: #f1f8eb;
  --ym-shadow: rgba(40, 90, 20, 0.07);
}

/* 背景画像なしのヒーロー */
.page-programming .ym-hero {
  min-height: 0;
  padding: 150px 0 88px;
  background-image:
    linear-gradient(var(--ym-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ym-line) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* 範囲や2つ分の番号（02・04、17・18 など） */
.ym-pno.ym-pno-wide {
  width: auto;
  min-width: 2ch;
  font-size: 1.05rem;
  white-space: nowrap;
}

/* ほかの道のカードは ym-section の中で中央にそろえる */
.page-programming .prog-tracks {
  max-width: 880px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------
 * 実際の教材から（画像・コードと説明を左右に並べる）
 * ------------------------------------------------------------- */
.prog-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto 64px;
}

.prog-showcase:last-child {
  margin-bottom: 0;
}

.prog-showcase--rev .prog-showcase-media {
  order: 2;
}

.prog-showcase-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ym-accent);
  background: var(--ym-accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

.prog-showcase-text h3 {
  font-size: 1.3rem;
  line-height: 1.5;
  margin: 0 0 12px;
  color: var(--ym-text);
}

.prog-showcase-text p {
  color: var(--ym-sub);
  line-height: 1.9;
  margin: 0;
}

.prog-shot {
  margin: 0;
}

.prog-shot img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 440px;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--ym-line);
  background: #fff;
  box-shadow: 0 12px 32px var(--ym-shadow);
}

.prog-shot--pair {
  display: grid;
  grid-template-columns: 0.42fr 0.58fr;
  gap: 12px;
  align-items: end;
}

.prog-shot--pair figcaption {
  grid-column: 1 / -1;
}

.prog-shot figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ym-muted);
  text-align: center;
}

/* エディタ風のコード画面 */
.ym-code.prog-editor {
  max-width: none;
  margin: 20px 0 0;
  background: #1f2430;
  border: 0;
  box-shadow: 0 16px 36px rgba(15, 20, 35, 0.25);
}

.prog-showcase-media > .prog-editor {
  margin-top: 0;
}

.prog-editor .ym-code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #171b24;
  border-bottom: 1px solid #2c3242;
  color: #9aa3b5;
  font-family: var(--ym-mono);
}

.prog-editor-dots {
  display: inline-flex;
  gap: 6px;
}

.prog-editor-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.prog-editor-dots i:nth-child(2) {
  background: #febc2e;
}

.prog-editor-dots i:nth-child(3) {
  background: #28c840;
}

.prog-editor pre {
  color: #e6e9ef;
  font-size: 0.8rem;
  line-height: 1.65;
  max-height: 460px;
}

.prog-editor .c {
  color: #7f8aa3;
}

.prog-editor .s {
  color: #a6e3a1;
}

.prog-editor .k {
  color: #f5a97f;
}

/* ---------------------------------------------------------------
 * この力が使われている場所
 * ------------------------------------------------------------- */
.prog-uses {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.prog-use {
  background: var(--ym-panel);
  border: 1px solid var(--ym-line);
  border-radius: 14px;
  padding: 22px 20px;
}

.prog-use-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--ym-accent-soft);
  color: var(--ym-accent);
  margin-bottom: 14px;
}

.prog-use-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prog-use h3 {
  font-size: 1.02rem;
  margin: 0 0 8px;
  color: var(--ym-text);
}

.prog-use p {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--ym-sub);
  margin: 0;
}

@media (max-width: 900px) {
  .prog-uses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .prog-showcase {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 48px;
  }

  .prog-showcase--rev .prog-showcase-media {
    order: 0;
  }
}

@media (max-width: 480px) {
  .prog-uses {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 画像を2枚並べる行は、画像の列を広めにとる */
.prog-showcase:has(.prog-shot--pair) {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

@media (max-width: 768px) {
  .prog-showcase:has(.prog-shot--pair) {
    grid-template-columns: minmax(0, 1fr);
  }
}
