.timelinesection, ::after, ::before {
  box-sizing: border-box;
  font-size: .95em;
}

.timeline {
  --timeline-color: #9bc;
  position: relative;
  list-style: none;
  display: inline-flex;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
  height: 240px;
}

/* middle line */

.timeline:before {
  content: "";
  position: absolute;
  top: calc(50% + 8px);
  width: 100%;
  height: 2px;
  background: var(--bs-primary);
}

.timeline li {
  border: 1px var(--bs-primary) solid;
  color: var(--bs-primary);
  background: #fff;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-self: flex-start;
  border-radius: 10px;
}

.timeline li:not(:last-child) {
  margin: 0 -50px 0 0;
}

/* event in even position are bottom-aligned */

.timeline li:nth-child(2n), .timeline li:nth-child(2n) div {
  align-self: flex-end;
}

.timeline div {
  position: relative;
  width: 200px;
  padding: 10px;
  text-align: left;
}

/* style for the dot over the timeline */

.timeline li:before {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: 10px;
  margin-left: 100px;
  transform: translate(-50%, -50%);
  border: 1px #9bc solid;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bs-primary);
  cursor: pointer;
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--bs-primary);
}

/* style for the event arrow */

.timeline div:before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 800%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -1px) rotateZ(45deg);
  background: #fff;
}

/* position of the event arrow in odd position */

.timeline li:nth-child(2n - 1) div:before {
  top: 100%;
  margin-top: -8px;
  border-right: 1px var(--bs-primary) solid;
  border-bottom: 1px var(--bs-primary) solid;
}

/* position of the event arrow in even position */

.timeline li:nth-child(2n) div:before {
  top: 0;
  margin-top: -10px;
  border-left: 1px var(--bs-primary) solid;
  border-top: 1px var(--bs-primary) solid;
}

.timeline .detail {
  display: none;
  font-size: small;
}

.timeline li:hover {
  cursor: pointer;
  height: 200px;
  z-index: 2;
  background: #fff;
}

.timeline li:hover .detail {
  display: block;
}

.timeline li:hover {
  color: #fff;
  background: var(--timeline-color);
}

.timeline li:hover::before, .timeline li:hover div::before {
  display: none;
}

