:root {
  --timeline-item-width: 22rem;
  --gap: 3.125rem;
  --timeline-col-width: calc( ( (var(--timeline-item-width)) / 2) - var(--gap));
  --timeline-point-colour: #00243A;
  --timeline-line-colour: #0098DB;
}

@media screen and (min-width: calc( 22rem * 3 )){ 
  :root {
    --timeline-item-width: 22rem;
  }
}

.time-line_wrapper {
  position: relative;
  background-color: inherit;
  width: 100%;
  transform: translate3d(0,0,0);
  --left-fade: linear-gradient(270deg, transparent 25.72%, #D5D8DB 100%);
  --right-fade: linear-gradient(270deg, #D5D8DB 16.42%, transparent 100%);
}

@media screen and (min-width: calc( 22rem * 3 )){
  .time-line_wrapper::before,
  .time-line_wrapper::after {
    display: block;
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100%;
    z-index: 1;
    width: 7.5rem;
  }
  .time-line_wrapper::before {
    left: 0;
    background: var(--left-fade);
  }

  .time-line_wrapper::after {
    right: 0;
    background: var(--right-fade);
  }
}

.time-line_wrapper ul.time-line {
  display: grid;
  gap: calc(var(--gap) + 2rem) calc( var(--gap) * 2);
  grid-template-rows: auto 1rem auto;
  grid-auto-columns: var(--timeline-col-width);
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-snap-stop: always;
  scroll-padding-left: 0;
  align-items: end;
  position: relative;
  scroll-behavior: smooth;

  list-style: none;
  padding: 2.5rem calc(50vw -  (var(--timeline-item-width) / 2) );
  margin: 0;
  outline: none;
}

@media screen and (min-width: calc( 22rem * 3 )){
  .time-line_wrapper ul.time-line {
    scroll-padding-left: 50%;
    padding: 2.5rem calc(50% - var(--timeline-item-width)) 2.5rem 50%;
  }
}

.time-line::before {
  display: block;
  width: calc(100% - var(--timeline-item-width));
  height: .5rem;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent .5rem,
    var(--timeline-line-colour) .5rem,
    var(--timeline-line-colour) 1rem);
  content: "";
  transform: translateY(-50%);
  grid-row: 2;
  grid-column: 1/18; /* set with JS */
  background-size: calc(var(--timeline-col-width) + (var(--gap) * 2) );
  /* background-repeat: no-repeat; */
  background-position: .25rem;
}

.time-line_wrapper .time-line li {
  font-family: "Roboto", sans-serif;
  position: relative;

  margin: 0 auto;
  padding: 1rem;
  background-color: #FFF;

  grid-column: span 2;
  scroll-snap-align: center;
  --drop-shadow-spread: 4px;
  --drop-shadow-opacity: .25;
  transition: filter 300ms ease-out;
}

.time-line:focus li:hover,
.time-line:focus li.active {
  --drop-shadow-spread: 6px;
  --drop-shadow-opacity: .6;
  transition: filter 250ms ease-in;
}

@media screen and (min-width: calc( 22rem * 3 )){
  .time-line_wrapper .time-line li {
    scroll-snap-align: start;
  }
}

.time-line_wrapper .time-line li::before {
  display: block;
  width: 1rem;
  height: 1rem;
  background: var(--timeline-point-colour);
  content: "";
  left: 0;
  position: absolute;
  border-radius: 50%;
  transform: translateX(-50%);
}

.time-line li::after {
  display: block;
  width: 0;
  height: 0;
  background: transparent;
  content: "";
  left: 0;
  position: absolute;
}

.time-line li:nth-child(even) {
  grid-row: 1;
  align-self: end;
  border-radius: .5rem .5rem .5rem 0;
  filter: drop-shadow(0px 4px var(--drop-shadow-spread) rgba(0,0,0,var(--drop-shadow-opacity)));
}

.time-line li:nth-child(odd) {
  grid-row: 3;
  align-self: start;
  border-radius: 0 .5rem .5rem .5rem;
  filter: drop-shadow(1px 1px var(--drop-shadow-spread) rgba(0,0,0,var(--drop-shadow-opacity)));
}

.time-line li:empty {
  grid-column: span 1;
  opacity: 0;
  visibility: hidden;
  scroll-snap-align: none;
}

.time-line li:empty::before {
  display: none;
}

.time-line li:nth-child(even)::before {
  bottom: calc(-1rem - var(--gap) - 2rem);
  top: unset;
}

.time-line li:nth-child(odd)::before {
  top: calc(-1rem - var(--gap) - 2rem);
}

.time-line li:nth-child(even)::after,
.time-line li:nth-child(odd)::after {
  border-left: 0px solid transparent;
  border-right: 1.5rem solid transparent;
}

.time-line li:nth-child(even)::after {
  border-bottom: 0px solid #fff;
  border-top: 2rem solid #fff;
  bottom: -2rem;
}

.time-line li:nth-child(odd)::after {
  border-top: 0px solid #fff;
  border-bottom: 2rem solid #fff;
  top: -2rem;
}

.time-line li h3 {
  display: block;
  margin: 0 0 .75rem;
  font-size: 1.5rem;
}