/* ==========================================================================
   TIMELINE (Updated)
   ========================================================================== */

body.home,
body.single {
  background-color: black;
}

body.home {
  overflow: auto;
}

@media (max-width: 1240px) {
  [data-barba-namespace="home"] .timeline .pin-spacer {
    pointer-events: none;
  }
}

.timeline-bg {
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1;
}

.timeline-bg img {
  height: 100%;
  left: 0;
  object-fit: cover;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 2;
}

.timeline-bg:after {
  background-color: rgba(0, 0, 0, 0.85);
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 3;
}

.timeline {
  color: white;
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.timeline__sidebar,
#main.timeline__content {
  padding-top: 120px;
}

@media (min-width: 500px) {
  #main.timeline__content {
    padding-top: 160px;
  }
}

@media (min-width: 768px) {
  .timeline__sidebar {
    padding-top: 180px;
  }
}

@media screen and (min-width: 930px) {
  #main.timeline__content {
    padding-top: 150px;
  }
}

@media screen and (min-width: 1025px) {
  #main.timeline__content {
    padding-top: 100px;
  }
}

/* Sidebar */
.timeline__sidebar {
  /* Window height - padding top - height of one item */
  padding-bottom: calc(100svh - 120px - 80px);
  padding-right: 20px;
  width: 70px;
}

@media (min-width: 500px) {
  .timeline__sidebar {
    /* Window height - padding top - height of one item */
    padding-bottom: calc(100svh - 240px - 100px);
    width: 100px;
  }
}

@media (min-width: 768px) {
  .timeline__sidebar {
    padding-right: 40px;
    width: 175px;
  }
}

@media (min-width: 810px) {
  .timeline__sidebar {
    padding-right: 80px;
  }
}

@media (min-width: 1240px) {
  .timeline__sidebar {
    padding-right: 170px;
    width: 300px;
  }
}

.timeline__sidebar ul {
  margin: 0;
  position: relative;
}

.timeline__sidebar ul:after {
  background: white;
  bottom: 40px;
  content: "";
  position: absolute;
  right: -10px;
  top: 40px;
  width: 1px;
}

@media (min-width: 768px) {
  .timeline__sidebar ul:after {
    bottom: 50px;
    top: 50px;
  }
}

.timeline__sidebar li {
  position: relative;
}

.timeline__sidebar li:before {
  content: attr(data-count);
  font-size: 14px;
  color: white;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 0;
}

@media screen and (max-width: 319px) {
  .timeline__sidebar li:before {
    display: block;
    right: -34px;
  }
}

@media screen and (min-width: 320px) {
  .timeline__sidebar li:before {
    display: block;
    right: -37px;
  }
}

@media (min-width: 768px) {
  .timeline__sidebar li:before {
    display: block;
    right: -90px;
  }
}

.timeline__sidebar li:after {
  background-color: white;
  border: solid 2px white;
  border-radius: 50%;
  content: "";
  height: 14px;
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  transition: transform 0.4s ease, background-color 0.4s ease;
  width: 14px;
  z-index: 2;
}

.timeline__sidebar li.active:after {
  background-color: #f69222;
  transform: translateY(-50%) scale(1);
}

@media (min-width: 768px) {
  .timeline__sidebar ul:after {
    right: -50px;
  }

  .timeline__sidebar li:after {
    right: -58px;
  }
}

.sidebar__link {
  align-items: center;
  justify-content: flex-end;
  display: flex;
  height: 80px;
  padding-right: 8px;
  cursor: pointer;
}

@media (min-width: 500px) {
  .sidebar__link {
    height: 100px;
  }
}

.sidebar__link span {
  font-size: 14px;
  font-weight: 500;
  transform-origin: 100% 50%;
  transition: transform 0.4s ease;
}

.sidebar__link:hover span {
  transform: scale(1.15);
}

.sidebar__link.active span {
  color: #f69222;
  font-weight: 700;
  transform: scale(1.3);
}

@media (min-width: 768px) {
  .sidebar__link span {
    font-size: 29px;
  }
  .sidebar__link.active span {
    transform: scale(2);
  }
}

/* Content */
.timeline__content {
  display: flex;
  flex-direction: column;
  padding-left: 25px;
  padding-top: 120px;
  width: calc(100% - 70px);
}

@media (min-width: 376px) {
  .timeline__content {
    padding-left: 50px;
  }
}

