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

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

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

.story {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--column);
  top: var(--header-h);
  bottom: var(--nav-h);
  z-index: 40;
  background: #eef2e9;
  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(5, 42, 23, .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;
}

.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, 106, 30, .55);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #5e3002;
  box-shadow: 0 2px 10px rgba(5, 42, 23, .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: 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, #f0921c, rgba(240, 146, 28, 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: #0a3d20;
  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(5, 42, 23, .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(10, 61, 32, .24);
  box-shadow: 0 4px 14px rgba(5, 42, 23, .14);
}

.slide__goBtn span { opacity: .75; font-weight: 700; }
.slide__goBtn:active { transform: scale(.975); box-shadow: 0 2px 8px rgba(5, 42, 23, .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(--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, 106, 30, .6);
  color: #6b3602;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .18em;
  box-shadow: 0 3px 12px rgba(5, 42, 23, .18);
}

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

.storyGuide__pill {
  padding: 11px 20px;
  border-radius: 999px;
  background: #052a17;
  border: 1px solid rgba(240, 146, 28, .5);
  color: #fff;
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 8px 24px rgba(5, 42, 23, .35);
}

.storyGuide__arrow { display: grid; place-items: center; color: #052a17; }
.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(5, 42, 23, .14);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(5, 42, 23, .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; }

/* --- 飾り文字（写真の上に直接置く文字） ----------------------------------
   写真をはっきり見せたいので、幕はごく薄くしてある。そのぶん文字が
   写真の柄に紛れるので、白い縁取りで字の形を切り抜いて浮かせる。
   paint-order を指定して、縁取りを文字の下に敷く（字の形が太らない）。
   白い面の中にある文字（数字の小箱・年表・輪）には掛けない。      */
.slide__h,
.slide__lead,
.slide__quote,
.slide__by,
.slide__note,
.slide__big b,
.slide__big i,
.slide__big span,
.slide__copy span {
  paint-order: stroke fill;
  -webkit-text-stroke: 3px #fff;
  text-shadow: var(--edge);
}

.slide__h { -webkit-text-stroke-width: 5.5px; }
.slide__quote { -webkit-text-stroke-width: 4.5px; }
.slide__big b { -webkit-text-stroke-width: 7.5px; }
.slide__big i { -webkit-text-stroke-width: 4.5px; }
.slide__copy span { -webkit-text-stroke-width: 5px; }

/* 日本語は文の切れ目で折り返す。「…平均価／格」のように語の途中で
   切れるのを防ぐ（対応しないブラウザでは今までどおり）。 */
.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: 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 #e07a05;
  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 を割ったので、
   #b6cbb2 から一段明るくしてある */
.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(240, 146, 28, .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(240, 146, 28, .8), rgba(240, 146, 28, .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: #f0921c;
  color: #052a17;
  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(158, 78, 3, .7);
  z-index: 1;
}

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

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

.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, #f0921c, rgba(240, 146, 28, 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: 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(5, 42, 23, .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(5, 42, 23, .22);
}

.story__name,
.story__time,
.story__sect { paint-order: stroke fill; -webkit-text-stroke: 3px #fff; text-shadow: var(--edge); }

.story__name { font-size: 13.5px; font-weight: 800; color: var(--ink); text-shadow: var(--halo); }
.story__time { font-size: 13.5px; font-weight: 600; color: var(--ink-3); text-shadow: var(--halo); }
.story__sect { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--ink-3); text-shadow: 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(5, 42, 23, .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: #052a17;
  border: 1px solid rgba(240, 146, 28, .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: #052a17;
}

.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: var(--nav-h);
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(5, 42, 23, .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, 106, 30, .5);
  box-shadow: 0 18px 50px rgba(5, 42, 23, .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(240, 146, 28, .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: #052a17;
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
}



/* PC で見たときの送りボタンは、柱の外の帯（.railGuide）へ移した。
   様式は css/site.css の「PC で見たときの、柱の外の両側」にある。 */

/* --- 画面が低いとき -----------------------------------------------------
   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,

/* 写真がまだ無いスライドでも、色の面として成立させる。
   白いベールをやや薄くして、下に敷いた色を通す。 */
.slide__photo:not(:has(img))::after {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .78) 0%,
    rgba(255, 255, 255, .30) 20%,
    rgba(255, 255, 255, .14) 48%,
    rgba(255, 255, 255, .36) 76%,
    rgba(255, 255, 255, .80) 100%);
}

/* =========================================================================
   各回のストーリーカード
   =========================================================================
   分科会は年に8〜9回。その1回ぶんを1枚にして、横に送ると次の回が出てくる。
   絵は外から借りず、回の中身に合わせて描き起こしたものを埋め込んである
   （svg なので拡大しても粗れず、取り寄せる時間もかからない）。

   上に絵、下に紙のカード。会員は70代が中心なので、日付と講師は
   大きめに、説明はそのあとに小さく置く。
   ========================================================================= */

/* 絵は上半分だけ。下は紙のカードのために空けておく */
.slide--ses .slide__photo,
.slide--top .slide__photo { bottom: auto; height: 46%; }
.ses__art .ses__svg { display: block; width: 100%; height: 100%; }

/* 絵の下ぶちを、ストーリーの地色へ溶かす */
.slide--ses .slide__photo::after,
.slide--top .slide__photo::after,
.slide .slide__photo:has(.ses__svg)::after {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .30) 0%,
    rgba(255, 255, 255, .04) 38%,
    rgba(238, 242, 233, .55) 82%,
    #eef2e9 100%);
}

/* カードは下に寄せる。絵とのあいだが空くぶんは地色で受ける */
.slide--ses .slide__body { justify-content: flex-end; }

.ses__card {
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.2vh, 9px);
  padding: clamp(15px, 4vw, 21px);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(10, 61, 32, .11);
  box-shadow: 0 14px 34px rgba(5, 42, 23, .15);
}

/* 何回目か、と、その回の但し書き */
.ses__no {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--gold-ink);
}

.ses__tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #24486b;
  background: #e4edf5;
  border: 1px solid rgba(36, 72, 107, .3);
}
.ses__tag--go   { color: #0a3d20; background: #dfeedd; border-color: rgba(10, 61, 32, .3); }
.ses__tag--warn { color: #7a3a06; background: #fbe7cb; border-color: rgba(122, 58, 6, .32); }

/* 日付。ここがいちばん見たいところなので、大きく取る */
.ses__when {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.ses__when b {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(30px, 8.8vw, 40px);
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.ses__when b i {
  font-style: normal;
  font-size: .44em;
  font-weight: 700;
  color: var(--ink-3);
  margin: 0 .08em 0 .04em;
}

/* 曜日。日曜と祝日は赤、土曜は青。紙の予定表と同じ約束ごとにしておく */
.ses__dow {
  font-style: normal;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 900;
  color: #fff;
  background: var(--ink-3);
}
.ses__dow.is-sun { background: #b4453a; }
.ses__dow.is-sat { background: #2a5b8c; }

.ses__yr { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }

.ses__time {
  margin: 0;
  font-size: clamp(14.5px, 4vw, 16px);
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--gold-ink);
}

.ses__topic {
  margin: 0;
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(19px, 5.3vw, 24px);
  font-weight: 800;
  line-height: 1.46;
  color: var(--ink);
  text-wrap: pretty;
}

.ses__sub {
  margin: 0;
  font-size: clamp(13.5px, 3.6vw, 15px);
  font-weight: 700;
  line-height: 1.6;
  color: var(--gold-ink);
}

.ses__note {
  margin: 0;
  font-size: clamp(13.5px, 3.6vw, 15px);
  font-weight: 600;
  line-height: 1.78;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* 講師。線で区切って、名前を大きく */
.ses__who {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: clamp(7px, 1.5vh, 10px);
  border-top: 1px dashed rgba(10, 61, 32, .24);
}

.ses__who > span {
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #fff;
  background: var(--gold-ink);
}

.ses__who b { font-size: clamp(15.5px, 4.3vw, 17px); font-weight: 900; color: var(--ink); }

.ses__who em {
  flex-basis: 100%;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink-3);
}

/* 会の紹介スライドに置くときは、カードの中ではないので枠だけ整える */
.ses__who--flat {
  border-top: none;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(10, 61, 32, .13);
}

/* 画面が低い端末では、絵をすこし詰めてカードの居場所をつくる */
@media (max-height: 660px) {
  .slide--ses .slide__photo, .slide--top .slide__photo { height: 38%; }
  .ses__card { gap: 4px; padding: 13px 15px; border-radius: 16px; }
  .ses__note { display: none; }
}

/* 動きを減らす設定では、カードのふわりも省く */
.slide[aria-hidden="false"] .ses__card {
  animation: cardIn .5s cubic-bezier(.2, .8, .3, 1) .04s both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .slide[aria-hidden="false"] .ses__card { animation: none; }
}

/* --- 1枚目（お預かりした写真） ------------------------------------------
   写真は画面いっぱい。会の様子が伝わることを第一にして、ベールはごく薄く
   （写真は7〜8割はっきり見える）。そのぶん字は写真に直接載せず、
   下に紙のカードを敷いてその上に置く。各回のカードと同じ作りなので、
   横に送っても見え方が変わらない。

   上ぶちと下ぶちだけベールを濃くしてある。ストーリーの名前と、
   下の「お申し込み・お問い合わせ」の帯が、そこに乗るため。 */
.slide--hero .slide__photo::after {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .62) 0%,
    rgba(255, 255, 255, .17) 12%,
    rgba(255, 255, 255, .06) 34%,
    rgba(255, 255, 255, .06) 62%,
    rgba(255, 255, 255, .20) 82%,
    rgba(255, 255, 255, .60) 100%);
}

/* 字は下に寄せる。写真の上半分は、そのまま見せる */
.slide--hero .slide__body { justify-content: flex-end; }

.heroCard {
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1.2vh, 9px);
  padding: clamp(15px, 4vw, 21px);
  border-radius: 20px;
  background: rgba(255, 255, 255, .93);
  border: 1px solid rgba(10, 61, 32, .16);
  box-shadow: 0 14px 36px rgba(5, 42, 23, .26);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* カードの中では、写真の上に置くための白いふちは要らない */
.heroCard .slide__h,
.heroCard .slide__big b,
.heroCard .slide__big i,
.heroCard .slide__big span,
.heroCard .slide__lead { text-shadow: none; }
.heroCard .slide__big span { font-weight: 700; color: var(--ink-3); }
.heroCard .slide__big::before { display: none; }

.slide[aria-hidden="false"] .heroCard {
  animation: cardIn .5s cubic-bezier(.2, .8, .3, 1) .04s both;
}
@media (prefers-reduced-motion: reduce) {
  .slide[aria-hidden="false"] .heroCard { animation: none; }
}

/* 画面が低い端末では、カードを詰める */
@media (max-height: 660px) {
  .heroCard { gap: 4px; padding: 13px 15px; border-radius: 16px; }
}
