/* =========================================================================
   政策ページ — Instagram のストーリー風
   =========================================================================
   実物に寄せた仕様（2026 年時点）:
     ・写真 1 枚あたり約 5 秒で自動的に次へ
     ・上部に本数ぶんに割った進捗ゲージ
     ・画面の右 1/3 をタップで次へ、左 1/3 で前へ
     ・押しっぱなしで一時停止（そのあいだは上下の飾りを引っ込める）
     ・左右のスワイプでも送れる
     ・上に名前と投稿からの経過時間、下にメッセージ欄とハートと共有

   自動で進む見せ物は、止める手立てを用意しないと WCAG 2.2.2 を満たせない。
   長押しは知っている人にしか分からないので、ヘッダーに停止ボタンも置き、
   動きを減らす設定の環境では最初から自動送りをしない。
   ========================================================================= */

body[data-page="policy"] {
  overflow: hidden;
  overscroll-behavior: none;
}

.story {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--column);
  top: var(--header-h);
  /* ホーム画面に追加（standalone）だと、下ナビが safe-area ぶん高くなる。
     その safe-area を足しておかないと、下端のメッセージ欄・ハート・シェアが
     ナビに潜って触れなくなる（発注者報告 2026-08-30）。ブラウザでは 0 */
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 40;
  background: #eef3f9;
  overflow: hidden;
  isolation: isolate;
}

/* --- 横に並べた 1 枚ずつ ------------------------------------------------ */

/* JavaScript が動かない環境では、この横並び＋スナップのまま指で送れる */
.story__track {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.story__track::-webkit-scrollbar { display: none; }

.slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr;
}

/* JavaScript が動くときは、スライドを重ねて置き、位置は JS が持つ。
   スクロールとスナップはやめる。回転のために transform を掛けると、
   ブラウザがスナップの目印にしている「変形後の箱」が動いてしまい、
   どこが 1 枚分か分からなくなって、指を離したあと半端な位置で
   止まることがあったため。 */
.story__track.is-live {
  display: block;
  overflow: hidden;
  scroll-snap-type: none;
  perspective: 1100px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
}

.story__track.is-live .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  flex: none;
  backface-visibility: hidden;
  will-change: transform;
}

/* 回している最中だけ、奥行きの手前側を少し暗くして立体に見せる */
.story__track.is-cube .slide::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(11, 29, 56, .16);
  opacity: 0;
}

/* 写真が届くまでのあいだ、ここには HTML に埋め込んだ
   20px のぼかし（下地）が敷かれている。真っ白のまま文字だけが
   浮くのを防ぐためのもの。本物が乗ると自然に隠れる。 */
.slide__photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-size: cover;
  background-position: 50% 45%;
  background-repeat: no-repeat;
}

.slide__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  transform: scale(1.05);
  filter: saturate(1.1) brightness(1.05);
}

/* 写真の上に白いベールを敷く。上下を濃いめにして、名前や
   メッセージ欄が写真の明るいところに乗っても読めるようにする。
   中ほどは薄くして、写真そのものはちゃんと見えるままにしてある。 */
.slide__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .86) 0%,
    rgba(255, 255, 255, .48) 18%,
    rgba(255, 255, 255, .34) 46%,
    rgba(255, 255, 255, .56) 76%,
    rgba(255, 255, 255, .86) 100%);
}

.slide__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(7px, 1.8vh, 15px);
  padding: clamp(58px, 9vh, 78px) clamp(18px, 5.5vw, 26px) clamp(72px, 11vh, 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  /* 中が縦に送れる箱（overflow-y: auto）は、ブラウザにとって「指の動きを受け持つ箱」になる。
     touch-action の制限は、その箱の手前で切れるので、track の pan-y が効かず、横になぞると
     ブラウザが受け持って pointercancel を出し、横スワイプが効かなかった（発注者報告 2026-10-05
     「横にしたとき政策のページの横スライドが効かない」。iPhone は中身があふれた箱だけをそう扱う
     ので、あふれやすい横向きで出た。Chromium は縦持ちでも同じ）。箱にも pan-y を付け、縦は
     ブラウザ（箱の中を送る）、横は js/story.js（次の枚へ）と分ける */
  touch-action: pan-y;
}

.slide__body::-webkit-scrollbar { display: none; }

/* --- 文字まわり --------------------------------------------------------- */

/* 章の見出し。金の細い枠に入れて、ストーリーの「タグ」らしく見せる */
.slide__eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--gold-pale);
  border: 1px solid rgba(176, 138, 46, .55);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #533b05;
  box-shadow: 0 2px 10px rgba(11, 29, 56, .12);
}

