/* =========================================================
   OŚ CZASU
   ========================================================= */
.timeline {
  width: 100%;
  overflow-x: hidden;
  padding: 120px 40px;
  position: relative;
}

/* linia pozioma */
.timeline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 40px;
  right: 40px;
  height: 2px;
  background: #431d2a;
  transform: translateY(-50%);
}

.timeline ol {
  list-style: none;
  position: relative;
  margin: 0;
  padding: 0;
}

.timeline ol li {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* kropka na linii */
.timeline ol li::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #431d2a;
}

.timeline ol li:nth-child(1) { left: 10%; }
.timeline ol li:nth-child(2) { left: 26%; }
.timeline ol li:nth-child(3) { left: 42%; }
.timeline ol li:nth-child(4) { left: 58%; }
.timeline ol li:nth-child(5) { left: 74%; }

/* dymek */
.timeline ol li div {
  position: absolute;
  left: 0;
  width: 16vw;
  min-width: 130px;
  max-width: 220px;
  padding: 12px;
  font-size: 1rem;
  white-space: normal;
  color: #e1dfdb;
  background: #431d2a;
  border: 1px solid #431d2a;
}

/* dymki nieparzyste – nad linią */
.timeline ol li:nth-child(odd) div {
  bottom: calc(100% + 14px);
  border-radius: 8px 8px 8px 0;
}

.timeline ol li:nth-child(odd) div::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  border-style: solid;
  border-width: 8px 8px 0 0;
  border-color: #431d2a transparent transparent transparent;
}

/* dymki parzyste – pod linią */
.timeline ol li:nth-child(even) div {
  top: calc(100% + 14px);
  border-radius: 0 8px 8px 8px;
}

.timeline ol li:nth-child(even) div::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  border-style: solid;
  border-width: 8px 0 0 8px;
  border-color: transparent transparent transparent #431d2a;
}

.timeline time {
  display: block;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 4px;
  color: #e1dfdb;
}

/* =========================================================
   OŚ CZASU – MOBILE
   ========================================================= */
@media screen and (max-width: 599px) {
  .timeline {
    padding: 20px 0 40px;
  }

  .timeline::before {
    display: none;
  }

  .timeline ol {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: static;
  }

  .timeline ol li {
    position: static;
    transform: none;
    display: block;
    width: 100%;
  }

  /* pionowa kreska między dymkami */
  .timeline ol li::after {
    display: block;
    position: static;
    transform: none;
    width: 2px;
    height: 25px;
    border-radius: 0;
    background: #431d2a;
    margin: 0 auto;
  }

  .timeline ol li:last-child::after {
    display: none;
  }

  .timeline ol li div {
    position: static;
    width: 88%;
    min-width: unset;
    max-width: unset;
    margin: 0 auto;
    text-align: center;
  }

  .timeline ol li:nth-child(odd) div,
  .timeline ol li:nth-child(even) div {
    border-radius: 16px;
    top: auto;
    bottom: auto;
  }

  .timeline ol li:nth-child(odd) div::before,
  .timeline ol li:nth-child(even) div::before {
    display: none;
  }
}