/* ===========================================
   Story Match — 恩返しCSR 3パターン
   - 原料調達国／製造拠点国／市場販売国への還元
   - csr-value.css のカードパターンを流用、中央02を featured 強調
   =========================================== */

.story-match {
  background-color: var(--color-base);
  position: relative;
  overflow-x: clip;
}

/* 背景：ライム×スカイの淡いブロブ */
.story-match::before {
  content: '';
  position: absolute;
  top: 8%;
  right: -8%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(179, 210, 53, 0.10) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: csrBlobFloat 26s ease-in-out infinite;
}

.story-match::after {
  content: '';
  position: absolute;
  bottom: 10%;
  left: -8%;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 190, 240, 0.08) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation: csrBlobFloat 30s ease-in-out infinite -8s;
}

.story-match > .container {
  position: relative;
  z-index: 1;
}

/* スマホ・タブレットでも見出しを1行で死守（layout.cssのnormal設定を上書き）
   デスクトップ ≥1024px は layout.css 既定の nowrap + フルサイズ */
@media (max-width: 1023px) {
  #story-match-title .section__title-line {
    white-space: nowrap;
    font-size: clamp(0.95rem, 4.6vw, 1.75rem);
    letter-spacing: -0.02em;
  }
}

@media (max-width: 379px) {
  #story-match-title .section__title-line {
    font-size: clamp(0.85rem, 4.4vw, 0.95rem);
  }
}

/* ============================================================
   3カードグリッド
   ============================================================ */
.story-match__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-4);
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .story-match__cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .story-match__cards {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-6);
    align-items: stretch;
  }
}

/* 個別カード */
.story-match__card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: linear-gradient(160deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(245, 250, 252, 0.94) 100%);
  border: 1px solid rgba(34, 190, 240, 0.22);
  border-radius: var(--radius-lg);
  box-shadow:
    0 4px 18px rgba(0, 99, 138, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    border-color 0.3s var(--ease-out);
  overflow: hidden;
}

@media (min-width: 1024px) {
  .story-match__card {
    padding: var(--space-6) var(--space-5) var(--space-5);
  }
}

/* 右上アクセント光 */
.story-match__card::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -70px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(34, 190, 240, 0.20) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.6s var(--ease-out), opacity 0.4s var(--ease-out);
  opacity: 0.6;
}

.story-match__card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 28px 56px rgba(0, 99, 138, 0.16),
    0 8px 20px rgba(34, 190, 240, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
  border-color: rgba(34, 190, 240, 0.55);
}

.story-match__card:hover::before {
  transform: scale(1.6);
  opacity: 1;
}

/* 中央カード（02 製造拠点国）強調 */
.story-match__card--featured {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(179, 210, 53, 0.20) 0%, transparent 70%),
    linear-gradient(160deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(248, 252, 232, 0.96) 100%);
  border-color: rgba(179, 210, 53, 0.55);
  box-shadow:
    0 0 32px rgba(179, 210, 53, 0.28),
    0 16px 40px rgba(0, 99, 138, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.story-match__card--featured::before {
  background: radial-gradient(circle, rgba(179, 210, 53, 0.30) 0%, transparent 70%);
}

@media (min-width: 1024px) {
  .story-match__card--featured {
    transform: translateY(-12px);
  }
  .story-match__card--featured:hover {
    transform: translateY(-18px);
  }
}

/* 番号バッジ */
.story-match__num {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00638A 0%, #007AAB 100%);
  color: var(--color-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    0 4px 12px rgba(0, 99, 138, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  z-index: 3;
}

.story-match__card--featured .story-match__num {
  background: linear-gradient(135deg, var(--color-accent-lime) 0%, var(--color-accent-lime-hover) 100%);
  color: var(--color-text);
  box-shadow:
    0 4px 12px rgba(179, 210, 53, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.50);
}

.story-match__num::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(34, 190, 240, 0.45);
  animation: csrPulse 2.6s ease-out infinite;
  pointer-events: none;
}

.story-match__card--featured .story-match__num::before {
  border-color: rgba(179, 210, 53, 0.55);
}

.story-match__card:nth-child(2) .story-match__num::before { animation-delay: -0.9s; }
.story-match__card:nth-child(3) .story-match__num::before { animation-delay: -1.7s; }

/* アイコン */
.story-match__icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    rgba(34, 190, 240, 0.18) 0%,
    rgba(0, 99, 138, 0.10) 100%);
  border-radius: 18px;
  color: var(--color-text);
  transition:
    transform 0.5s var(--ease-out),
    background 0.3s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
  animation: csrIconFloat 6s ease-in-out infinite;
  box-shadow: 0 6px 16px rgba(34, 190, 240, 0.12);
}

