html {
  overflow-x: initial;
}

.history-page__container {
  margin-top: 5rem;
}

.scrollTabs {
  overflow-x: auto;
  display: flex;
  flex-wrap: nowrap;
  box-sizing: content-box;
  margin: 0 auto;
  max-width: 93.75rem;
  position: sticky;
  top: min(98px, calc(72px + 6.153vw));
  z-index: 4;
}

.scrollTab {
  background-color: var(--colorBg);
  padding: 0.75rem 1.5rem 0.75rem 2rem;
  font-weight: 700;
  line-height: 1.5;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: color 0.3s;
}

.scrollTab::after {
  content: "";
  background: url(../../images/common/icon-arrow-down-red.svg) no-repeat center center / contain;
  width: 1rem;
  height: 1rem;
  display: inline-block;
}

.scrollTab:last-of-type {
  clip-path: polygon(88% 0, 100% 50%, 88% 100%, 0 100%, 0 0);
}

@media (hover: hover) {
  .scrollTab:hover,
  .scrollTab:focus {
    color: var(--colorRed);
  }
}

.scrollTab span {
  position: absolute;
  top: 0;
  right: 0;
  transform: translateX(50%);
  z-index: 2;
  display: inline-block;
  height: 100%;
  width: fit-content;
}
.scrollTab span img {
  height: 100%;
  position: relative;
  z-index: 2;
}

.scrollTab span img::after {
  content: "";
  background-color: #fff;
  width: 100%;
  height: 100%;
  z-index: 0;
}

@media screen and (max-width: 767px) {
  .scrollTabs {
    top: min(98px, 22.5641vw);
    margin-left: 6.15%;
    padding-left: 0;
  }
}

.line {
  position: relative;
  padding-bottom: 9.5rem;
}

.line::before {
  content: "";
  background-color: #ddd;
  width: 1px;
  height: calc(100% - 5rem);
  position: absolute;
  bottom: 0;
  left: 8.6rem;
  z-index: 0;
}

.history {
  padding-top: 5rem;
  position: relative;
  z-index: 2;
}

.history__container {
  display: flex;
  gap: 4rem;
}

.history:first-of-type {
  padding-top: 4rem;
}

.history__fixedYear {
  writing-mode: vertical-rl;
  position: sticky;
  top: min(178px, calc(140px + 2vw));
  color: var(--colorRed);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.5;
  font-family: var(--familyRobotoCondensed);
  display: inline-block;
  height: fit-content;
  margin-top: 0.5rem;
}

.historyList {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.historyList + .historyList {
  margin-top: 2rem;
}

.historyList + .historyList.no-year {
  margin-top: 0.875rem;
}

.historyList + .historyList.no-month {
  margin-top: 0.5rem;
}

.historyList__year {
  font-family: var(--familyRobotoCondensed);
  color: var(--colorRed);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
  position: relative;
  padding-left: 2rem;
  flex: 0 0 5rem;
  height: 1.5em;
  width: 5rem;
}

.historyList__year.has-year::before,
.historyList__year.has-year::after {
  content: "";
  background-color: var(--colorRed);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.historyList__year.has-year::before {
  opacity: 0.2;
  width: 1rem;
  height: 1rem;
  left: 0;
}

.historyList__year.has-year::after {
  width: 0.5rem;
  height: 0.5rem;
  left: 0.25rem;
  z-index: 2;
}

.historyList__month {
  font-weight: 700;
  line-height: 1.8;
  flex: 0 0 2.5rem;
  text-align: right;
  height: 1.8em;
}

.historyList__text {
  line-height: 1.8;
  font-weight: 400;
  flex: 1;
}

.historyList__details {
  display: flex;
  gap: 1.5rem;
}

.historyList.text-red,
.historyList.text-red .historyList__text {
  color: var(--colorRed);
  font-weight: 700;
}

@media screen and (max-width: 767px) {
  .history-page__container {
    margin-top: var(--size64);
  }

  .scrollTabs {
    padding-bottom: var(--size10);
    margin-bottom: var(--size12);
  }

  .scrollTab {
    padding: var(--size12) var(--size28) var(--size12) var(--size28);
  }

  .line {
    padding-bottom: var(--size96);
  }

  .line::before {
    /* .history, yearsSize, gap */
    height: calc(100% - var(--size24) - var(--size40) - var(--size24));
    left: 1rem;
  }

  .history {
    padding-top: var(--size80);
    position: relative;
    z-index: 2;
  }

  .history__container {
    flex-direction: column;
    gap: var(--size24);
  }

  .history:first-of-type {
    padding-top: 0;
  }

  .history__fixedYear {
    writing-mode: unset;
    position: static;
    top: auto;
    font-size: var(--size28);
    margin-top: 0;
  }

  .historyList {
    align-items: flex-start;
    gap: 0;
    flex-direction: column;
    margin-left: 0.5rem;
  }

  .historyList + .historyList {
    margin-top: var(--size16);
  }

  .historyList + .historyList.no-year {
    margin-top: var(--size10);
  }

  .historyList + .historyList.no-month {
    margin-top: var(--size8);
  }

  .historyList__year {
    font-family: var(--familyRobotoCondensed);
    font-size: var(--size20);
    padding-left: var(--size32);
    flex: unset;
    height: auto;
  }

  .historyList__year.has-year {
    margin-bottom: var(--size14);
  }

  .historyList__year.has-year::before,
  .historyList__year.has-year::after {
    content: "";
    background-color: var(--colorRed);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .historyList__year.has-year::before {
    opacity: 0.2;
    width: 1rem;
    height: 1rem;
    left: 0;
  }

  .historyList__year.has-year::after {
    width: 0.5rem;
    height: 0.5rem;
    left: 0.25rem;
    z-index: 2;
  }

  .historyList__details {
    gap: var(--size8);
    padding-left: var(--size32);
  }

  .historyList__month {
    font-weight: 700;
    line-height: 1.8;
    text-align: left;
    height: auto;
    flex: 0 0 2.5rem;
    text-align: start;
  }

  .historyList__text {
    line-height: 1.8;
    font-weight: 400;
  }
}
