/**
 * TODO: This will most likely overlap with card, not created yet.
 */

.timeline-wrapper {
  container-name: timeline;
  container-type: inline-size;
  margin-bottom: var(--size-xl);
}

.timeline {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: calc(1.5 * var(--size-m));
  margin: 0 auto;

  &::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 50%;
    width: 1px;
    background-color: var(--neutral50);
  }
}

.timeline-entry {
  box-sizing: border-box;
  position: relative;
  max-width: 400px;
  padding: var(--size-m);
  border: 1px solid var(--neutral90);
  margin: 0 auto;
  background-color: var(--global-background-color);
  box-shadow: var(--shadow-down);
  /* transition: all ease-in-out 0.5s; */

  &::before {
    content: "";
    position: absolute;
    inset: calc(var(--size-s) * -1) auto auto calc(50% - 6px);
    z-index: 2;
    width: var(--size-s);
    height: var(--size-s);
    border: 2px solid var(--neutral50);
    border-radius: 50%;
    background-color: var(--neutral100);
  }
}

.timeline-entry-heading {
  margin: calc(0.5 * var(--size-xs)) 0;
}

.timeline-entry-heading-pre,
.timeline-entry-heading-post {
  font-size: var(--text-size-s);
  color: var(--base-text-light);
}

.timeline-entry-heading-pre {
  text-transform: uppercase;
}

.timeline-entry-footer {
  & > a {
    display: block;
  }
}

.timeline-entry-content > *:last-child {
  margin-bottom: 0;
}

/* , .timeline-entry-footer {} */

@container timeline (width > 399px) {
  .timeline {
    gap: var(--size-xl);
  }
}

@container timeline (width > 599px) {
  .timeline {
    width: 568px;
  }

  .timeline-entry:nth-of-type(even) {
    margin-right: 0;

    &::before {
      left: 109px;
    }
  }

  .timeline-entry:nth-of-type(odd) {
    margin-left: 0;
    &::before {
      left: 277px;
    }
  }
}

@container timeline (width > 847px) {
  .timeline {
    width: 848px;
  }

  .timeline-entry:nth-of-type(even),
  .timeline-entry:nth-of-type(odd) {
    &::before {
      top: 21px;
    }

    &::after {
      content: "";
      position: absolute;
      left: -19px;
      top: 26px;
      width: 17px;
      height: 1px;
      background-color: var(--neutral50);
    }
  }

  .timeline-entry:nth-of-type(even) {
    &::before {
      left: -31px;
    }

    &::after {
      left: -19px;
    }
  }

  .timeline-entry:nth-of-type(odd) {
    &::before {
      left: 417px;
    }
    &::after {
      left: 400px;
    }
  }
}