.story-match__card--featured .story-match__icon {
  background: linear-gradient(135deg,
    rgba(179, 210, 53, 0.28) 0%,
    rgba(34, 190, 240, 0.14) 100%);
  box-shadow: 0 6px 16px rgba(179, 210, 53, 0.20);
}

.story-match__card:nth-child(2) .story-match__icon { animation-delay: -2s; }
.story-match__card:nth-child(3) .story-match__icon { animation-delay: -4s; }

.story-match__card:hover .story-match__icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 12px 28px rgba(34, 190, 240, 0.25);
}

.story-match__card--featured:hover .story-match__icon {
  box-shadow: 0 12px 28px rgba(179, 210, 53, 0.32);
}

.story-match__icon svg {
  width: 38px;
  height: 38px;
  stroke: var(--color-text);
  transition: stroke 0.3s var(--ease-out);
}

.story-match__card:hover .story-match__icon svg {
  stroke: var(--color-accent-sky);
}

.story-match__card--featured:hover .story-match__icon svg {
  stroke: var(--color-accent-lime-hover);
}

/* タグ */
.story-match__tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin-bottom: var(--space-2);
  background: rgba(34, 190, 240, 0.12);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

.story-match__card--featured .story-match__tag {
  background: rgba(179, 210, 53, 0.24);
}

/* タイトル */
.story-match__title {
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 2.4vw, 1.375rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin: 0 0 var(--space-2);
  line-height: 1.35;
}

/* コア訴求 */
.story-match__core {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--color-text-sub);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed rgba(0, 99, 138, 0.18);
}

/* 業種チップ群 */
.story-match__industry {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: var(--space-3);
}

.story-match__industry span {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 99, 138, 0.08);
  color: var(--color-text-sub);
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.story-match__card--featured .story-match__industry span {
  background: rgba(179, 210, 53, 0.16);
  color: var(--color-text);
}

/* 広報訴求点 */
.story-match__angle {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--color-text-sub);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: rgba(245, 250, 252, 0.7);
  border-left: 3px solid var(--color-accent-sky);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: auto;
}

.story-match__card--featured .story-match__angle {
  background: rgba(255, 253, 240, 0.7);
  border-left-color: var(--color-accent-lime);
}

.story-match__angle strong {
  display: inline-block;
  margin-right: 0.3rem;
  color: var(--color-text);
  font-weight: 700;
}

/* ============================================================
   下部 CTA + 注記
   ============================================================ */
.story-match__bottom {
  margin-top: var(--space-5);
  text-align: center;
}

@media (min-width: 768px) {
  .story-match__bottom {
    margin-top: var(--space-6);
  }
}

.story-match__bottom-note {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--color-text-sub);
  max-width: 60ch;
  margin: 0 auto var(--space-3);
}

.story-match__bottom-note strong {
  color: var(--color-text);
  font-weight: 700;
}

/* ============================================================
   Reduced Motion — アニメ停止
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .story-match::before,
  .story-match::after,
  .story-match__card,
  .story-match__icon,
  .story-match__num::before {
    animation: none !important;
    transition: none !important;
  }
}