.slide__h {
  margin: 0;
  color: var(--ink);
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(28px, 8.4vw, 40px);
  font-weight: 800;
  line-height: 1.38;
  letter-spacing: .01em;
  text-shadow: var(--outline-275), 0 1px 14px rgba(255, 255, 255, .95);
}

.slide__h--sans {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 900;
  font-size: clamp(24px, 7vw, 33px);
  line-height: 1.36;
}

/* 見出しの頭に、金の短い線をひと筆入れる */
.slide__h::before {
  content: '';
  display: block;
  width: 42px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #e2c477, rgba(226, 196, 119, 0));
}

/* --- 次のページへ ------------------------------------------------------- */

/* 最後の 1 枚は下に余白が残る。そこから実績とプロフィールへひと跳び
   できるようにして、読み終わりを行き止まりにしない。
   実績ページの締めに置いたボタンと同じ作りにしてある。 */
.slide__go {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: clamp(6px, 1.6vh, 14px);
}

.slide__goBtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* 指で押すものなので、画面が低くても 44px は割らせない */
  box-sizing: border-box;
  min-height: 44px;
  padding: clamp(10px, 1.5vh, 13px) 18px;
  border-radius: 999px;
  background: #13294a;
  color: #ffffff;
  /* いちばん小さい端末でも 10pt（13.34px）を割らない */
  font-size: clamp(13.5px, 3.6vw, 15px);
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(11, 29, 56, .22);
  transition: transform .16s ease, box-shadow .16s ease;
}

/* 2 つ並ぶので、片方は白地にして主従をつける */
.slide__goBtn--sub {
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  border: 1.5px solid rgba(19, 41, 74, .24);
  box-shadow: 0 4px 14px rgba(11, 29, 56, .14);
}

.slide__goBtn span { opacity: .75; font-weight: 700; }
.slide__goBtn:active { transform: scale(.975); box-shadow: 0 2px 8px rgba(11, 29, 56, .18); }

.slide__lead {
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(14px, 3.9vw, 16px);
  font-weight: 600;
  line-height: 1.85;
  text-wrap: pretty;
  text-shadow: var(--outline-15), var(--halo);
}

.slide__quote {
  margin: 0;
  color: var(--ink);
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(22px, 6.4vw, 29px);
  font-weight: 800;
  line-height: 1.75;
}

.slide__by { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--gold-ink); }

/* --- 開いた直後の案内 ----------------------------------------------------
   これがストーリーであること、横に送れることが、見ただけでは
   分からないという声があったので、最初の 2.6 秒だけ案内を出す。
   そのあいだ自動送りは止め、触られたらすぐ引っ込める。      */
.storyGuide {
  position: absolute;
  /* 上の進捗ゲージは覆わない。何本もあることが見えているほうが、
     「ストーリーだ」と伝わる。 */
  top: 26px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
  background: rgba(255, 255, 255, .52);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: opacity .4s ease;
}

.story.is-guiding .storyGuide { opacity: 1; }

.storyGuide__badge {
  padding: 6px 15px;
  border-radius: 999px;
  background: var(--gold-pale);
  border: 1px solid rgba(176, 138, 46, .6);
  color: #5c410a;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .18em;
  box-shadow: 0 3px 12px rgba(11, 29, 56, .18);
}

.storyGuide__row { display: flex; align-items: center; gap: 12px; }

.storyGuide__pill {
  padding: 11px 20px;
  border-radius: 999px;
  background: #0b1d38;
  border: 1px solid rgba(226, 196, 119, .5);
  color: #fff;
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 8px 24px rgba(11, 29, 56, .35);
}

.storyGuide__arrow { display: grid; place-items: center; color: #0b1d38; }
.storyGuide__arrow svg { width: 26px; height: 26px; }

.storyGuide__note {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(11, 29, 56, .14);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(11, 29, 56, .14);
}

/* 矢印は外へ向かって、丸ごと 1 枚は横へ。送れる向きを体で分からせる */
.story.is-guiding .storyGuide__arrow--l { animation: guideL 1.3s ease-in-out 2; }
.story.is-guiding .storyGuide__arrow--r { animation: guideR 1.3s ease-in-out 2; }
.story.is-guiding .story__track { animation: trackNudge 1.3s ease-in-out 2; }

@keyframes guideL {
  0%, 100% { transform: translateX(0); opacity: .5; }
  45%      { transform: translateX(-9px); opacity: 1; }
}

@keyframes guideR {
  0%, 100% { transform: translateX(0); opacity: .5; }
  45%      { transform: translateX(9px); opacity: 1; }
}

@keyframes trackNudge {
  0%, 100% { transform: translateX(0); }
  30%      { transform: translateX(-16px); }
  62%      { transform: translateX(9px); }
}

@media (prefers-reduced-motion: reduce) {
  .story.is-guiding .storyGuide__arrow--l,
  .story.is-guiding .storyGuide__arrow--r,
  .story.is-guiding .story__track { animation: none; }
}

/* --- 本人の言葉の枚 ------------------------------------------------------
   ここだけは写真が主役。本人の言葉を載せる枚なので、顔の上に幕を
   掛けない。上端（名前の行）と下端（言葉とメッセージ欄）にだけ幕を
   置き、そのあいだは素の写真のまま見せる。言葉は下へ寄せる。      */
#p02d .slide__photo img { filter: none; }

#p02d .slide__photo::after {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .58) 0%,
    rgba(255, 255, 255, .14) 13%,
    rgba(255, 255, 255, 0) 34%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, .62) 68%,
    rgba(255, 255, 255, .92) 82%,
    rgba(255, 255, 255, .97) 100%);
}

