/* =========================================================
   出張ロードマップ　スライド表示・図解 専用スタイル
   ※ roadmap.css の後に読み込みます
   ========================================================= */

/* ---------------------------------------------------------
   表示モードの切り替え
   --------------------------------------------------------- */
.rm-reader[data-mode='doc'] .rm-slides { display: none; }
.rm-reader[data-mode='slide'] .rm-reader__body { display: none; }

.rm-slides {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% 0%, #ffffff 0%, var(--ivory-50) 60%, var(--ivory-100) 100%);
}

.rm-slide-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.4vw, 30px);
  cursor: pointer;
  outline: 0;
  overflow-y: auto;
}

.rm-slide {
  position: relative;
  width: 100%;
  max-width: 720px;
  min-height: min(420px, 58vh);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 3.4vw, 44px) clamp(22px, 3.4vw, 46px) 46px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  animation: rmSlideIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes rmSlideIn { from { opacity: 0; transform: translateY(10px); } }

.rm-slide__page {
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ---- 表紙 ---- */
.rm-slide__cover { text-align: center; }
.rm-slide__eyebrow {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--gold-700);
}
.rm-slide__cover h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
  line-height: 1.4;
  color: var(--green-900);
  letter-spacing: 0.03em;
}
.rm-slide__sub { margin: 0 0 4px; font-size: 0.98rem; color: var(--muted); }
.rm-slide__note {
  margin: 16px auto 0;
  max-width: 34em;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--gold-100);
  font-size: 0.82rem;
  line-height: 1.8;
  color: #6a4708;
  text-align: left;
}
.rm-slide__hint { margin: 22px 0 0; font-size: 0.76rem; color: var(--muted); }

/* ---- 章の区切り ---- */
.rm-slide__section { text-align: center; }
.rm-slide__section h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--green-900);
  line-height: 1.5;
  letter-spacing: 0.03em;
}
.rm-slide__section h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  margin: 18px auto 0;
  border-radius: 99px;
  background: var(--gold-500);
}

/* ---- 本文スライド ---- */
.rm-slide__label {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold-500);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--green-800);
  letter-spacing: 0.03em;
}
.rm-slide__body {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.95;
  color: #24312b;
}
.rm-slide__body.is-dense { font-size: 0.95rem; line-height: 1.8; }
.rm-slide__body p { margin: 0 0 0.8em; }
.rm-slide__body p:last-child { margin-bottom: 0; }
.rm-slide__body h2,
.rm-slide__body h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--green-900);
  margin: 0 0 0.6em;
  border: 0;
  padding: 0;
}
.rm-slide__body h4 {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--gold-700);
  margin: 1em 0 0.4em;
}
.rm-slide__body h4:first-child { margin-top: 0; }
.rm-slide__body .rm-doc__li {
  margin: 0 0 0.4em;
  padding-left: 1.2em;
  text-indent: -1.2em;
}
.rm-slide__body .rm-doc__quote {
  margin: 0 0 0.7em;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--gold-500);
  color: #3a4a41;
}
.rm-slide__body .rm-doc__tagline { color: var(--muted); font-size: 0.92em; }

.rm-slide__figure { width: 100%; }
.rm-slide__figure .rm-fig { margin: 0; }

/* ---- ナビゲーション ---- */
.rm-slide-nav {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
}
.rm-slide-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-800);
  cursor: pointer;
  transition: all 0.16s ease;
}
.rm-slide-btn:hover:not(:disabled) {
  background: var(--green-800);
  border-color: var(--green-800);
  color: #fff;
}
.rm-slide-btn:disabled { opacity: 0.3; cursor: default; }
.rm-slide-btn svg { width: 19px; height: 19px; }
.rm-slide-count { font-size: 0.85rem; color: var(--muted); min-width: 66px; text-align: center; }
.rm-slide-count b { color: var(--green-900); font-size: 1.05rem; }

.rm-slide-progress { flex: none; height: 3px; background: rgba(31, 91, 65, 0.1); }
.rm-slide-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green-700), var(--gold-500));
  transition: width 0.28s ease;
}

/* =========================================================
   図解
   ========================================================= */