@media (min-width: 500px) {
  .timeline__content {
    width: calc(100% - 100px);
  }
}

@media (min-width: 768px) {
  .timeline__content {
    justify-content: center;
    padding-top: 0;
    padding-left: 100px;
    height: 100svh;
    width: calc(100% - 225px);
  }
}

@media (min-width: 1240px) {
  .timeline__content {
    width: calc(100% - 325px);
  }
}

.timeline__content-wrap {
  display: grid;
}

.timeline__content-wrap .excerpt-read-more {
  display: none;
}

.timeline__content-link {
  background-color: #f69222;
  width: auto;
  text-align: center;
  color: white !important;
  padding: 7px 15px;
  border-radius: 6px;
  margin-bottom: 30px;
  margin-right: 10px;
  clear: both;
  font-size: 15px;
  border: 0px solid white;
  text-decoration: none;
}

.timeline__content:not(.disabled) .timeline__content-link {
  pointer-events: all;
}

.timeline__content-inner {
  grid-area: 1 / 1;
  transition: opacity 1s ease-out;
}

.timeline__content-inner:not(.active) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in;
  visibility: hidden;
}

.timeline__excerpt {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
}

@media (min-width: 1024px) {
  .timeline__content {
    padding-left: 0;
  }

  .timeline__content-inner {
    align-items: center;
    display: flex;
  }

  .timeline__content-grid {
    align-items: center;
    display: flex;
    gap: 50px;
    width: 100%;
  }

  .timeline__content-grid-item {
    max-width: 50%;
    width: 50%;
  }

  .timeline__content-grid-item--text {
    padding-right: 20px;
  }

  .timeline__excerpt {
    -webkit-line-clamp: 5;
    line-clamp: 5;
  }
}

@media (min-width: 1240px) {
  .timeline__content-grid-item--text {
    padding-right: 60px;
  }

  .timeline__excerpt {
    -webkit-line-clamp: 8;
    line-clamp: 8;
  }
}

@media (min-width: 1500px) {
  .timeline__content-grid-item--text {
    padding-right: 100px;
  }

  .timeline__excerpt {
    -webkit-line-clamp: 10;
    line-clamp: 10;
  }
}

.timeline__featured-image {
  display: none;
  height: auto;
  margin: 0 auto;
  max-height: 60svh;
  width: auto;
  max-width: 100%;
}

@media (max-width: 500px) {
  .timeline__content-grid .timeline__content-grid-item:first-child {
    /*aspect-ratio: 16 / 12;*/
  }

  .timeline__featured-image {
    /*aspect-ratio: 16 / 12;*/
    object-fit: cover;
  }
}

@media (min-width: 1024px) {
  .timeline__featured-image {
    display: block;
  }
}

/* Pagination */

.timeline__pagination {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-top: 50px;
}

.timeline__content:not(.disabled) .timeline__pagination li {
  pointer-events: all;
}

.timeline__pagination-li {
  display: none;
  line-height: 0;
  margin: 0 1px;
}

.timeline__pagination-control {
  margin: 0 2px;
}

@media (min-width: 768px) {
  .timeline__pagination-control,
  .timeline__pagination-li {
    margin: 0 5px;
  }
}

.timeline__pagination-li:has(+ .timeline__pagination-li.active),
.timeline__pagination-li.active,
.timeline__pagination-li.active + .timeline__pagination-li {
  display: inline-block;
  opacity: 0.3;
}

@media (min-width: 768px) {
  .timeline__pagination-li:has(
      + .timeline__pagination-li + .timeline__pagination-li.active
    ),
  .timeline__pagination-li.active
    + .timeline__pagination-li
    + .timeline__pagination-li {
    display: inline-block;
    opacity: 0.3;
  }
}

.timeline__pagination-li.active {
  opacity: 1;
}

.timeline__pagination-button,
.timeline__pagination-control button {
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  width: 30px;
}

.timeline__pagination-button.active {
  background-color: #381272;
}

.timeline__aria-btn {
  background: transparent;
  border: none;
  clip: rect(0 0 0 0);
  color: white;
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.timeline__aria-btn:focus {
  clip: auto;
  height: auto;
  position: relative;
  width: auto;
}

.timeline__pagination-control:has(+ .timeline__pagination-li.active),
.timeline__pagination-li.active + .timeline__pagination-control {
  display: none;
}

.timeline__pagination-control button {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Splash - comment out line below to test */

body.home .splash-screen {
  /* display: flex !important; */
}