#p02d .slide__body { justify-content: flex-end; }

/* --- 飾り文字（写真の上に直接置く文字） ----------------------------------
   写真をはっきり見せたいので、幕はごく薄くしてある。そのぶん文字が
   写真の柄に紛れるので、白い縁取りで字の形を切り抜いて浮かせる。
   縁取りは -webkit-text-stroke ではなく、影の型紙（--outline-*、
   site.css）で引く。stroke ＋ paint-order は古い WebKit で縁が塗りを
   覆い、文字が白い塊に潰れるため（実機の iPhone 12 / 13 で発覚）。
   白い面の中にある文字（数字の小箱・年表・輪）には掛けない。      */
.slide__h,
.slide__lead,
.slide__quote,
.slide__by,
.slide__note,
.slide__big b,
.slide__big i,
.slide__big span,
.slide__copy span {
  text-shadow: var(--outline-15), var(--edge);
}

.slide__h { text-shadow: var(--outline-275), var(--edge); }
.slide__quote { text-shadow: var(--outline-225), var(--edge); }
.slide__big b { text-shadow: var(--outline-375), var(--edge); }
.slide__big i { text-shadow: var(--outline-225), var(--edge); }
.slide__copy span { text-shadow: var(--outline-25), var(--edge); }

/* 日本語は文の切れ目で折り返す。「…平均価／格」のように語の途中で
   切れるのを防ぐ（対応しないブラウザでは今までどおり）。 */
.slide__lead, .slide__note, .slide__stats span, .slide__steps span, .slide__big span {
  word-break: auto-phrase;
}

/* 本文は少し太らせる。細い明朝・ゴシックは写真の柄に負けやすい */
.slide__lead { font-weight: 700; }
.slide__note { font-weight: 600; }

/* --- 数字 --------------------------------------------------------------- */

.slide__big {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  /* 数字は行の高さいっぱいに詰めてあるうえ、白フチを 7.5px 巻いている。
     行と行のすき間が 2px しかないと、そのフチが下の説明文の頭を削り、
     文字が消えかけて見える。数字の大きさに合わせてすき間を空ける。 */
  gap: clamp(12px, 3.4vw, 16px) 8px;
  margin: 0;
}

/* 数字が続けて並ぶ 1 枚（アイランドシティ）は、見出しと数字、
   数字と数字が、どちらも太いフチを巻いていて噛み合いやすい。
   ここだけ、そのフチのぶんを足しておく。 */
.slide__h + .slide__big { margin-top: 4px; }
.slide__big + .slide__big { margin-top: 7px; }

.slide__big b {
  font-size: clamp(44px, 14vw, 66px);
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: var(--outline-375), 0 2px 18px rgba(255, 255, 255, .95);
}

.slide__big i { font-style: normal; font-size: max(13.5px, .42em); font-weight: 800; color: var(--gold-ink); }
.slide__big span { flex-basis: 100%; font-size: 13.5px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }

.slide__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.slide__stats li {
  background: var(--card);
  border: 1px solid var(--card-line);
  box-shadow: var(--card-lift);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.slide__stats b { display: block; font-size: clamp(21px, 6vw, 26px); font-weight: 900; color: var(--ink); line-height: 1.1; }
.slide__stats b i { font-style: normal; font-size: max(13.5px, .58em); color: var(--gold-ink); }
.slide__stats span { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-3); line-height: 1.5; margin-top: 5px; }

/* 年表 */
.slide__steps { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

/* 年表と施策の一覧。ここは政策の中身そのものなので、
   ほかより一段大きく、はっきり読めるようにしてある。 */
.slide__steps li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border-left: 4px solid #d0ab4e;
  box-shadow: var(--card-lift);
  border-radius: 0 12px 12px 0;
  padding: 11px 14px;
}