.rm-fig {
  margin: 26px 0;
  padding: 20px clamp(14px, 2.4vw, 24px);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #ffffff 0%, var(--green-50) 100%);
  border: 1px solid var(--line);
  font-family: var(--font-sans);
}
.rm-fig__title {
  margin: 0 0 16px;
  text-align: center;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--green-900);
  letter-spacing: 0.04em;
}
.rm-fig__title::after {
  content: '';
  display: block;
  width: 34px;
  height: 2px;
  margin: 9px auto 0;
  background: var(--gold-500);
  border-radius: 99px;
}
.rm-fig__caption {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.79rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ---- flow：順番に進むステップ ---- */
.rm-fig__flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.rm-fig__step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
}
.rm-fig__step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 28px;
  bottom: -9px;
  width: 2px;
  height: 9px;
  background: var(--gold-500);
}
.rm-fig__num {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-800);
  color: var(--gold-100);
  font-size: 0.8rem;
  font-weight: 800;
}
.rm-fig__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rm-fig__body strong { font-size: 0.94rem; color: var(--green-900); }
.rm-fig__body span { font-size: 0.82rem; line-height: 1.75; color: var(--muted); }

/* ---- layers：深さのある層構造 ---- */
.rm-fig__layers { display: grid; gap: 7px; }
.rm-fig__layer {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  margin-left: calc(var(--d) * 13px);
  border-left: 4px solid var(--green-700);
}
.rm-fig__layer:nth-child(2) { border-left-color: #3f8a68; }
.rm-fig__layer:nth-child(3) { border-left-color: var(--gold-700); }
.rm-fig__layer:nth-child(4) { border-left-color: var(--gold-500); }
.rm-fig__layer-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rm-fig__layer-head strong { font-size: 0.94rem; color: var(--green-900); }
.rm-fig__layer-head em {
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold-700);
}
.rm-fig__layer-desc {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--muted);
}
.rm-fig__axis {
  margin: 10px 0 0;
  padding-left: 4px;
  font-size: 0.74rem;
  color: var(--gold-700);
  letter-spacing: 0.04em;
}

/* ---- cards：並列にならぶ要素 ---- */
.rm-fig__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.rm-fig__card {
  position: relative;
  padding: 18px 14px 13px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rm-fig__badge {
  position: absolute;
  top: -11px;
  left: 13px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-500);
  color: #3a2500;
  font-size: 0.74rem;
  font-weight: 800;
}
.rm-fig__card strong { font-size: 0.9rem; color: var(--green-900); }
.rm-fig__card span { font-size: 0.8rem; line-height: 1.7; color: var(--muted); }

/* ---- compare：良い例／悪い例 ---- */
.rm-fig__compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 11px;
}
.rm-fig__side {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green-700);
}
.rm-fig__side--bad { border-top-color: #c2604f; }
.rm-fig__side strong { display: block; margin-bottom: 8px; font-size: 0.9rem; color: var(--green-900); }
.rm-fig__side--bad strong { color: #9d3f30; }
.rm-fig__side ul { margin: 0; padding-left: 1.1em; }
.rm-fig__side li { font-size: 0.82rem; line-height: 1.8; color: var(--muted); }

/* ---- matrix：表 ---- */
.rm-fig__tablewrap { overflow-x: auto; }
.rm-fig__matrix {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.84rem;
  min-width: 320px;
}
.rm-fig__matrix th,
.rm-fig__matrix td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
  line-height: 1.7;
  vertical-align: top;
}
.rm-fig__matrix thead th {
  background: var(--green-800);
  color: var(--gold-100);
  font-weight: 700;
  white-space: nowrap;
}
.rm-fig__matrix tbody th {
  background: var(--green-50);
  color: var(--green-900);
  font-weight: 700;
  white-space: nowrap;
}

/* 文書表示の副題行 */
.rm-doc__tagline {
  margin: -0.4em 0 1.2em;
  color: var(--muted);
  font-size: 0.94em;
}

/* 図解を持つ本の印 */
.rm-book.has-fig .rm-book__tag::after { content: ' \25C6'; color: var(--gold-500); }

@media (max-width: 640px) {
  .rm-slide { min-height: 0; padding: 22px 18px 40px; }
  .rm-slide__body { font-size: 0.98rem; }
  .rm-fig__layer { margin-left: 0; }
  .rm-slide-nav { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .rm-slide { animation: none; }
  .rm-slide-progress span { transition: none; }
}
