/* ---------- Timeline Block ---------- */
.timeline-block {
  --tl-cols: 5;
  --tl-gap: 30px;
  --tl-dot: 30px;
  --tl-dot-border: 5px;
  overflow-x: clip;
}

/* ---------- Header ---------- */
.timeline-block .tl-header {
  align-items: flex-end;
  margin-bottom: 44px;
}
.timeline-block .tl-headline {
  color: var(--primarycolor);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 14px 0;
}
.timeline-block .tl-sub {
  margin: 0;
  max-width: 720px;
}
.timeline-block .tl-nav-col {
  display: flex;
  justify-content: flex-end;
}

/* ---------- Nav arrows ---------- */
.timeline-block .tl-nav {
  display: flex;
  gap: 22px;
}
.timeline-block .tl-nav.tl-nav-hidden {
  visibility: hidden;
}
.timeline-block .tl-nav button {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: none;
  background: none;
  color: var(--primarycolor);
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}
.timeline-block .tl-nav .tl-arrow {
  display: block;
  width: 30px;
  height: 14px;
}
.timeline-block .tl-nav .tl-prev .tl-arrow {
  transform: scaleX(-1); /* reuse the same arrow, pointing left */
}
.timeline-block .tl-nav .tl-next:hover {
  transform: translateX(2px);
}
.timeline-block .tl-nav .tl-prev:hover {
  transform: translateX(-2px);
}
/* Not clickable — no events in that direction */
.timeline-block .tl-nav button:disabled,
.timeline-block .tl-nav button:disabled:hover {
  color: var(--linkwater);
  cursor: default;
  transform: none;
}

/* ---------- Track ---------- */
.timeline-block .tl-track {
  display: flex;
  gap: var(--tl-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.timeline-block .tl-track::-webkit-scrollbar {
  display: none;
}
.timeline-block .tl-track:focus-visible {
  outline: 2px solid var(--primarycolor);
  outline-offset: 6px;
}

/* ---------- Event ---------- */
/* --tl-cols arrives as an inline style on the section, so it can never be
   overridden by a stylesheet rule. Resolve it into --tl-n here on the item —
   breakpoints below override --tl-n, which the inline style never sets. */
.timeline-block .tl-item {
  --tl-n: var(--tl-cols, 5);
  --tl-basis: calc((100% - (var(--tl-gap) * (var(--tl-n) - 1))) / var(--tl-n));
  flex: 0 0 var(--tl-basis);
  max-width: var(--tl-basis);
  scroll-snap-align: start;
}

/* Marker + dashed connector */
.timeline-block .tl-point {
  position: relative;
  height: var(--tl-dot);
  margin-bottom: 24px;
}
.timeline-block .tl-point .tl-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tl-dot);
  height: var(--tl-dot);
  border: var(--tl-dot-border) solid var(--linkwater);
  border-radius: 50%;
  background: transparent;
  box-sizing: border-box;
}
.timeline-block .tl-point:after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--tl-dot) + 8px);
  right: calc(8px - var(--tl-gap)); /* bridges the gap to the next marker */
  border-top: 2px dashed var(--linkwater);
  transform: translateY(-1px);
}
.timeline-block .tl-item:last-child .tl-point:after {
  right: 0;
}

/* Copy */
.timeline-block .tl-year {
  color: var(--primarycolor);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}
.timeline-block .tl-blurb {
  padding-right: 16px;
}
.timeline-block .tl-blurb p {
  margin: 0;
}

/* ---------- Responsive ---------- */
/* 1200–1399px — container is 1140px, so tighten the gap to keep 5-up near 210px */
@media screen and (max-width: 1399.98px) {
  .timeline-block {
    --tl-gap: 26px;
  }
}
/* 992–1199px — container drops to 960px, where 5-up would be only ~173px.
   3-up lands at ~304px here and ~224px once the container hits 720px. */
@media screen and (max-width: 1199.98px) {
  .timeline-block {
    --tl-gap: 24px;
  }
  .timeline-block .tl-item {
    --tl-n: 3;
  }
}
@media screen and (max-width: 991.98px) {
  .timeline-block .tl-headline {
    font-size: 34px;
  }
  .timeline-block .tl-header {
    align-items: flex-start;
    margin-bottom: 34px;
  }
  .timeline-block .tl-nav-col {
    justify-content: flex-start;
    margin-top: 20px;
  }
}
@media screen and (max-width: 767.98px) {
  .timeline-block {
    --tl-dot: 26px;
    --tl-dot-border: 4px;
  }
  .timeline-block .tl-item {
    flex: 0 0 46%;
    max-width: 46%;
  }
  .timeline-block .tl-year {
    font-size: 22px;
  }
}
@media screen and (max-width: 575.98px) {
  .timeline-block .tl-item {
    flex: 0 0 78%;
    max-width: 78%;
  }
  .timeline-block .tl-headline {
    font-size: 28px;
  }
}