.slide__steps u {
  text-decoration: none;
  font-size: clamp(16px, 4.6vw, 19px);
  font-weight: 900;
  color: var(--gold-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.slide__steps b {
  display: block;
  font-size: clamp(15px, 4.2vw, 17px);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: .01em;
}

/* 写真の明るいところに重なると 4.26:1 まで落ちて AA を割ったので、
   #b3c5dd から一段明るくしてある */
.slide__steps span {
  display: block;
  font-size: clamp(13.5px, 3.6vw, 15px);
  font-weight: 600;
  color: var(--ink-3);
  line-height: 1.6;
  margin-top: 3px;
}

/* --- ストーリーらしい飾り ------------------------------------------------
   実物のストーリーは、数字や言葉に手書きの飾りを重ねる。
   紺と金という今の色を崩さないまま、その気配だけを足す。 */

/* 主役の数字の後ろに、金のにじみを置いて浮かせる */
.slide__big { position: relative; }

.slide__big::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 62%;
  height: 116%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(226, 196, 119, .55), transparent 72%);
  pointer-events: none;
  z-index: -1;
}

/* 数字は、映るたびに下からすっと立ち上がる */
.slide[aria-hidden="false"] .slide__big b {
  display: inline-block;
  animation: figureRise .62s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes figureRise {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 章のタグと見出しも、少し遅らせて続く */
.slide[aria-hidden="false"] .slide__eyebrow { animation: tagIn .5s cubic-bezier(.2, .8, .3, 1) both; }
.slide[aria-hidden="false"] .slide__h { animation: tagIn .56s cubic-bezier(.2, .8, .3, 1) .06s both; }
.slide[aria-hidden="false"] .slide__lead { animation: tagIn .56s cubic-bezier(.2, .8, .3, 1) .14s both; }

@keyframes tagIn {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 小箱は、順にひとつずつ現れる */
.slide[aria-hidden="false"] .slide__stats li,
.slide[aria-hidden="false"] .slide__steps li {
  animation: boxIn .5s cubic-bezier(.2, .8, .3, 1) both;
}

.slide[aria-hidden="false"] .slide__stats li:nth-child(1),
.slide[aria-hidden="false"] .slide__steps li:nth-child(1) { animation-delay: .16s; }
.slide[aria-hidden="false"] .slide__stats li:nth-child(2),
.slide[aria-hidden="false"] .slide__steps li:nth-child(2) { animation-delay: .24s; }
.slide[aria-hidden="false"] .slide__stats li:nth-child(3),
.slide[aria-hidden="false"] .slide__steps li:nth-child(3) { animation-delay: .32s; }
.slide[aria-hidden="false"] .slide__steps li:nth-child(4) { animation-delay: .40s; }

@keyframes boxIn {
  from { opacity: 0; transform: translateY(11px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 大きな鉤括弧を添えていたが、1 文字目に重なって読みにくかったので外した。
   引用であることは、下に添える「— 高島宗一郎」で分かる。 */
.slide__quote { position: relative; }

/* --- 好循環の輪 ---------------------------------------------------------
   「成長 → 税収 → 還元 → 負担を残さない → また成長」がひと続きで
   まわっていることを、縦の線と矢印、最後の 01 へ戻る印で見せる。 */

.cycle {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
  counter-reset: none;
}

/* 各段をつなぐ縦の線 */
.cycle::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 16px;
  bottom: 30px;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(226, 196, 119, .8), rgba(226, 196, 119, .28));
}

.cycle__step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 13px 9px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-line);
  box-shadow: var(--card-lift);
}

.cycle__no {
  position: relative;
  z-index: 1;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e2c477;
  color: #0b1d38;
  font-size: 13.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .95);
}

.cycle__step b {
  font-size: clamp(15px, 4.3vw, 18px);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: .01em;
}

/* 段と段のあいだの矢印 */
.cycle__step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 21px;
  bottom: -8px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top-color: rgba(163, 120, 26, .7);
  z-index: 1;
}

/* 最後の段。ここから 01 へ戻ることを示す */
.cycle__step--back {
  background: var(--gold-pale);
  border-color: rgba(176, 138, 46, .6);
}

.cycle__loop {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 13.5px;
  font-weight: 800;
  color: #6b4e08;
}

.cycle__loop svg {
  width: 15px;
  height: 15px;
  animation: cycleSpin 4.5s linear infinite;
}

@keyframes cycleSpin { to { transform: rotate(360deg); } }

