.timeline {
  --timeline-axis: 50%;
  --timeline-background: #fff;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    z-index: 0;
    top: 40px;
    bottom: 0;
    left: var(--timeline-axis);
    width: 1px;
    background: #111;
    transform: translateX(-50%);
    pointer-events: none;
  }
}

.timeline-item {
  position: relative;
  width: 100%;
  margin-bottom: 50px;

  &:nth-child(even) {

    .timeline-content {
      float: right;
      padding: 20px;

      .date {
        right: auto;
        left: 0;
      }

      &::after {
        content: '';
        position: absolute;
        top: 30px;
        left: -15px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 10px 15px 10px 0;
        border-color: transparent #f1f1f1 transparent transparent;
      }
    }
  }

  /* Verdeckt die Linie unterhalb des letzten Punktes. */
  &:last-child::before {
    content: '';
    position: absolute;
    z-index: 1;
    top: 40px;
    bottom: -50px;
    left: var(--timeline-axis);
    width: 3px;
    background: var(--timeline-background);
    transform: translateX(-50%);
    pointer-events: none;
  }

  &::after {
    content: '';
    display: block;
    clear: both;
  }
}

.timeline-content {
  position: relative;
  z-index: 2;
  width: 46%;
  padding: 20px;
  background: #f1f1f1;

  &::after {
    content: '';
    position: absolute;
    top: 30px;
    right: -15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent #f1f1f1;
  }
}

.timeline-img {
  position: absolute;
  z-index: 3;
  top: 25px;
  left: var(--timeline-axis);
  width: 30px;
  height: 30px;
  margin: 0;
  background: #111;
  border-radius: 50%;
  transform: translateX(-50%);
}

.timeline-card {
  padding: 0 !important;

  p {
    padding: 0 20px;
  }

  a {
    margin-left: 20px;
  }
}

.timeline-img-header {
  position: relative;
  height: 200px;
  margin-bottom: 20px;

  h2 {
    position: absolute;
    bottom: 5px;
    left: 20px;
    color: $text;
  }
}

blockquote {
  margin-top: 30px;
  padding: 0 20px;
  color: $secondary-text;
  border-left-color: $primary;
}

.date {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-block;
  padding: 10px;
  color: $text;
  background: $accent;
}

@media screen and (max-width: 768px) {

  .timeline {
    --timeline-axis: 36px;

    .timeline-content {
      width: auto;
      max-width: 100%;
      margin-left: 50px;
    }

    .timeline-img {
      left: 16px;
    }

    .timeline-item {

      &:nth-child(even) {

        .timeline-content {
          float: none;
        }
      }

      &:nth-child(odd) {

        .timeline-content {

          &::after {
            content: '';
            position: absolute;
            top: 30px;
            left: -15px;
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 10px 15px 10px 0;
            border-color: transparent #f1f1f1 transparent transparent;
          }
        }
      }
    }
  }
}
