/* ==========================================================================
   こどもマニフェスト「絵の中を旅する」（2026-10-08）
   - 絵（グラフィックレコーディング）を固定して表示し、スクロールで各チームの場所へズームする
   - スマホ・タブレット: 絵が上（ヘッダーの下に固定）、文が下を流れる
   - PC（1024px 以上）: 絵が左（固定）、文が右
   - 動きは js/manifesto.js。JS が動くと .s-manifesto__tour に .is-ready が付く
   ========================================================================== */

.s-manifesto {
  --mf-bg: #FFF6D6;                        /* 淡い黄色（絵の黄色に合わせる） */
  --mf-head: var(--header-height-sp);      /* 固定ヘッダーの高さ */
  --mf-line: var(--color-base-dark);
  position: relative;
  background-color: var(--mf-bg);
  padding-block: var(--sp-64) var(--sp-80);
}
@media (min-width: 1200px) {
  .s-manifesto { --mf-head: var(--header-height); }
}

.s-manifesto__inner {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-inline: var(--container-px-sp);
}

.s-manifesto__lead {
  max-width: 40em;
  margin: var(--sp-24) auto 0;
  line-height: 1.9;
  text-align: center;
}
.s-manifesto__leadBr { display: none; }
@media (min-width: 768px) {
  .s-manifesto__leadBr { display: inline; }
}

/* ---- 旅の全体 ---- */
.s-manifesto__tour {
  position: relative;
  margin-top: var(--sp-40);
}

/* ---- 絵（ステージ） ---- */
.s-manifesto__stageWrap {
  position: sticky;
  top: calc(var(--mf-head) + 8px);
  z-index: 2;
}
.s-manifesto__stage {
  position: relative;
  height: clamp(240px, 42svh, 420px);
  overflow: hidden;
  background-color: #fff;
  border: 2px solid var(--mf-line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(26, 26, 26, 0.12);
}
@media (min-width: 768px) {
  .s-manifesto__stage { height: clamp(300px, 46svh, 480px); }
}

/* JS が動く前・動かないとき: 絵全体を枠に収める */
.s-manifesto__canvas {
  width: 100%;
  height: 100%;
}
.s-manifesto__canvas img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* JS が動いたら: 絵を元の大きさで置き、拡大・移動はすべて transform で行う */
.s-manifesto__tour.is-ready .s-manifesto__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1516px;
  height: 3192px;
  transform-origin: 0 0;
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}
.s-manifesto__tour.is-ready .s-manifesto__canvas img {
  object-fit: fill;
}

/* いま見ているチームの札（絵の左上） */
.s-manifesto__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  margin: 0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background-color: var(--mf-line);
  color: #fff;
  font-size: 12px;
  font-weight: var(--fw-bold);
  line-height: 1.6;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.s-manifesto__badge.is-shown {
  opacity: 1;
  transform: none;
}

/* ---- 文（ステップ） ---- */
.s-manifesto__steps {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}
.s-manifesto__step {
  display: flex;
  align-items: flex-start;
  min-height: 72svh;
  padding-block: var(--sp-24);
}
.s-manifesto__step--intro {
  min-height: 34svh;
  justify-content: center;
}
.s-manifesto__step--outro {
  min-height: 0;
  padding-bottom: 0;
}
@media (min-width: 768px) {
  .s-manifesto__step { justify-content: center; }
}

/* はじめ: タイトル画像を大きく＋「スクロールしてね」の下向き矢印（2026-10-08） */
.s-manifesto__introCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.s-manifesto__titleImg {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
}
/* 「次へ」ボタン（2026-10-15 市川さん指示）: 丸い背景に下向きの矢印。押すと次のカードへ移る。
   はじめのタイトルの下と、各カードの下の端に置く（動きは js/manifesto.js） */
.s-manifesto__next {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: var(--sp-24) auto 0;
  border-radius: 50%;
  background-color: var(--color-accent1);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(229, 0, 18, 0.28);
  transition: transform var(--ease-fast), box-shadow var(--ease-fast);
}
.s-manifesto__next:hover {
  transform: translateY(3px);
  box-shadow: 0 2px 8px rgba(229, 0, 18, 0.28);
  text-decoration: none;
}
.s-manifesto__next:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}
.s-manifesto__next i { margin-top: 2px; }   /* 矢印の見た目の重心を円の中央に */
/* はじめのタイトルの下のボタンは、ふわふわ動かして「下に続く」ことを知らせる（以前の矢印と同じ動き） */
.s-manifesto__introCard .s-manifesto__next {
  margin-top: var(--sp-16);
  animation: mf-bounce 1.6s ease-in-out infinite;
}
.s-manifesto__introCard .s-manifesto__next:hover { animation-play-state: paused; }
@keyframes mf-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
/* 「次へ」で移ってきたカード・注意書きに、キーボードで移ったときだけ枠を出す */
.s-manifesto__card:focus,
.s-manifesto__note:focus { outline: none; }
.s-manifesto__card:focus-visible,
.s-manifesto__note:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 4px;
}