/* 好循環の枚は 5 段あって背が高い。低い画面では見出しごと詰める */
@media (max-height: 780px) {
  .cycle { gap: 4px; }
  .cycle__step { padding: 6px 11px 6px 8px; gap: 10px; }
  .cycle__no { width: 28px; height: 28px; font-size: 13.5px; }
  .cycle__step b { font-size: clamp(14px, 4vw, 16px); }
  .cycle::before { left: 20px; }
  .cycle__step:not(:last-child)::after { left: 19px; bottom: -6px; }
  .cycle__loop { font-size: 13.5px; }
  #p05d .slide__h { font-size: clamp(19px, 5.6vw, 24px); }
  #p05d .slide__h::before { margin-bottom: 7px; }
  #p05d .slide__lead { font-size: 13.5px; line-height: 1.65; }
}

@media (max-height: 700px) {
  .cycle { gap: 3px; }
  .cycle__step { padding: 5px 10px 5px 7px; }
  .cycle__no { width: 28px; height: 28px; font-size: 13.5px; }
  .cycle__step b { font-size: 13.5px; }
  #p05d .slide__h { font-size: 17px; }
  #p05d .slide__lead { display: none; }
}

/* 2 つめの主役の数字。1 つめより一回り小さいが、小箱より大きい。
   アイランドシティの「黒字見込みのうち 100 億円」のように、
   主役に次いで見せたい数字に使う。 */
.slide__big--sub b { font-size: clamp(34px, 10.5vw, 50px); }
.slide__big--sub i { color: var(--gold-ink); }

.slide__note { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-4); }

/* --- 締めのキャッチコピー -----------------------------------------------
   下端に置いて、金の細い線から立ち上がるように見せる。
   2 行が少しずつ遅れて浮かび上がる。 */

.slide__copy {
  /* 以前は margin-top:auto で画面の下端に貼り付けていた。そのぶん
     上のまとまりが天井へ寄り、真ん中に大きな空白が残ってしまう。
     すき間に上限を決め、全体をひとかたまりとして中央に置く。 */
  margin: clamp(6px, 4vh, 44px) 0 0;
  padding-top: clamp(6px, 1.6vh, 14px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.slide__copy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 54px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, #e2c477, rgba(226, 196, 119, 0));
}

.slide__copy span {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(19px, 5.8vw, 26px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .04em;
  color: var(--ink);
  text-shadow: var(--outline-25), 0 2px 16px rgba(255, 255, 255, .95);
}

.slide__copy span:last-child {
  align-self: flex-end;
  color: var(--gold-ink);
}

/* いま映っている枚だけ、下からすっと出す */
.slide[aria-hidden="false"] .slide__copy span {
  animation: copyRise .72s cubic-bezier(.22, .61, .36, 1) both;
}

.slide[aria-hidden="false"] .slide__copy span:last-child { animation-delay: .18s; }

@keyframes copyRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-height: 780px) {
  .slide__copy { padding-top: 10px; }
  .slide__copy span { font-size: clamp(16px, 5vw, 21px); }
}

/* --- 進捗ゲージ --------------------------------------------------------- */

.story__bars {
  position: absolute;
  top: 9px;
  left: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 3px;
  transition: opacity .25s ease;
}

.story__bar {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(11, 29, 56, .22);
  overflow: hidden;
}

.story__bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.story__bar.is-done i { transform: scaleX(1); }

/* 進みは transform だけを動かす（合成のみで済む） */
.story__bar.is-live i { animation: storyFill linear forwards; }

@keyframes storyFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.story.is-paused .story__bar.is-live i { animation-play-state: paused; }

/* --- 上の帯（名前と経過時間）-------------------------------------------- */

.story__head {
  position: absolute;
  top: 20px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: opacity .25s ease;
}

.story__face {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex: none;
  box-shadow: 0 0 0 2px rgba(11, 29, 56, .22);
}

.story__name,
.story__time,
.story__sect { text-shadow: var(--outline-15), var(--edge); }

.story__name { font-size: 13.5px; font-weight: 800; color: var(--ink); text-shadow: var(--outline-15), var(--halo); }
.story__time { font-size: 13.5px; font-weight: 600; color: var(--ink-3); text-shadow: var(--outline-15), var(--halo); }
.story__sect { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--ink-3); text-shadow: var(--outline-15), var(--halo); }

.story__pause {
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--card-line);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.story__pause svg { width: 14px; height: 14px; }
.story__pause .i-play { display: none; }
.story.is-paused .story__pause .i-play { display: block; }
.story.is-paused .story__pause .i-pause { display: none; }

/* --- 下の帯（メッセージ・ハート・共有）---------------------------------- */

.story__foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: opacity .25s ease;
}

