/* Изолированные стили для шорткода */
.history-timeline-wrapper {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 20px 0;
  overflow: visible;
}

/* Track */
.history-timeline-wrapper .history__track {
  --dot: 18px;
  --stem: 40px;
  --gap: 0px;
  --slide: 340px;
  --slide-gap: 56px;
  --pad: 56px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--items-count, 7), 1fr);
  column-gap: 0;
  min-height: 420px;
  height: auto;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: visible;
}

/* Ширина слайда 200px для 1200–1600px */
@media (min-width: 1200px) and (max-width: 1600px) {
  .history-timeline-wrapper .history__track {
    --slide: 200px;
    grid-template-columns: repeat(var(--items-count, 7), 200px);
  }

}

/* GSAP горизонтальный скролл: экраны до 1200px */
@media (max-width: 1200px) {
  .history-timeline-wrapper.history-timeline-wrapper--gsap {
    overflow: hidden;
  }

  .history-timeline-wrapper--gsap .history__pin-wrap {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
  }

  .history-timeline-wrapper--gsap .history__track {
    --timeline-width: 2100px;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: var(--slide);
    column-gap: var(--slide-gap);
    width: var(--timeline-width);
    max-width: var(--timeline-width);
    min-width: var(--timeline-width);
    min-height: 500px;
    padding: 0 var(--pad);
    will-change: transform;
  }

  .history-timeline-wrapper--gsap .history__track-inner {
    display: contents;
  }
}

/* Десктоп: обычная сетка, без GSAP */
@media (min-width: 1201px) {
  .history-timeline-wrapper .history__pin-wrap {
    /* Без pin на десктопе */
  }
}

.history-timeline-wrapper .history__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 8%,
    rgba(255, 255, 255, 1) 18%,
    rgba(255, 255, 255, 1) 82%,
    rgba(255, 255, 255, 0.45) 92%,
    rgba(255, 255, 255, 0) 100%
  );
}

@media (max-width: 1200px) {
  .history-timeline-wrapper .history__line {
    left: var(--pad);
    right: auto;
    width: calc(var(--items-count, 7) * var(--slide) + (var(--items-count, 7) - 1) * var(--slide-gap));
  }

  .history-timeline-wrapper--gsap .history__line {
    width: calc(2100px - 2 * var(--pad));
  }
}

.history-timeline-wrapper .history__item {
  position: relative;
  padding: 0 12px;
  overflow: visible; /* Позволяем контенту выходить за границы */
}

@media (max-width: 1200px) {
  .history-timeline-wrapper:not(.history-timeline-wrapper--gsap) .history__item {
    scroll-snap-align: start;
  }
}

.history-timeline-wrapper .history__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--dot);
  height: var(--dot);
  border-radius: 999px;
  background: #f2f2f2;
  transform: translate(-50%, -50%) scale(1) !important; /* Явно показываем */
  opacity: 1 !important;
  visibility: visible !important;
}

.history-timeline-wrapper .history__stem {
  position: absolute;
  left: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
  transform: translateX(-50%) scaleY(1) !important; /* Явно показываем */
  opacity: 1 !important;
  visibility: visible !important;
}

.history-timeline-wrapper .history__item--top .history__stem {
  top: calc(50% - var(--stem));
  height: var(--stem);
}

.history-timeline-wrapper .history__item--bottom .history__stem {
  top: 50%;
  height: var(--stem);
}

/* Year */
.history-timeline-wrapper .history__year {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(0) !important; /* Убираем смещения */
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.28);
  user-select: none;
  white-space: nowrap;
  opacity: 1 !important;
  visibility: visible !important;
}

.history-timeline-wrapper .history__year--top {
  top: calc(50% - 38px);
}

.history-timeline-wrapper .history__year--bottom {
  top: calc(50% + 24px);
}

/* Content */
.history-timeline-wrapper .history__content {
  width: 200px;
  padding-bottom: 40px;
  padding-top: 40px;
  opacity: 1 !important; /* Явно делаем видимым */
  visibility: visible !important; /* Явно делаем видимым */
  transform: translateY(0) !important; /* Убираем смещения */
}

.history-timeline-wrapper .history__item--top .history__content {
  position: absolute;
  left: 50%;
  bottom: calc(50% + var(--stem) + var(--gap));
  transform: translateX(-50%);
}

.history-timeline-wrapper .history__item--bottom .history__content {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--stem) + var(--gap));
  transform: translateX(-50%);
}

.history-timeline-wrapper .history__item:nth-of-type(1) .history__content {
  left: 0;
  transform: none;
}

.history-timeline-wrapper .history__item:last-of-type .history__content {
  left: auto;
  right: 0;
  transform: none;
}

.history-timeline-wrapper .history__title {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.history-timeline-wrapper .history__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 1100px) {
  .history-timeline-wrapper .history__track {
    min-height: 520px;
    height: auto;
  }
}

@media (max-width: 1024px) {
  .history-timeline-wrapper .history__track {
    --slide: 340px;
    --slide-gap: 56px;
    --pad: 56px;
  }
}

@media (max-width: 600px) {
  .history-timeline-wrapper .history__track {
    --slide-gap: 0px;
    --pad: 6px;
    --slide: 280px;
  }
}