/* チームのカード */
.s-manifesto__card {
  width: 100%;
  max-width: 640px;
  padding: var(--sp-24) 20px;
  background-color: #fff;
  border: 2px solid var(--mf-line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(26, 26, 26, 0.08);
}
/* JS が動いているときは、いまのチーム以外を少し薄くする */
.s-manifesto__tour.is-ready .s-manifesto__card {
  opacity: 0.4;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.s-manifesto__tour.is-ready .s-manifesto__step.is-active .s-manifesto__card {
  opacity: 1;
  transform: none;
}

/* チーム名（絵の旗のような形） */
.s-manifesto__team {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--sp-16);
  padding: 6px 26px 6px 8px;
  background-color: var(--color-primary);
  color: var(--color-base-dark);
  font-size: 16px;
  font-weight: var(--fw-black);
  line-height: 1.5;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%);
}
.s-manifesto__teamNum {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--mf-line);
  color: #fff;
  font-size: 13px;
  font-weight: var(--fw-bold);
}

/* チームの絵（JS が動かないとき・動きを減らす設定のときだけ出す） */
.s-manifesto__thumb {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto var(--sp-16);
}
.s-manifesto__tour.is-ready .s-manifesto__thumb { display: none; }

/* 項目の見出し（丸いラベル） */
.s-manifesto__label {
  display: inline-block;
  margin: 0;
  padding: 2px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: var(--fw-bold);
  line-height: 1.7;
  letter-spacing: 0.04em;
}
.s-manifesto__label--proposal { background-color: var(--color-accent1); color: #fff; }
.s-manifesto__label--reason   { background-color: var(--color-accent2); color: #fff; }
.s-manifesto__label--method   { background-color: var(--mf-line); color: #fff; }
.s-manifesto__label--future   { background-color: var(--color-primary); color: var(--color-base-dark); }

/* 提案（いちばん大きく。黄色のマーカー） */
.s-manifesto__proposal {
  margin: var(--sp-8) 0 var(--sp-16);
  font-size: 20px;
  font-weight: var(--fw-black);
  line-height: 1.6;
}
.s-manifesto__proposalText {
  background-image: linear-gradient(transparent 64%, rgba(255, 193, 0, 0.55) 64%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.s-manifesto__items {
  display: grid;
  gap: var(--sp-16);
  margin: var(--sp-8) 0 0;
}
.s-manifesto__text {
  margin: 6px 0 0;
  line-height: 1.85;
}
.s-manifesto__methods {
  margin: 0;
  padding-left: 1.3em;
}
.s-manifesto__methods li + li { margin-top: 4px; }

.s-manifesto__item--future {
  padding: 12px 14px;
  border-radius: 12px;
  background-color: var(--mf-bg);
}
.s-manifesto__future { font-weight: var(--fw-bold); }

/* 最後の注意書き */
.s-manifesto__note {
  width: 100%;
  max-width: 640px;
  margin: var(--sp-24) auto 0;
  padding: 14px 16px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.75);
  color: rgba(26, 26, 26, 0.8);
  font-size: var(--fs-caption);
  line-height: 1.8;
}
.s-manifesto__note p { margin: 0; }
.s-manifesto__note p + p { margin-top: 6px; }

/* ---- PC: 絵を左、文を右 ---- */
@media (min-width: 1024px) {
  .s-manifesto { padding-block: var(--sp-96); }
  .s-manifesto__tour {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--sp-48);
    align-items: start;
    margin-top: var(--sp-48);
  }
  .s-manifesto__stageWrap {
    top: calc(var(--mf-head) + 24px);
    align-self: start;
  }
  .s-manifesto__stage {
    height: calc(100vh - var(--mf-head) - 48px);
    min-height: 480px;
    max-height: 760px;
  }
  .s-manifesto__step {
    min-height: 88vh;
    align-items: center;
    padding-block: var(--sp-40);
  }
  .s-manifesto__step--intro { min-height: 56vh; }
  .s-manifesto__step--outro { min-height: 0; }
  .s-manifesto__card { padding: var(--sp-32); }
  .s-manifesto__proposal { font-size: 24px; }
  .s-manifesto__note { margin-top: 0; }
}

/* ---- 動きを減らす設定 ---- */
@media (prefers-reduced-motion: reduce) {
  .s-manifesto__tour.is-ready .s-manifesto__canvas,
  .s-manifesto__tour.is-ready .s-manifesto__card,
  .s-manifesto__badge { transition: none; }
  .s-manifesto__introCard .s-manifesto__next { animation: none; }
  .s-manifesto__next { transition: none; }
}