.story__msg {
  flex: 1;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 4px 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(11, 29, 56, .3);
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.story__msgIn {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  /* iOS の Safari は、文字が 16px 未満の入力欄に触れると
     ページ全体を勝手に拡大する。16px にしておくと拡大しない。
     見た目は少し大きくなるが、指で打つ欄なのでちょうどいい。 */
  font-size: 16px;
  font-weight: 500;
}

.story__msgIn::placeholder { color: var(--ink-4); font-size: 13.5px; }
.story__msgIn:focus { outline: none; }

.story__send {
  width: 32px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: .45;
  transition: opacity .2s ease, transform .2s ease;
}

.story__send svg { width: 18px; height: 18px; }
.story__msg.is-filled .story__send { opacity: 1; color: var(--gold-ink); }
.story__send:active { transform: scale(.86); }


/* --- いいねを押したときのお礼の吹き出し ---------------------------------
   ボタンの真上に出す。押したときだけで、取り消したときは出さない。 */

.tip {
  position: absolute;
  bottom: calc(100% + 9px);
  right: 0;
  z-index: 5;
  white-space: nowrap;
  padding: 6px 11px;
  border-radius: 999px;
  background: #0b1d38;
  border: 1px solid rgba(226, 196, 119, .5);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(6px) scale(.92);
  pointer-events: none;
  transition: opacity .2s ease, transform .28s cubic-bezier(.2, 1.4, .4, 1);
}

/* 吹き出しの尻尾 */
.tip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 18px;
  border: 5px solid transparent;
  border-top-color: #0b1d38;
}

.is-thanking .tip { opacity: 1; transform: translateY(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
  .tip { transition: opacity .2s ease; transform: none; }
  .is-thanking .tip { transform: none; }
}

/* --- お礼のポップアップ ------------------------------------------------- */

.thanks {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--column);
  top: var(--header-h);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));   /* standalone の safe-area ぶん */
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(11, 29, 56, .42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}

.thanks[hidden] { display: none; }
.thanks.is-open { opacity: 1; }

.thanks__card {
  width: 100%;
  max-width: 300px;
  border-radius: 20px;
  padding: 22px 20px 18px;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(176, 138, 46, .5);
  box-shadow: 0 18px 50px rgba(11, 29, 56, .3);
  transform: scale(.9);
  transition: transform .32s cubic-bezier(.2, 1.4, .4, 1);
}

.thanks.is-open .thanks__card { transform: scale(1); }

.thanks__face {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(226, 196, 119, .6);
}

.thanks__h {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.5;
}

.thanks__msg {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--ink-2);
  word-break: break-word;
}

.thanks__msg:empty { display: none; }

.thanks__note {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-4);
}

.story__act {
  position: relative;          /* お礼の吹き出しの基準 */
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .3s cubic-bezier(.2, .8, .3, 1);
}

.story__act svg { width: 25px; height: 25px; filter: drop-shadow(0 1px 4px rgba(255, 255, 255, .9)); }
.story__act:active { transform: scale(.85); transition-duration: 0s; }

