/* ═══════════════════════════════════════
   テイスペ！婚活ステップバー  v2.0.0
   tsb- prefix — isolated from JIN:R theme
   ブルー基調 × ウォームニュートラル
═══════════════════════════════════════ */

/* ─── Design Tokens ─── */
.tsb-widget,
.tsb-cta {
  /* Brand Blue */
  --tsb-blue-50:    #EBF7FF;
  --tsb-blue-100:   #C8EBFC;
  --tsb-blue-200:   #A0DAFC;
  --tsb-blue-300:   #7DCEF7;
  --tsb-blue-400:   #4DBBF5;
  --tsb-blue-500:   #2BAAE8;
  --tsb-blue-600:   #1A8DC7;

  /* Warm Neutrals（冷たいグレーをアイボリー寄りに） */
  --tsb-warm-50:    #FAF9F7;
  --tsb-warm-100:   #F5F2ED;
  --tsb-warm-200:   #EDE9E2;
  --tsb-warm-300:   #D9D0C5;
  --tsb-warm-400:   #A89A8C;
  --tsb-warm-500:   #6E6055;
  --tsb-warm-700:   #3C2F24;
  --tsb-warm-900:   #1D1410;

  /* Semantic */
  --tsb-surface:    #FFFFFE;
  --tsb-border:     var(--tsb-warm-200);
  --tsb-text-h:     var(--tsb-warm-900);
  --tsb-text-body:  var(--tsb-warm-500);
  --tsb-text-muted: var(--tsb-warm-400);

  /* Shadows */
  --tsb-shadow-blue: rgba(43, 170, 232, 0.28);
  --tsb-glow-blue:   rgba(43, 170, 232, 0.18);

  --tsb-node-size: 48px;
  --tsb-radius:    10px;
}

/* ─── Widget container ─── */
.tsb-widget {
  width: 100%;
  background: var(--tsb-surface);
  border: 1px solid var(--tsb-border);
  border-radius: 16px;
  padding: 24px 32px 22px;
  box-shadow:
    0 1px 3px  rgba(29, 20, 16, 0.05),
    0 4px 16px rgba(29, 20, 16, 0.07),
    0 12px 40px rgba(29, 20, 16, 0.04);
  margin-bottom: 28px;
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', 'Yu Gothic Medium', 'Meiryo', sans-serif;
  box-sizing: border-box;
}
.tsb-widget *,
.tsb-widget *::before,
.tsb-widget *::after {
  box-sizing: border-box;
}

/* ─── Widget header ─── */
.tsb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tsb-header-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tsb-text-muted);
  margin: 0;
  padding: 0;
}
.tsb-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tsb-blue-50);
  color: var(--tsb-blue-600);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 12px;
  border-radius: 100px;
  border: 1px solid var(--tsb-blue-100);
}
.tsb-header-badge svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: var(--tsb-blue-600);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}

