.ipa-timeline-block {
  background: #111;
}

.ipa-timeline-heading {
  padding: clamp(1rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2.5rem);
  color: var(--ipa-heading-color, #fff);
  background: var(--ipa-heading-background, #111111);
}

.ipa-timeline-heading h2 {
  margin: 0;
  color: inherit;
  font-weight: 600;
  line-height: 1.2;
}

.ipa-timeline-heading--left { text-align: left; }
.ipa-timeline-heading--center { text-align: center; }
.ipa-timeline-heading--right { text-align: right; }
.ipa-timeline-heading--small h2 { font-size: clamp(1rem, 1.8vw, 1.35rem); }
.ipa-timeline-heading--medium h2 { font-size: clamp(1.25rem, 2.5vw, 1.85rem); }
.ipa-timeline-heading--large h2 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }

.ipa-timeline {
  --ipa-accent: #00a9a5;
  --ipa-text: #fff;
  position: relative;
  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__navigation {
  display: contents;
}

.ipa-timeline__year-select {
  display: none;
}

.ipa-timeline__years {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: .15rem;
  padding: 1rem .75rem;
  background: var(--ipa-years-background, #101010);
  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: 768px) {
  .ipa-timeline-block {
    min-width: 0;
    max-width: 100%;
  }

  .ipa-timeline {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    background: #101010;
  }

  .ipa-timeline__navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem;
    padding: .65rem .75rem;
    background: var(--ipa-years-background, #101010);
  }

  .ipa-timeline.is-ready .ipa-timeline__years {
    display: none;
  }

  .ipa-timeline.is-ready .ipa-timeline__year-select {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: .45rem .6rem;
    border: 1px solid rgba(255, 255, 255, .55);
    border-bottom: .2rem solid var(--ipa-accent);
    border-radius: 0;
    color: #fff;
    color-scheme: dark;
    background-color: rgba(255, 255, 255, .08);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
  }

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

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

  .ipa-timeline__year {
    flex: 0 0 auto;
    min-height: 44px;
    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__controls {
    position: static;
  }

  .ipa-timeline__controls button,
  .ipa-timeline__image-arrows button {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .ipa-timeline__panel {
    position: static;
    display: block;
  }

  .ipa-timeline__panel[hidden],
  .ipa-timeline__image:not(.is-active),
  .ipa-timeline__shade {
    display: none;
  }

  .ipa-timeline__media {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .ipa-timeline__image {
    position: static;
    display: block;
    grid-area: 1 / 1;
    width: 100%;
    height: auto;
    object-fit: contain;
    touch-action: pan-y pinch-zoom;
  }

  .ipa-timeline__image-arrows {
    position: static;
    grid-area: 1 / 1;
    align-self: center;
    margin-inline: .65rem;
    transform: none;
  }

  .ipa-timeline__content {
    box-sizing: border-box;
    padding: 1rem clamp(.85rem, 4vw, 1.5rem) 1.5rem;
    overflow-wrap: anywhere;
    text-shadow: none;
  }

  .ipa-timeline__content h2 {
    font-size: clamp(1.35rem, 5vw, 2.25rem);
    line-height: 1.2;
  }

  .ipa-timeline__text :is(img, video, iframe, figure, table) {
    max-width: 100%;
  }

  .ipa-timeline__text pre {
    white-space: pre-wrap;
  }

  .ipa-timeline__thumbnails {
    position: static;
    max-width: 100%;
    padding: .45rem .65rem;
  }

  .ipa-timeline__thumbnails button {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
  }
}

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

