.ipa-timeline {
  --ipa-accent: #00a9a5;
  --ipa-text: #fff;
  display: grid;
  grid-template-columns: minmax(5.5rem, 9rem) minmax(0, 1fr);
  min-height: clamp(34rem, 75vh, 58rem);
  overflow: hidden;
  color: var(--ipa-text);
  background: #111;
}

.ipa-timeline__years {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: .15rem;
  padding: 1rem .75rem;
  background: #101817;
  overflow-y: auto;
  scrollbar-width: thin;
}

.ipa-timeline__year {
  position: relative;
  min-height: 2.8rem;
  padding: .55rem .75rem;
  border: 0;
  color: rgba(255, 255, 255, .68);
  background: transparent;
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.ipa-timeline__year::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: .25rem;
  height: 0;
  background: var(--ipa-accent);
  transform: translateY(-50%);
  transition: height .2s ease;
}

.ipa-timeline__year:hover,
.ipa-timeline__year:focus-visible,
.ipa-timeline__year.is-active {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.ipa-timeline__year.is-active {
  font-weight: 700;
  transform: translateX(.2rem);
}

.ipa-timeline__year.is-active::before {
  height: 70%;
}

.ipa-timeline__year:focus-visible,
.ipa-timeline__controls button:focus-visible {
  outline: .18rem solid #fff;
  outline-offset: -.2rem;
}

.ipa-timeline__stage {
  position: relative;
  min-width: 0;
  min-height: inherit;
}

.ipa-timeline__panel {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility .45s ease;
}

.ipa-timeline__panel.is-active {
  opacity: 1;
  visibility: visible;
}

.ipa-timeline__media,
.ipa-timeline__image,
.ipa-timeline__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ipa-timeline__image {
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}

.ipa-timeline__image.is-active {
  opacity: 1;
  visibility: visible;
}

.ipa-timeline__shade {
  background: linear-gradient(180deg, rgba(0, 0, 0, .05) 20%, rgba(0, 0, 0, .82) 100%);
}

.ipa-timeline__content {
  position: relative;
  z-index: 1;
  width: min(52rem, 100%);
  padding: clamp(1.5rem, 4vw, 4rem);
  text-shadow: 0 .08rem .2rem rgba(0, 0, 0, .6);
}

.ipa-timeline__date {
  margin: 0 0 .35rem;
  color: var(--ipa-accent);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
}

.ipa-timeline__content h2 {
  margin: 0 0 .75rem;
  color: inherit;
  font-size: clamp(1.75rem, 4vw, 3.5rem);
  line-height: 1.08;
}

.ipa-timeline__text {
  max-width: 48rem;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.6;
}

.ipa-timeline__text > :last-child {
  margin-bottom: 0;
}

.ipa-timeline__controls {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: .4rem;
}

.ipa-timeline__controls button {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  font-size: 1.25rem;
  cursor: pointer;
}

.ipa-timeline__image-arrows {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: .8rem;
  right: .8rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}

.ipa-timeline__image-arrows button {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .48);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.ipa-timeline__thumbnails {
  position: absolute;
  z-index: 4;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: .4rem;
  max-width: calc(100% - 2rem);
  overflow-x: auto;
}

.ipa-timeline__thumbnails button {
  flex: 0 0 auto;
  width: 3.9rem;
  height: 2.9rem;
  padding: .12rem;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, .45);
  cursor: pointer;
  opacity: .7;
}

.ipa-timeline__thumbnails button.is-active,
.ipa-timeline__thumbnails button:focus-visible {
  border-color: var(--ipa-accent);
  opacity: 1;
  outline: none;
}

.ipa-timeline__thumbnails img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767px) {
  .ipa-timeline {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(31rem, 72vh);
    min-height: 0;
  }

  .ipa-timeline__years {
    order: 2;
    flex-direction: row;
    justify-content: flex-start;
    padding: .35rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .ipa-timeline__year {
    flex: 0 0 auto;
    min-height: 2.75rem;
    text-align: center;
    scroll-snap-align: center;
  }

  .ipa-timeline__year::before {
    left: 50%;
    top: auto;
    bottom: 0;
    width: 0;
    height: .2rem;
    transform: translateX(-50%);
    transition: width .2s ease;
  }

  .ipa-timeline__year.is-active {
    transform: none;
  }

  .ipa-timeline__year.is-active::before {
    width: 70%;
    height: .2rem;
  }

  .ipa-timeline__stage {
    min-height: 31rem;
  }

  .ipa-timeline__content {
    max-height: 70%;
    padding: 1.35rem 1.25rem 4.5rem;
    overflow-y: auto;
  }

  .ipa-timeline__thumbnails {
    top: .65rem;
    right: .65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ipa-timeline__panel,
  .ipa-timeline__image,
  .ipa-timeline__year,
  .ipa-timeline__year::before {
    transition: none;
  }
}

