.bg_half_pale_pink {
  background: linear-gradient(transparent 55%, var(--colorPaleAccent) 50%);
  position: relative;
  z-index: 1;
}

/* ─────────────────────────────────
   BANNERS 4列
───────────────────────────────── */
.banners-wrap { padding: 0 40px 48px; max-width: 1400px; margin: 0 auto; }
.banners-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.banners-grid a {
  transition: opacity 0.3s ease;
}
@media (hover: hover) {
  .banners-grid a:hover {
    opacity: 0.8;
  }
}
.banner-box {
  background: #e5e5e5; border-radius: 8px;
  aspect-ratio: 3 / 2;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(12px, 1.15vw, 14px); color: #999;
}

/* ─────────────────────────────────
   SECOND VIEW / DONATION CARD
───────────────────────────────── */
.second-view { padding: 0px 0px 30px; max-width: 930px; margin: 0 auto; }

.donation-card {
  position: relative;
  border: 3px solid #0093a5;
  border-radius: 16px;
  padding: 28px 40px 36px;
  margin-bottom: 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
}
.donation-card::before {
  content: '';
  position: absolute; bottom: -27px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-top: 26px solid #0093a5;
}
.donation-card::after {
  content: '';
  position: absolute; bottom: -22px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-top: 22px solid #fff;
}
.donation-card__title {
  display: flex; align-items: center; gap: 12px;
  font-size: clamp(26px, 2.6vw, 32px); font-weight: 700; color: #333;
}
.donation-card__title img { height: 34px; flex-shrink: 0; }
.donation-card__amount { display: flex; align-items: center; gap: 20px; }
.donation-card__kifu { height: 80px; flex-shrink: 0; }
.donation-card__number { font-size: clamp(48px, 6vw, 82px); font-weight: 900; color: #DC2626; line-height: 1; }
.donation-card__number span { font-size: clamp(24px, 2.6vw, 30px); vertical-align: baseline; font-weight: 900; }

/* ─────────────────────────────────
   SERVICE SECTIONS (自治体・企業)
───────────────────────────────── */
.service-section {
  display: grid;
  align-items: stretch;
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(15, 32, 60, 0.04),
    0 12px 32px rgba(15, 76, 129, 0.10),
    0 28px 60px rgba(15, 76, 129, 0.08);
}
.service-section--jichitai { grid-template-columns: 3fr 2fr; margin-bottom: 8%; }
.service-section--kigyo    { grid-template-columns: 2fr 3fr; margin-top: 8%; }

.service-photo {
  display: block;
  position: relative;
  z-index: 2;
  overflow: hidden;
  aspect-ratio: 3 / 2;
}
.service-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.service-photo__badge {
  position: absolute;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  background: rgba(255,255,255,.82);
  border-radius: 10px;
  padding: 2% 2.5%;
  line-height: 1.2;
}
.service-section--jichitai .service-photo__badge { top: 5%; left: 3%; }
.service-section--kigyo .service-photo__badge { bottom: 5%; left: 3%; }

.service-photo__badge-label { 
  padding-right: 10px;
  font-size: clamp(14px, 2vw, 26px); font-weight: 700; color: #111; line-height: 1.35; 
}
.service-photo__badge-count { font-size: clamp(42px, 6vw, 78px); font-weight: 900; color: #DC2626; line-height: 1; }
.service-photo__badge-unit  { font-size: clamp(18px, 2.7vw, 35px); font-weight: 700; color: #111; line-height: 1.4; }

.service-section--jichitai .service-text { padding: 60px 80px 60px 60px; }
.service-section--kigyo .service-text { padding: 60px 60px 60px 30%; }

.service-text {
  position: relative;
  z-index: 3;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.service-text__heading { font-size: clamp(30px, 4vw, 41px); font-weight: 900; color: #333; line-height: 62px; }
.service-text__tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0093a5;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0;
  border: none;
  width: fit-content;
}
.service-text__tag::before,
.service-text__tag::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 2px;
  background: #0093a5;
}
.service-text__list {
  list-style: none; display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 15px;
  margin-top: 10px;
}
.service-text__item {
  display: flex; align-items: center; gap: 10px;
  font-size: clamp(17px, 1.4vw, 20px); font-weight: 700; color: #333; line-height: 1.5;
}
.service-text__item svg { flex-shrink: 0; margin-top: 1px; }

.btn-detail {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(to right, #09478a, #0093a5);
  color: #fff; font-weight: 700; font-size: clamp(14px, 1.15vw, 16px);
  padding: 24px 15%; border-radius: 8px; border: none;
  cursor: pointer; text-decoration: none; width: fit-content;
  position: relative; overflow: hidden; z-index: 0;
}
.btn-detail::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to right, #0093a5, #09478a);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.btn-detail:hover::after {
  opacity: 1;
}

/* ─────────────────────────────────
   SEPARATOR
───────────────────────────────── */
.river-separator {
  display: flex; justify-content: center; align-items: center;
  width: 100%;
  position: relative; z-index: 10;
  margin-top: -12%;
  margin-bottom: -12%;
}
.river-separator__wrap {
  position: relative;
  width: min(380px, 60vw);
  height: min(380px, 60vw);
  display: flex; align-items: center; justify-content: center;
}
.river-separator__arrow {
  width: 100%; height: 100%;
  animation: spin-slow 30s linear infinite;
}
.river-separator__logo {
  position: absolute;
  width: 38.95%;
  height: auto;
  z-index: 1;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══ タブレット ≤1024px ═══ */
@media (max-width: 1024px) {

  .banners-wrap  { padding: 0 24px 40px; }

  .donation-card__number { font-size: clamp(48px, 7vw, 72px); }

  /* サービスセクション：余白を詰める */
  .service-section--jichitai .service-text { padding: 40px 40px 40px 48px; }
  .service-section--kigyo    .service-text { padding: 40px 40px 40px 24%; }
  .service-text__heading { font-size: clamp(26px, 2.6vw, 32px); }
  .service-text__item    { font-size: clamp(14px, 1.4vw, 17px); }
}

/* ═══ スマホ ≤768px ═══ */
@media (max-width: 768px) {

  /* ── バナー ── */
  .banners-wrap { padding: 0 10px 28px; }
  .banners-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }

  /* ── 寄付実績カード ── */
  /* 見出し「river から生まれた〜」を 1 行に収めるため左右の固定余白を削る */
  .second-view   { padding: 0 8px 16px; }
  .donation-card { padding: 20px 8px 24px; gap: 10px; align-items: center; text-align: center; }
  /* ロゴ + 見出しを flex 行のままにすると、テキストだけが 2 行になって
     画像との段がずれる。SP では inline に戻し 1 つの文として扱う。
     3.7vw は 320〜430px で 1 行に収まる上限（折り返した場合も balance で均等割り）。 */
  .donation-card__title {
    display: block;
    font-size: clamp(11px, 3.7vw, 18px);
    line-height: 1.6;
    text-wrap: balance;
  }
  .donation-card__title img {
    height: clamp(15px, 4.2vw, 22px);
    display: inline-block;
    vertical-align: -0.18em;
    margin-right: 4px;
  }
  .donation-card__amount    { gap: 8px; flex-wrap: nowrap; justify-content: center; }
  .donation-card__kifu      { height: clamp(28px, 7.5vw, 46px); }
  /* 金額は折り返すと桁が段ずれするので 1 行に固定し、幅は font-size で吸収する */
  .donation-card__number    { font-size: clamp(24px, 7.6vw, 46px); white-space: nowrap; }
  .donation-card__number span { font-size: clamp(13px, 3.4vw, 20px); }

  /* ── サービスセクション（自治体・企業）── キー修正：潜り込み解消 ── */
  .service-section--jichitai,
  .service-section--kigyo {
    grid-template-columns: 1fr;   /* 2列→1列 */
    margin-bottom: 40px;
    margin-top: 0;
  }

  /* 自治体：写真(order:1)を上、テキスト(order:2)を下 */
  .service-section--jichitai .service-photo { order: 1; }
  .service-section--jichitai .service-text  { order: 2; }

  /* 企業：写真(order:1)を上、テキスト(order:2)を下 */
  .service-section--kigyo .service-photo { order: 1; }
  .service-section--kigyo .service-text  { order: 2; }

  /* padding リセット：40% 左パディングによる潜り込みを解消 */
  .service-section--jichitai .service-text,
  .service-section--kigyo    .service-text {
    padding: 24px 20px 32px;
  }

  .service-photo           { aspect-ratio: 16 / 9; }
  .service-text__heading   { font-size: clamp(22px, 6.5vw, 32px); line-height: 1.4; }
  .service-text__tag       { font-size: clamp(13px, 1.15vw, 15px); }
  .service-text__item      { font-size: clamp(14px, 3.9vw, 16px); }
  /* 「サービスの詳細」ボタンは width:fit-content で左寄せになるので中央に置く */
  .btn-detail              { align-self: center; }
  /* セミナー開催の参加者数も寄付件数と同じく SP では下の段に落とす */
  .seminar-lead .title-block__title-text { margin-bottom: 26px; }

  /* ── セパレーター ── */
  .river-separator { margin-top: -40px; margin-bottom: -40px; }
}

/* ═══ スマホ小 ≤480px ═══ */
@media (max-width: 480px) {

  .banners-grid { grid-template-columns: 1fr; }
}

/* 遅延マウントされる本文（セミナー一覧・活用事例）。見出しブロックとの間に余白を取る。 */
.home-deferred-section {
  margin-top: 24px;
}

/* ─────────────────────────────────
   SEMINAR MORE (一覧への導線・中央寄せ)
───────────────────────────────── */
.seminar-more {
  display: flex;
  justify-content: center;
  margin: 32px 0 8px;
}

/* メガメニューの CTA と同じ塗りボタン。導線なので一回り大きくする。
   共通の .arrow は sidebar.css がセレクタ無しで position:absolute を当ててくるため使わない。 */
.seminar-more__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  padding: 16px 40px;
  background: var(--colorLightBase);
  border: 1.5px solid var(--colorLightBase);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: clamp(15px, 1.4vw, 17px);
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 60, 126, 0.18);
  transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}

.seminar-more__button:hover {
  background: #fff;
  color: var(--colorLightBase);
  box-shadow: 0 2px 8px rgba(0, 60, 126, 0.10);
  transform: translateY(-1px);
}

.seminar-more__button::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  margin-left: 12px;
}