.story__act.is-on svg { color: #ff3b30; }
.story__act.is-on { animation: heartPop .42s cubic-bezier(.2, 1.5, .4, 1); }

@keyframes heartPop {
  0% { transform: scale(1); } 38% { transform: scale(1.3); } 100% { transform: scale(1); }
}

/* 押しっぱなしのあいだは飾りを引っ込める（実物と同じ） */
.story.is-holding .story__bars,
.story.is-holding .story__head,
.story.is-holding .story__foot { opacity: 0; }

/* --- 指の操作 -----------------------------------------------------------
   以前は左右 34% に透明な要素を重ねてタップを受けていたが、その要素は
   スクロールできる箱の外側にあるため、その上で始めたなぞりが track に
   届かず、画面の両端ではスワイプできなかった。要素は置かず、track 自身で
   「短く触れたのか、横になぞったのか」を見分けている（js/story.js）。 */

.story__track { touch-action: pan-x; -webkit-tap-highlight-color: transparent; }

/* 読み上げとキーボードのための送り。画面には出さないが、たどり着ける */
.story__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.story__sr:focus-visible {
  width: auto;
  height: auto;
  clip-path: none;
  margin: 0;
  top: 54px;
  left: 12px;
  z-index: 6;
  padding: 8px 14px;
  border-radius: 999px;
  background: #0b1d38;
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
}



/* PC では左右に送りのボタンを出す（カラムの外なので中身に掛からない） */
.story__side {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 61;
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(226, 196, 119, .38);
  background: rgba(9, 26, 53, .8);
  color: #e2c477;
  place-items: center;
  cursor: pointer;
}

.story__side svg { width: 21px; height: 21px; }
.story__side--prev { left: 50%; margin-left: calc(var(--column) / -2 - 72px); }
.story__side--next { left: 50%; margin-left: calc(var(--column) / 2 + 26px); }
.story__side:hover { background: rgba(226, 196, 119, .22); }
.story__side:active { transform: translateY(-50%) scale(.9); }

@media (min-width: 900px) and (pointer: fine) {
  .story__side { display: grid; }
}

/* --- 画面が低いとき -----------------------------------------------------
   320x568 のような画面ではストーリー 1 枚に 421px しか使えない。
   施策が 4 つ並ぶ枚と、循環の 5 段が並ぶ枚が入りきらないので詰める。 */

@media (max-height: 780px) {
  .slide__body { gap: 5px; padding-top: clamp(50px, 8vh, 62px); padding-bottom: clamp(62px, 9vh, 74px); }
  .slide__h { font-size: clamp(19px, 5.8vw, 26px); line-height: 1.36; }
  .slide__lead { font-size: 13.5px; line-height: 1.75; }
  .slide__big b { font-size: clamp(30px, 10vw, 44px); }
  .slide__stats li { padding: 7px 6px; }
  .slide__stats b { font-size: clamp(15px, 4.4vw, 19px); }
  .slide__steps li { padding: 6px 10px; grid-template-columns: 44px 1fr; }
  .slide__steps b { font-size: 13.5px; line-height: 1.3; }
  .slide__steps span { font-size: 13.5px; line-height: 1.45; }
  .slide__steps u { font-size: 14px; }
  .slide__quote { font-size: clamp(17px, 5vw, 22px); line-height: 1.6; }
}

@media (max-height: 700px) {
  .slide__body { gap: 4px; }
  .slide__lead { font-size: 13.5px; line-height: 1.65; }
  /* 出典は数字の裏づけなので、狭い端末でも消さない（以前は隠していた）。
     そのぶんの高さは、上の gap を詰めて確保している。 */
  .slide__note { line-height: 1.5; }
  .slide__steps li { padding: 5px 9px; }
  .slide__steps b { font-size: 13.5px; }
  .slide__steps span { font-size: 13.5px; }
  .slide__stats span { font-size: 13.5px; line-height: 1.35; }
}

/* --- ボタンを載せた 1 枚だけの調整 --------------------------------------
   締めの 1 枚は、輪 5 つ・本文・ボタン 2 つと中身が多い。ここだけ
   すき間と行の高さを詰めて、1 画面に収める。 */

#p05d .slide__body { gap: clamp(5px, 0.9vh, 9px); }
#p05d .cycle { gap: 3px; }
#p05d .cycle__step { padding-top: 6px; padding-bottom: 6px; }
#p05d .slide__go { gap: 6px; margin-top: 4px; }
#p05d .slide__lead { line-height: 1.6; }

/* 画面が低くなるほど、輪とすき間を順に詰める */
@media (max-height: 780px) {
  #p05d .cycle__step { padding-top: 5px; padding-bottom: 5px; }
  #p05d .slide__go { gap: 5px; margin-top: 2px; }
  #p05d .cycle__no { width: 27px; height: 27px; font-size: 13.5px; }
}

/* 画面が低いときは、締めの言葉をボタンに任せる */
@media (max-height: 660px) {
  #p05d .slide__lead { display: none; }
  #p05d .cycle__no { width: 24px; height: 24px; }
  #p05d .slide__body { gap: 4px; }
  #p05d .slide__h { font-size: 19px; line-height: 1.32; }
  #p05d .cycle { gap: 3px; }
  #p05d .cycle__step { padding-top: 5px; padding-bottom: 5px; }
  .slide__copy { margin-top: 10px; padding-top: 6px; }
  .slide__go { gap: 6px; margin-top: 6px; }
}

/* --- 動きを抑える設定 --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .story__bar.is-live i { animation: none; transform: scaleX(1); }
  .story__act.is-on { animation: none; }
  .slide[aria-hidden="false"] .slide__copy span { animation: none; opacity: 1; transform: none; }
  .cycle__loop svg { animation: none; }
  .slide[aria-hidden="false"] .slide__big b,
  .slide[aria-hidden="false"] .slide__eyebrow,
  .slide[aria-hidden="false"] .slide__h,
  .slide[aria-hidden="false"] .slide__lead,
  .slide[aria-hidden="false"] .slide__stats li,
  .slide[aria-hidden="false"] .slide__steps li {
    animation: none; opacity: 1; transform: none;
  }
  .story__track { scroll-behavior: auto; }
}

/* --- JavaScript が無効なとき --------------------------------------------
   横のスナップは CSS だけで効くので、指では送れる。
   自動送りと押せないボタンだけ引っ込める。 */

/* JavaScript が無効なとき */
.no-js .story__bars,
.no-js .story__pause,
.no-js .story__foot,
.no-js .story__zone,
.no-js .story__side { display: none; }

/* =========================================================================
   横向きのスマートフォン（発注者指示 2026-10-04）

   横にすると 1 枚は 520px の幅のまま、高さが 230〜340px しか残らない
   （上のヘッダーと下のタブは site.css で細くしてある）。
   ・上の帯（ゲージ・名前）と下の帯（メッセージ欄）を細くする
   ・中身は上端から並べる。flex の center のままあふれると、上にはみ出した
     ぶんは指で送っても戻れない（切り捨てられる）。入るときだけ auto の
     余白で真ん中に寄せる
   ・数字の小箱・手順・循環のある枚は、文字を左、それを右に並べて横幅で
     高さを稼ぐ。入りきらないぶんは、縦持ちと同じく枚の中で縦に送れる
   ========================================================================= */
@media (orientation: landscape) and (max-height: 500px) {
  .story__bars { top: 6px; }
  .story__head { top: 13px; }
  .story__face,
  .story__pause { width: 26px; height: 26px; }
  .story__foot { bottom: 6px; }
  .story__msg { height: 34px; }

  .slide__body {
    justify-content: flex-start;
    gap: 5px;
    padding: 46px 22px 46px;
  }
  .slide__body > :first-child { margin-top: auto; }
  .slide__body > :last-child { margin-bottom: auto; }

  /* 縦持ちの大きさのままだと、見出しも数字も 1 枚の半分を取ってしまう。
     横向きでは一段小さくする（本文と注記は 10pt のまま） */
  .slide__h { font-size: 22px; line-height: 1.32; }
  .slide__big b { font-size: 38px; }
  .slide__big--sub b { font-size: 34px; }
  .slide__quote { font-size: 18px; line-height: 1.55; }

  /* 左に文字、右に小箱・手順・循環。行は「上の余白・中身 4 段・下の余白」。
     上の余白の段は ::before が埋める（中身を 2 段目から順に入れるため。
     先頭の子に段を指定すると、残りが 1 段目から詰められて順番が入れ替わる）。
     右の組は全段にまたがり、上下 auto の余白で真ん中へ。入りきらないときは
     上端から並ぶので、はみ出したぶんは下へ送れる */
  .slide__body:has(> :is(.slide__stats, .slide__steps, .cycle)):has(> :is(.slide__h, .slide__big, .slide__lead, .slide__note)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: 1fr repeat(4, auto) 1fr;
    grid-auto-flow: row;
    column-gap: 18px;
    row-gap: 0;
  }
  .slide__body:has(> :is(.slide__stats, .slide__steps, .cycle)):has(> :is(.slide__h, .slide__big, .slide__lead, .slide__note)) > * {
    grid-column: 1;
    margin: 0;
  }
  .slide__body:has(> :is(.slide__stats, .slide__steps, .cycle)):has(> :is(.slide__h, .slide__big, .slide__lead, .slide__note))::before {
    content: '';
    grid-column: 1;
    grid-row: 1;
  }
  .slide__body:has(> :is(.slide__stats, .slide__steps, .cycle)):has(> :is(.slide__h, .slide__big, .slide__lead, .slide__note)) > * + * {
    margin-top: 5px;
  }
  .slide__body:has(> :is(.slide__stats, .slide__steps, .cycle)):has(> :is(.slide__h, .slide__big, .slide__lead, .slide__note)) > :is(.slide__stats, .slide__steps, .cycle) {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    margin: auto 0;
  }

  /* 数字がふたつ並ぶ枚（アイランドシティ）は、ふたつを横に並べる */
  #p05c .slide__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr repeat(4, auto) 1fr;   /* 上下の余白は 1fr。あふれたら下へ送れる */
    grid-auto-flow: row;
    column-gap: 18px;
    row-gap: 0;
  }
  #p05c .slide__body::before { content: ''; grid-column: 1 / -1; grid-row: 1; }
  #p05c .slide__body > * { grid-column: 1 / -1; margin: 0; }
  #p05c .slide__body > * + * { margin-top: 5px; }
  #p05c .slide__body > .slide__big { grid-column: auto; }

  /* 手順が 4 つ並ぶ枚（文字が見出しだけで、手順が全幅を使える枚）は、
     2 つずつ 2 段にする */
  .slide__body:not(:has(> :is(.slide__h, .slide__big, .slide__lead, .slide__note))) > .slide__steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
}