/* ─── SVG icons ─── */
.tsb-icon {
  width: 20px;
  height: 20px;
  display: block;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.tsb-step.done     .tsb-icon { stroke: #FFFFFF; }
.tsb-step.current  .tsb-icon { stroke: var(--tsb-blue-500); }
.tsb-step.inactive .tsb-icon { stroke: var(--tsb-warm-300); }

/* ─── Steps list ─── */
.tsb-steps {
  list-style: none;
  display: flex;
  align-items: flex-start;
  position: relative;
  margin: 0;
  padding: 0;
}

/* ベースライン（ウォームグレー） */
.tsb-steps::before {
  content: '';
  position: absolute;
  top: calc(var(--tsb-node-size) / 2);
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--tsb-warm-200);
  border-radius: 100px;
}

/* 完了ライン（ブルーグラデーション・幅は --tsb-step で動的計算） */
.tsb-steps::after {
  content: '';
  position: absolute;
  top: calc(var(--tsb-node-size) / 2);
  left: 10%;
  width: calc((var(--tsb-step, 1) - 1) * 20%);
  height: 3px;
  background: linear-gradient(90deg, var(--tsb-blue-600) 0%, var(--tsb-blue-400) 70%, var(--tsb-blue-300) 100%);
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* ─── Step item ─── */
.tsb-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  animation: tsbStepIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.tsb-step:nth-child(1) { animation-delay: 0.05s; }
.tsb-step:nth-child(2) { animation-delay: 0.13s; }
.tsb-step:nth-child(3) { animation-delay: 0.21s; }
.tsb-step:nth-child(4) { animation-delay: 0.29s; }
.tsb-step:nth-child(5) { animation-delay: 0.37s; }
@keyframes tsbStepIn {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ─── Node（丸） ─── */
.tsb-node {
  width: var(--tsb-node-size);
  height: var(--tsb-node-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

/* 完了：ブルーグラデーション + 多層シャドウ */
.tsb-step.done .tsb-node {
  background: linear-gradient(135deg, var(--tsb-blue-500) 0%, var(--tsb-blue-400) 55%, var(--tsb-blue-300) 100%);
  box-shadow:
    0 2px 8px  var(--tsb-shadow-blue),
    0 6px 20px rgba(43, 170, 232, 0.18);
}

/* 現在地：白地 + ブルーリング + glow パルス */
.tsb-step.current .tsb-node {
  background: var(--tsb-surface);
  border: 2.5px solid var(--tsb-blue-500);
  animation: tsbNodePulse 3s ease-in-out infinite;
}
@keyframes tsbNodePulse {
  0%, 100% {
    box-shadow:
      0 0 0 5px rgba(43, 170, 232, 0.16),
      0 4px 16px rgba(43, 170, 232, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(43, 170, 232, 0.05),
      0 4px 16px rgba(43, 170, 232, 0.07);
  }
}

/* 未完了：ウォームグレー背景 */
.tsb-step.inactive .tsb-node {
  background: var(--tsb-warm-100);
  border: 1.5px solid var(--tsb-warm-200);
}

/* ─── "今ここ" バッジ ─── */
.tsb-now-badge {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tsb-blue-500);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
  pointer-events: none;
  animation: tsbBadgeFadeIn 0.35s ease 0.55s both;
}
@keyframes tsbBadgeFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}

/* ─── Step content（ラベル） ─── */
.tsb-content {
  margin-top: 10px;
  text-align: center;
  width: 100%;
  padding: 0 4px;
}
.tsb-num {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--tsb-text-muted);
  text-transform: uppercase;
  margin: 0;
  padding: 0;
}
.tsb-title {
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
  margin-bottom: 0;
  line-height: 1.4;
  color: var(--tsb-text-h);
  padding: 0;
}
.tsb-step.inactive .tsb-num   { color: var(--tsb-warm-300); }
.tsb-step.inactive .tsb-title { color: var(--tsb-warm-300); }

/* 現在地カード */
.tsb-step.current .tsb-content {
  background: linear-gradient(160deg, var(--tsb-blue-50) 0%, rgba(235,247,255,0.5) 100%);
  border: 1.5px solid var(--tsb-blue-100);
  border-radius: var(--tsb-radius);
  padding: 8px 10px 10px;
  box-shadow: 0 4px 12px rgba(43, 170, 232, 0.10);
  position: relative;
}
/* カード上部の三角 */
.tsb-step.current .tsb-content::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--tsb-blue-100);
}
.tsb-step.current .tsb-num   { color: var(--tsb-blue-500); }
.tsb-step.current .tsb-title { color: var(--tsb-blue-600); font-size: 12.5px; font-weight: 800; }

/* ─── Progress footer ─── */
.tsb-footer { margin-top: 22px; }

.tsb-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--tsb-text-muted);
  margin-bottom: 8px;
  padding: 0;
}
.tsb-progress-step { font-weight: 700; color: var(--tsb-blue-500); }
.tsb-progress-pct  { font-size: 10px;  color: var(--tsb-warm-400); }

.tsb-track {
  height: 6px;
  background: var(--tsb-warm-100);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.tsb-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--tsb-blue-600) 0%, var(--tsb-blue-400) 75%, var(--tsb-blue-300) 100%);
  border-radius: 100px;
  animation: tsbFillBar 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
  position: relative;
  overflow: hidden;
}
@keyframes tsbFillBar {
  to { width: calc((var(--tsb-step, 1) - 1) * 20%); }
}
/* shine */
.tsb-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -70%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
  animation: tsbShine 2.4s ease 1.6s infinite;
}
@keyframes tsbShine { to { left: 130%; } }

/* ═══════════════════════════════════════
   CTA
═══════════════════════════════════════ */
.tsb-cta {
  background: var(--tsb-surface);
  border: 1px solid var(--tsb-border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow:
    0 1px 3px  rgba(29, 20, 16, 0.04),
    0 4px 12px rgba(29, 20, 16, 0.05);
  margin-top: 8px;
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', 'Yu Gothic Medium', 'Meiryo', sans-serif;
  box-sizing: border-box;
}
.tsb-cta *,
.tsb-cta *::before,
.tsb-cta *::after {
  box-sizing: border-box;
}

/* ─── STEP1・2：内部リンク型 ─── */
.tsb-cta-internal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tsb-cta-eyebrow {
  font-size: 10px;
  color: var(--tsb-text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}
.tsb-cta-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--tsb-text-h);
  line-height: 1.4;
  margin: 0;
  padding: 0;
}