/* ─────────────────────────────────
   SEMINAR ARCHIVE SECTION
───────────────────────────────── */
.seminar-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.seminar-archive__card {
  display: block;
  text-decoration: none;
  color: #333;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.seminar-archive__card:hover {
  transform: scale(1.03);
}

.seminar-archive__card-image {
  width: 100%;
  aspect-ratio: 310 / 207;
  overflow: hidden;
  border-radius: 8px;
}

.seminar-archive__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seminar-archive__card-body {
  padding: 12px 0;
}

.seminar-archive__card-title {
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: bold;
  color: #333;
  line-height: 1.5;
  margin: 0 0 8px;
}

.seminar-archive__card-text {
  font-size: clamp(12px, 1.15vw, 14px);
  font-weight: 500;
  color: #333;
  line-height: 22px;
  margin: 0;
}

@media (max-width: 768px) {
  .seminar-archive__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .seminar-archive__card-title {
    font-size: clamp(13px, 1.15vw, 15px);
  }

  .seminar-archive__card-text {
    font-size: clamp(12px, 0.9vw, 13px);
  }
}

@media (max-width: 480px) {
  .seminar-archive__grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────
   SEMINAR VIDEO SECTION (トップ)
───────────────────────────────── */
.seminar-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.seminar-video__frame iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ═══════════════════════════════════════════════════════
   MUNICIPALITIES HERO（企業版ふるさと納税対象自治体・新デザイン）
═══════════════════════════════════════════════════════ */
.municipalities-hero {
  position: relative;
  width: 100%;
  padding: 80px 0 60px;
  isolation: isolate;
  background: linear-gradient(180deg, #f3fbfd 0%, #e8f5fa 50%, #f3fbfd 100%);
  overflow: hidden;
}
.municipalities-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 30%, rgba(170, 220, 240, 0.35), transparent 35%),
    radial-gradient(circle at 92% 70%, rgba(180, 225, 240, 0.32), transparent 40%);
}
.municipalities-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
/* 全体を覆う曇りガラスのパネル */
.municipalities-hero__panel {
  position: relative;
  border-radius: 24px;
  padding: 56px 56px 48px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(232,247,251,0.66) 100%);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow:
    0 1px 2px rgba(15, 32, 60, 0.04),
    0 24px 60px rgba(15, 76, 129, 0.08);
}
.municipalities-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ── 共通：タイトル ── */
.municipalities-hero__eyebrow {
  display: inline-block;
  position: relative;
  font-size: clamp(14px, 1.15vw, 16px);
  font-weight: 700;
  color: #0f4c81;
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.municipalities-hero__eyebrow::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #0f4c81, #59c1c7);
  border-radius: 2px;
}
.municipalities-hero__title {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  color: #0f3b66;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}
.municipalities-hero__lead {
  font-size: clamp(13px, 1.15vw, 15px);
  line-height: 1.9;
  color: #4a5568;
  margin-bottom: 24px;
}

/* ── 左カラム：地図 ── */
.municipalities-hero__left {
  position: relative;
}
.municipalities-hero__left .municipalities-hero__eyebrow,
.municipalities-hero__left .municipalities-hero__title,
.municipalities-hero__left .municipalities-hero__lead {
  position: relative;
  z-index: 3;
}
/* 地図：リード直後から始めつつ、上に少しだけせり出して大きく見せる */
.municipalities-hero__map {
  position: relative;
  width: 96%;
  aspect-ratio: 1 / 1;
  margin: -120px auto 0;
  isolation: isolate;
  z-index: 1;
}

/* 同心円の装飾 */
.municipalities-hero__map-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.municipalities-hero__map-rings .ring {
  position: absolute;
  top: 50%;
  left: 55%;
  border: 1px dashed rgba(75, 175, 200, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  /* リップル */
  opacity: 0;
  animation: map-ring-ripple 3.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: transform, opacity;
}
.municipalities-hero__map-rings .ring-1 { width: 36%; height: 36%; animation-delay: 0s; }
.municipalities-hero__map-rings .ring-2 { width: 54%; height: 54%; animation-delay: 0.9s; }
.municipalities-hero__map-rings .ring-3 { width: 74%; height: 74%; animation-delay: 1.8s; }
.municipalities-hero__map-rings .ring-4 {
  width: 96%; height: 96%;
  border-color: rgba(75, 175, 200, 0.18);
  animation-delay: 2.7s;
}

@media (prefers-reduced-motion: reduce) {
  .municipalities-hero__map-rings .ring {
    animation: none;
    opacity: 1;
  }
}

/* 日本地図シェイプ（mask で日本の形に切り抜いて、グラデーションを表示） */
.municipalities-hero__map-shape {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, #88d18a 0%, #6cc7a4 30%, #59c1c7 55%, #69bdd9 80%, #7fc1e3 100%);
  -webkit-mask-image: url('/tenants/cpriver/assets/img/common/japan-silhouette.svg');
  mask-image: url('/tenants/cpriver/assets/img/common/japan-silhouette.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  filter: drop-shadow(0 2px 6px rgba(15, 76, 129, 0.12));
}

/* 地域ピン（吹き出し風カード） */
.region-pin {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px 8px 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 76, 129, 0.12);
  font-size: clamp(11px, 0.9vw, 12px);
  white-space: nowrap;
  /* 表示前は隠しておき、is-visible でバウンス表示 */
  opacity: 0;
  transform: translateY(-14px) scale(0.85);
}
.municipalities-hero__map.is-visible .region-pin {
  animation: region-pin-bounce 700ms cubic-bezier(0.28, 1.5, 0.4, 1) forwards;
}
@keyframes region-pin-bounce {
  0%   { opacity: 0; transform: translateY(-14px) scale(0.85); }
  60%  { opacity: 1; transform: translateY(4px)   scale(1.05); }
  80%  {              transform: translateY(-2px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0)     scale(1);    }
}
@media (prefers-reduced-motion: reduce) {
  .region-pin { opacity: 1; transform: none; }
  .municipalities-hero__map.is-visible .region-pin { animation: none; }
}
.region-pin__head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.region-pin__head svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.region-pin__name {
  font-size: clamp(12px, 0.9vw, 13px);
  font-weight: 700;
  color: #0f3b66;
}

/* ── 右カラム：統計カード ── */
.municipalities-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.municipalities-stat {
  background: #fff;
  border-radius: 12px;
  padding: 16px 14px;
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.06);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.municipalities-stat__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e6f6f7;
  color: #2bb3b8;
  display: grid;
  place-items: center;
}
.municipalities-stat__icon svg {
  width: 22px;
  height: 22px;
}
.municipalities-stat__body {
  flex: 1;
  min-width: 0;
}
.municipalities-stat__label {
  font-size: clamp(11px, 0.9vw, 12px);
  color: #6b7280;
  margin-bottom: 4px;
}
.municipalities-stat__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #0f3b66;
  font-weight: 900;
}
.municipalities-stat__num {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
}
.municipalities-stat__unit {
  font-size: clamp(12px, 0.9vw, 13px);
  color: #4a5568;
  font-weight: 500;
}
.municipalities-stat__note {
  font-size: clamp(10px, 0.9vw, 11px);
  color: #9ca3af;
  margin-top: 2px;
}

