/* The actual timeline (the vertical ruler) */
.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0;
}

/* The actual timeline (the vertical ruler) */
.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background-color: var(--primary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
}

/* Container around content */
.timeline-element {
  padding: 10px 50px;
  position: relative;
  background-color: inherit;
  width: 50%;
}

.timeline-element:nth-child(odd) {
  left: 0;
}

.timeline-element:nth-child(even) {
  left: 50%;
}

/* The circles on the timeline */
.timeline-element .timeline-container::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -63px;
  background-color: var(--entry-color);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

/* Add arrows to the left container (pointing right) */
.timeline-element:nth-child(odd) .timeline-container::before {
  content: ' ';
  height: 0;
  position: absolute;
  top: 18px;
  width: 0;
  z-index: 1;
  right: -10px;
  border: medium solid var(--entry-color);
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent var(--entry-color);
}

/* Add arrows to the right container (pointing left) */
.timeline-element:nth-child(even) .timeline-container::before {
  content: ' ';
  height: 0;
  position: absolute;
  top: 18px;
  width: 0;
  z-index: 1;
  left: -10px;
  border: medium solid var(--entry-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--entry-color) transparent transparent;
}

/* Fix the circle for containers on the right side */
.timeline-element:nth-child(even) .timeline-container::after {
  left: -63px;
}

.timeline-element:nth-child(even) .timeline-year {
  left: -12.5em;
  margin-right: 0px;
}

.timeline-element:nth-child(odd) .timeline-year {
  right: -100%;
  margin-left: -4em;
}

.timeline-year {
  z-index: 1;
  position: relative;
  width: fit-content;
  margin: 2em;
  padding: 1em 5em;
  border: medium solid var(--primary-color);
  background-color: white;
  border-radius: 5px;
}

/* The actual content */
.timeline-content {
  background-color: white;
  position: relative;
  border-radius: 6px;
  border: 5px solid var(--entry-color);
}

.bazar-card .timeline-content .content {
  position: relative;
}

/* Media queries - Responsive timeline on screens less than 600px wide */
@media screen and (max-width: 768px) {
  /* Place the timelime to the left */
  .timeline::after {
    left: 31px;
  }

  /* Full-width containers */
  .timeline-element {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  /* Make sure that all arrows are pointing leftwards */
  .timeline-element:nth-child(odd) .timeline-container::before,
  .timeline-element:nth-child(even) .timeline-container::before {
    left: -10px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--entry-color) transparent transparent;
  }

  /* Make sure all circles are at the same spot */
  .timeline-element:nth-child(odd) .timeline-container::after,
  .timeline-element:nth-child(even) .timeline-container::after {
    left: -53px;
  }

  /* Make all right containers behave like the left ones */
  .timeline-element:nth-child(even) {
    left: 0%;
  }

  .timeline-year {
    padding: 1em 5em;
  }

  .timeline-element:nth-child(even) .timeline-year,
  .timeline-element:nth-child(odd) .timeline-year {
    left: 0%;
    margin: 2em auto;
  }
}