/* ゴーストボタン（内部リンク） */
.tsb-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--tsb-blue-500);
  border: 1.5px solid var(--tsb-blue-400);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.tsb-btn-ghost:hover {
  background: var(--tsb-blue-500);
  color: #fff;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ─── STEP3〜5：2択型 ─── */
.tsb-cta-lead {
  font-size: 11px;
  color: var(--tsb-text-muted);
  margin-bottom: 12px;
  padding: 0;
}
.tsb-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tsb-dual-card {
  background: linear-gradient(160deg, var(--tsb-blue-50) 0%, #fffffe 100%);
  border: 1.5px solid var(--tsb-blue-100);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tsb-dual-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(43, 170, 232, 0.14);
}
.tsb-dual-icon {
  font-size: 24px;
  line-height: 1;
}
.tsb-dual-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--tsb-text-h);
  line-height: 1.3;
  margin: 0;
  padding: 0;
}
.tsb-dual-sub {
  font-size: 10.5px;
  color: var(--tsb-text-body);
  line-height: 1.55;
  flex: 1;
  margin: 0;
  padding: 0;
}

/* 「他も比較する」テキストリンク */
.tsb-dual-more {
  display: block;
  text-align: center;
  font-size: 10px;
  color: var(--tsb-text-muted);
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.2s;
}
.tsb-dual-more:hover {
  color: var(--tsb-blue-500);
  text-decoration: underline;
}

/* ソリッドボタン（アフィリエイト） */
.tsb-btn-solid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--tsb-blue-500) 0%, var(--tsb-blue-400) 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 0;
  border-radius: 100px;
  text-decoration: none;
  width: 100%;
  margin-top: 2px;
  box-shadow: 0 3px 10px var(--tsb-shadow-blue);
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}
.tsb-btn-solid:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--tsb-shadow-blue);
  text-decoration: none;
  color: #fff;
}

/* ═══════════════════════════════════════
   MOBILE（≤600px）コンパクト横並び
═══════════════════════════════════════ */
@media (max-width: 600px) {

  .tsb-widget {
    padding: 14px 10px 12px;
    border-radius: 14px;
  }

  .tsb-header { margin-bottom: 12px; }

  /* ラインをモバイルノード中心に合わせる */
  .tsb-steps::before { top: 18px; left: 8%; right: 8%; height: 2px; }
  .tsb-steps::after  { top: 18px; left: 8%; height: 2px; }

  /* ノード縮小 */
  .tsb-node {
    width: 36px !important;
    height: 36px !important;
  }
  .tsb-icon { width: 14px !important; height: 14px !important; }

  /* ラベル：番号のみ。現在地だけタイトル表示 */
  .tsb-content { margin-top: 6px; }
  .tsb-num { font-size: 9px; }
  .tsb-title { display: none; }
  .tsb-step.current .tsb-title {
    display: block;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tsb-step.current .tsb-content {
    padding: 4px 6px 6px;
    border-radius: 7px;
  }
  .tsb-step.current .tsb-content::before { display: none; }

  /* 今ここバッジ：モバイルでは非表示 */
  .tsb-now-badge { display: none; }

  /* フッター */
  .tsb-footer { margin-top: 12px; }
  .tsb-progress-label { font-size: 10px; }
  .tsb-track { height: 4px; }

  /* CTA */
  .tsb-cta { padding: 12px 14px; }
  .tsb-cta-internal {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tsb-btn-ghost {
    width: 100%;
    justify-content: center;
  }
  .tsb-dual-grid {
    grid-template-columns: 1fr; /* 2列→1列 */
    gap: 10px;
  }
  .tsb-btn-solid {
    font-size: 13px;
    padding: 12px 0;
  }
}

/* ═══════════════════════════════════════
   ガイドボックス（STEP3以降・記事中盤）
═══════════════════════════════════════ */
.tsb-guide-box {
  position: relative;
  background: var(--tsb-blue-50);
  border: 1px solid var(--tsb-blue-100);
  border-left: 3px solid var(--tsb-blue-400);
  border-radius: 6px;
  padding: 8px 32px 8px 12px;
  margin: 16px 0;
  font-family: 'Noto Sans JP', -apple-system, 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', 'Yu Gothic Medium', 'Meiryo', sans-serif;
  box-sizing: border-box;
}
.tsb-guide-box * { box-sizing: border-box; }

.tsb-guide-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--tsb-warm-400);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.tsb-guide-close:hover { color: var(--tsb-warm-700); }

.tsb-guide-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tsb-text-h);
  margin: 0 0 5px;
  padding: 0;
  line-height: 1.5;
}
.tsb-guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tsb-guide-link {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tsb-blue-600);
  text-decoration: none;
  background: var(--tsb-surface);
  border: 1.5px solid var(--tsb-blue-200);
  border-radius: 100px;
  padding: 3px 11px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tsb-guide-link:hover {
  background: var(--tsb-blue-500);
  color: #fff;
  border-color: var(--tsb-blue-500);
  text-decoration: none;
}

/* ═══════════════════════════════════════
   ステップノード ツールチップ
═══════════════════════════════════════ */
.tsb-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tsb-warm-900);
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  z-index: 20;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
/* 下向き三角 */
.tsb-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--tsb-warm-900);
}
.tsb-tooltip-text {
  display: block;
  line-height: 1.5;
}
.tsb-tooltip-link {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--tsb-blue-200);
  text-decoration: none;
}
.tsb-tooltip-link:hover {
  color: #fff;
  text-decoration: underline;
}