/* ── 地域ボタン ── */

/* ── CTA ボタン ── */
.municipalities-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.municipalities-cta__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 28px;
  font-size: clamp(13px, 1.15vw, 15px);
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  min-width: 220px;
  letter-spacing: 0.02em;
}
.municipalities-cta__primary {
  background: #1c4ec9;
  color: #fff;
  box-shadow: 0 6px 18px rgba(28, 78, 201, 0.28);
}
.municipalities-cta__primary:hover {
  background: #1640a9;
  box-shadow: 0 8px 22px rgba(28, 78, 201, 0.36);
}
.municipalities-cta__primary .municipalities-cta__arrow {
  display: inline-flex;
  width: 24px;
  height: 24px;
  color: #fff;
}
.municipalities-cta__primary .municipalities-cta__arrow svg {
  width: 100%;
  height: 100%;
}

/* ── 注釈 ── */
.municipalities-hero__footnote {
  margin-top: 24px;
  text-align: center;
  font-size: clamp(11px, 0.9vw, 12px);
  color: #6b7280;
}

/* ═══ タブレット ≤1024px ═══ */
@media (max-width: 1024px) {
  .municipalities-hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .municipalities-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ═══ スマホ ≤768px ═══ */
@media (max-width: 768px) {
  .municipalities-hero {
    padding: 0 0 40px;
  }
  .municipalities-hero__inner {
    padding: 0 10px;
  }
  /* PC の 56px パネル余白のままだと SP で中身が 220px まで痩せる */
  .municipalities-hero__panel {
    padding: 20px 8px 24px;
    border-radius: 16px;
  }
  .municipalities-hero__title {
    font-size: clamp(22px, 6vw, 32px);
  }
  .municipalities-stats {
    grid-template-columns: 1fr;
  }
  .municipalities-cta__primary {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════════════════
   SCROLL REVEAL（A: fade-up / B: stagger）
═══════════════════════════════════════════════════════ */
.scroll-reveal {
  --sr-duration: 700ms;
  --sr-easing: cubic-bezier(0.22, 0.61, 0.36, 1);
  --sr-distance: 26px;
  --sr-step: 110ms;
  --sr-delay: 0ms;
}

/* 単体: フェード+下から */
.scroll-reveal--fade-up {
  opacity: 0;
  transform: translate3d(0, var(--sr-distance), 0);
  transition: opacity var(--sr-duration) var(--sr-easing) var(--sr-delay),
              transform var(--sr-duration) var(--sr-easing) var(--sr-delay);
  will-change: opacity, transform;
}
.scroll-reveal--fade-up.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 単体: 左から */
.scroll-reveal--slide-right {
  opacity: 0;
  transform: translate3d(calc(var(--sr-distance) * -1.2), 0, 0);
  transition: opacity var(--sr-duration) var(--sr-easing) var(--sr-delay),
              transform var(--sr-duration) var(--sr-easing) var(--sr-delay);
  will-change: opacity, transform;
}
.scroll-reveal--slide-right.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 単体: 右から */
.scroll-reveal--slide-left {
  opacity: 0;
  transform: translate3d(calc(var(--sr-distance) * 1.2), 0, 0);
  transition: opacity var(--sr-duration) var(--sr-easing) var(--sr-delay),
              transform var(--sr-duration) var(--sr-easing) var(--sr-delay);
  will-change: opacity, transform;
}
.scroll-reveal--slide-left.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 子要素を順番にフェードイン（stagger） */
.scroll-reveal--stagger > *,
.scroll-reveal--fade-up-stagger > * {
  opacity: 0;
  transform: translate3d(0, var(--sr-distance), 0);
  transition: opacity var(--sr-duration) var(--sr-easing),
              transform var(--sr-duration) var(--sr-easing);
  will-change: opacity, transform;
}
.scroll-reveal--stagger.is-visible > *,
.scroll-reveal--fade-up-stagger.is-visible > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.scroll-reveal--stagger.is-visible > *:nth-child(1),
.scroll-reveal--fade-up-stagger.is-visible > *:nth-child(1) { transition-delay: calc(var(--sr-delay) + var(--sr-step) * 0); }
.scroll-reveal--stagger.is-visible > *:nth-child(2),
.scroll-reveal--fade-up-stagger.is-visible > *:nth-child(2) { transition-delay: calc(var(--sr-delay) + var(--sr-step) * 1); }
.scroll-reveal--stagger.is-visible > *:nth-child(3),
.scroll-reveal--fade-up-stagger.is-visible > *:nth-child(3) { transition-delay: calc(var(--sr-delay) + var(--sr-step) * 2); }
.scroll-reveal--stagger.is-visible > *:nth-child(4),
.scroll-reveal--fade-up-stagger.is-visible > *:nth-child(4) { transition-delay: calc(var(--sr-delay) + var(--sr-step) * 3); }
.scroll-reveal--stagger.is-visible > *:nth-child(5),
.scroll-reveal--fade-up-stagger.is-visible > *:nth-child(5) { transition-delay: calc(var(--sr-delay) + var(--sr-step) * 4); }
.scroll-reveal--stagger.is-visible > *:nth-child(6),
.scroll-reveal--fade-up-stagger.is-visible > *:nth-child(6) { transition-delay: calc(var(--sr-delay) + var(--sr-step) * 5); }
.scroll-reveal--stagger.is-visible > *:nth-child(n+7),
.scroll-reveal--fade-up-stagger.is-visible > *:nth-child(n+7) { transition-delay: calc(var(--sr-delay) + var(--sr-step) * 6); }

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ───────────────────────────────────────────────────────
   SERVICE SECTION REVEAL（自治体の方へ／企業の方へ）
   - カード自体: ふわっと浮き上がる（lift）
   - 画像: クリップパスで上から下へリビール
   - 画像内: 1.18→1 のケンバーンズ風ズーム
   - バッジ: 遅延してスケールでポップ
   - テキスト: 順次フェードアップ
─────────────────────────────────────────────────────── */
.service-reveal.scroll-reveal--fade-up {
  opacity: 0;
  transform: translate3d(0, 64px, 0) scale(0.95);
  transition:
    opacity 950ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 950ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.service-reveal.scroll-reveal--fade-up.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* 画像エリア：クリップパスでマスクリビール */
/* 自治体側：右から左へカーテンが開く */
.service-reveal .service-photo {
  clip-path: inset(0 0 0 100%);
  transition: clip-path 1100ms cubic-bezier(0.83, 0, 0.17, 1);
  transition-delay: 200ms;
}
/* 企業側：左から右へカーテンが開く */
.service-reveal--kigyo .service-photo {
  clip-path: inset(0 100% 0 0);
}
.service-reveal.is-visible .service-photo,
.service-reveal--kigyo.is-visible .service-photo {
  clip-path: inset(0 0 0 0);
}

/* 画像本体：ケンバーンズ風ズーム */
.service-reveal .service-photo img {
  transform: scale(1.18);
  transform-origin: center center;
  transition: transform 1600ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 200ms;
}
.service-reveal.is-visible .service-photo img {
  transform: scale(1);
}

/* バッジ：遅延してスケールポップ */
.service-reveal .service-photo__badge {
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 500ms ease-out,
    transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: 950ms;
}
.service-reveal.is-visible .service-photo__badge {
  opacity: 1;
  transform: scale(1);
}

/* テキスト内の項目：順次フェードアップ */
.service-reveal .service-text > * {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 600ms ease-out,
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.service-reveal.is-visible .service-text > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.service-reveal.is-visible .service-text > *:nth-child(1) { transition-delay: 450ms; }
.service-reveal.is-visible .service-text > *:nth-child(2) { transition-delay: 540ms; }
.service-reveal.is-visible .service-text > *:nth-child(3) { transition-delay: 630ms; }
.service-reveal.is-visible .service-text > *:nth-child(4) { transition-delay: 720ms; }
.service-reveal.is-visible .service-text > *:nth-child(5) { transition-delay: 810ms; }

@media (prefers-reduced-motion: reduce) {
  .service-reveal .service-photo,
  .service-reveal .service-photo img,
  .service-reveal .service-photo__badge,
  .service-reveal .service-text > * {
    clip-path: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
