/* css/process-timeline.css */

/* Заголовок этапа — номер + название в строку, гротеск */
.pstep__head { display: flex; align-items: baseline; margin-bottom: var(--space-4); }

.pstep__num {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: var(--fs-body);
  color: var(--c-accent);
  margin-right: 8px;
}

.pstep__title {
  display: inline;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: var(--fs-h4);
  color: var(--c-ink);
  margin: 0;
  letter-spacing: 0;
}

/* Таймлайн — стиль designindc */
.process__timeline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 8px;
  padding-bottom: 8px;
}

.process__arrow {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--c-accent);
  color: var(--c-white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-ui) var(--ease-soft);
}
.process__arrow:hover { background: var(--c-accent-soft); }

.process__track { position: relative; flex: 1; }

/* Толстый жёлоб, по которому ползёт заливка — как в референсе.
   top = (28px кружка − 6px линии) / 2 = 11px */
.process__line {
  position: absolute;
  left: calc(10% - 3px);
  right: calc(10% - 3px);
  top: 11px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c-accent) 12%, transparent);
  overflow: hidden;
}

.process__fill {
  position: absolute;
  left: 0; top: 0; height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--c-accent);
  transition: width 0.7s var(--ease-soft);
}

/* Grid, а не flex+space-between: колонки равной ширины гарантируют,
   что подписи получают ровно свою долю места и переносятся по ней,
   а не наезжают друг на друга при недостатке места под текст */
.process__nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-items: center;
}

.pnode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Кружок: по умолчанию пустой с пунктирной обводкой 1px (будущий этап) */
.pnode__dot {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-bg-milk);
  border: 2px dashed color-mix(in srgb, var(--c-accent) 45%, transparent);
  box-sizing: border-box;
  transition: background var(--dur-ui) var(--ease-soft),
    border-color var(--dur-ui) var(--ease-soft),
    box-shadow var(--dur-ui) var(--ease-soft);
}

/* Пройденный/активный — залитый акцентом */
.pnode.is-active .pnode__dot {
  background: var(--c-accent);
  border: 2px solid var(--c-accent);
  border-style: solid;
}

/* Текущий активный (последний из пройденных) — с кольцом */
.pnode.is-current .pnode__dot {
  box-shadow: 0 0 0 4px var(--c-bg-milk), 0 0 0 6px var(--c-accent);
}

.pnode__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  font-family: var(--f-body);
  font-size: var(--fs-caption);
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
}

.pnode__num {
  font-style: normal;
  font-weight: 700;
  color: var(--c-body-light);
  margin: 0;
  transition: color var(--dur-ui) var(--ease-soft);
}

.pnode__name {
  display: block;
  width: 100%;
  min-width: 0;
  font-weight: 400;
  color: var(--c-body-light);
  transition: color var(--dur-ui) var(--ease-soft);
  hyphens: auto;
}

.pnode.is-active .pnode__num { color: var(--c-accent); }
.pnode.is-active .pnode__name { color: var(--c-ink); }

@media (min-width: 768px) {
  .process__arrow { width: 36px; height: 36px; font-size: 1rem; }
}

/* От 1024 колонка узла ~143px — номер и название встают в строку,
   как в референсе. Ниже 1024 колонка ~119px, там строка не влезает
   и подписи остаются в столбик */
@media (min-width: 1024px) {
  .pnode__label {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    text-align: center;
    font-size: var(--fs-small);
  }

  .pnode__num { display: none; }

  .pnode__name { width: auto; }

  /* Будущие шаги приглушены, как в референсе */
  .pnode:not(.is-active) .pnode__num,
  .pnode:not(.is-active) .pnode__name {
    color: color-mix(in srgb, var(--c-ink) 28%, transparent);
  }
}

@media (max-width: 767.98px) {
  .pnode__name { display: none; }

  .process__arrow { display: none; }
  .pnode__num { display: none; }
  .process__timeline { gap: 0; margin-top: 4px; }
  .pnode__dot { width: 22px; height: 22px; }
  .process__line { top: 8px; }
  .pnode.is-current .pnode__dot {
    box-shadow: 0 0 0 3px var(--c-bg-milk), 0 0 0 5px var(--c-accent);
  }
}
