/* ═══════════════════════════════════════════════════════════
   PROCESS — process.css  (본사 통합 가맹점 관리 프로세스 7스텝 타임라인)
   · #problem 다음, section--tint(연노랑) → 흰 원 + 골드 게이지.
   · 7스텝 2줄(01~03 / 04~07) + 줄 끝 화살표. 원 둘레 진행 게이지(SVG 호).
   · hover: 게이지 회색→골드 슉 + 원 강조 / 자동순환: 3s마다 펄스+게이지(process.js)
   · 검정·이모지 없음, transform/opacity/stroke 위주. 레드는 활성 포인트만.
═══════════════════════════════════════════════════════════ */

.timeline {
  --tcircle: clamp(104px, 11vw, 140px);
  --tgap: clamp(26px, 4.5vw, 72px); /* 스텝 간 간격 = 연결선 길이와 공유 */
  background: var(--color-bg-tint, #fff7e0); /* 연노랑 — 앞 #franchise-support(흰)·뒤 #price-nego(흰)와 교차. (section--tint 가 후행 로드로 무력화되던 것 명시 복원) */
  scroll-margin-top: 80px;
}

/* ── 헤드: 대제목(좌) + 라벨 배지(우) ── */
.timeline__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center; /* 대제목 가운데 정렬 */
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto 56px;
}
.timeline__title {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 900;
  line-height: 1.4;
  color: var(--color-text, #1a1a1a);
  margin: 0;
  word-break: keep-all;
}
.timeline__title em {
  font-style: normal;
  color: var(--gold, #f0c000);
}
.timeline__label {
  flex-shrink: 0;
  align-self: center;
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold, #f0c000) 16%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--gold, #f0c000) 40%, #ffffff);
  color: var(--gold-dark, #c9a000);
  font-size: 0.9rem;
  font-weight: 800;
  word-break: keep-all;
}

/* ── 2줄 타임라인 ── */
.timeline__rows {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vw, 56px);
  max-width: 1160px;
  margin: 0 auto;
}
.timeline__row {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center; /* 스텝 묶음 가운데 정렬(윗줄 3개·아랫줄 4개 모두 중앙) */
  gap: var(--tgap);
}
/* (데스크톱 연결선은 스텝별 ::after 로 그림 — 가운데 정렬에서도 정확히 연결.
   ::before 는 모바일 세로선 전용, 데스크톱은 보이지 않음) */
.timeline__row::before {
  content: '';
  position: absolute;
}
/* 줄 끝 화살표(노드 라인 위) */
.timeline__arrow {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: -8px;
  color: var(--gold, #f0c000);
  position: relative;
  z-index: 1;
}
.timeline__arrow svg {
  display: block;
  width: 26px;
  height: 26px;
}

/* ── 스텝 ── */
.tstep {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
/* 스텝 간 연결선(노드 → 다음 노드). 가운데 정렬과 무관하게 정확히 연결 */
.tstep::after {
  content: '';
  position: absolute;
  top: 4px; /* 노드(점) 높이 */
  left: 50%;
  width: calc(var(--tcircle) + var(--tgap)); /* 다음 노드 중심까지 */
  height: 2px;
  background: color-mix(in srgb, var(--gold, #f0c000) 34%, #ffffff);
  z-index: 0;
}
/* 줄 마지막 스텝은 화살표까지만 짧게 */
.tstep:last-of-type::after {
  width: calc(var(--tcircle) / 2 + var(--tgap));
}
.tstep__label {
  font-family: var(--font-en, sans-serif);
  font-size: clamp(0.74rem, 1vw, 0.86rem);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-dark, #c9a000);
  transition: color 0.3s ease;
}
/* 노드 점 — 라벨과 원 사이, 선 위 */
.tstep__node {
  position: relative;
  z-index: 1; /* 연결선(::after) 위 */
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid color-mix(in srgb, var(--gold, #f0c000) 50%, #ffffff);
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

/* 원(게이지 + 이름) — 버튼(키보드/터치) */
.tstep__circle {
  position: relative;
  width: var(--tcircle);
  height: var(--tcircle);
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.tstep__circle:focus-visible {
  outline: 2px solid var(--gold, #f0c000);
  outline-offset: 3px;
}
/* 진행 게이지(SVG 호) */
.tstep__gauge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* 12시 방향 시작 */
}
.tstep__track {
  fill: none;
  stroke: #e7e3d4;
  stroke-width: 6;
}
.tstep__prog {
  fill: none;
  stroke: var(--gold, #f0c000);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2π·45 ≈ 283 */
  stroke-dashoffset: 283; /* 평소 비어있음(회색 트랙만) */
  transition:
    stroke-dashoffset 0.5s ease,
    stroke 0.3s ease;
}
.tstep__name {
  position: relative;
  z-index: 1;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--color-text, #1a1a1a);
  text-align: center;
  padding: 0 12px;
  word-break: keep-all;
}

/* ── 활성/hover — 게이지 슉 차오름 + 원 강조 ── */
.tstep.is-active .tstep__prog,
.tstep:hover .tstep__prog {
  stroke-dashoffset: 0; /* 골드 진행분 가득 차오름 */
}
.tstep:hover .tstep__circle {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(240, 192, 0, 0.28);
}
.tstep.is-active .tstep__circle {
  box-shadow: 0 12px 28px rgba(240, 192, 0, 0.3);
  animation: tstepPulse 0.6s ease;
}
.tstep.is-active .tstep__node,
.tstep:hover .tstep__node {
  background: var(--gold, #f0c000);
  border-color: var(--gold-dark, #c9a000);
}
/* 활성 스텝 라벨 — 레드 포인트 */
.tstep.is-active .tstep__label {
  color: var(--color-point-red, #e23b34);
}
@keyframes tstepPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* ── prefers-reduced-motion: 펄스·자동순환 정지, 게이지 최종(가득) 정적 ── */
@media (prefers-reduced-motion: reduce) {
  .tstep__circle {
    transition: none !important;
  }
  .tstep.is-active .tstep__circle {
    animation: none !important;
    transform: none !important;
  }
  .tstep__prog {
    transition: none !important;
    stroke-dashoffset: 0; /* 최종 상태(가득) 정적 표시 */
  }
}

/* ═══════════════════════════════════════════════════════════
   반응형 — 모바일: 가로 → 세로 타임라인(겹침 방지)
═══════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  .timeline__head {
    margin-bottom: 40px;
  }
  .timeline__rows {
    gap: 0;
  }
  .timeline__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  /* 데스크톱 가로 연결선(스텝별) 숨김 */
  .tstep::after {
    display: none;
  }
  /* 세로 연결선(왼쪽, 원 중심) */
  .timeline__row::before {
    position: absolute;
    left: calc(var(--tcircle) / 2);
    top: 0;
    bottom: 0;
    width: 2px;
    background: color-mix(in srgb, var(--gold, #f0c000) 34%, #ffffff);
    z-index: 0;
  }
  /* 줄 끝 화살표 — 세로에선 숨김(겹침/혼란 방지) */
  .timeline__arrow {
    display: none;
  }
  .tstep {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    width: 100%;
  }
  /* 라벨은 원 옆으로 */
  .tstep__label {
    order: 3;
  }
  .tstep__node {
    display: none;
  }
}
@media (max-width: 760px) {
  .timeline {
    --tcircle: clamp(92px, 26vw, 116px);
  }
}
