/* MAIN */
main {
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  min-width: 100%;
}

/* LOADERS */
#loading-container {
  align-items: center;
  justify-content: center;
}

#scroll-loading {
  align-items: center;
  justify-content: center;
  min-height: 60px;
  margin-bottom: 20px;
}

@keyframes loadAnim {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

@keyframes loadIcon {
  0% {
    opacity: 0.2;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

.loader {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#loading-text {
  font-size: 14px;
  background-color: #ffffff20;
  padding: 0.5em 1em;
  border-radius: 10em;
}

.loading-icon {
  width: 20px;
  height: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  animation: loadAnim alternate infinite 0.5s;

  span {
    background-color: white;
    opacity: 0.2;
    animation: loadIcon forwards 2s infinite;
    &:nth-of-type(1) {
      animation-delay: 0;
    }
    &:nth-of-type(2) {
      animation-delay: 0.1s;
    }
    &:nth-of-type(3) {
      animation-delay: var(--duration-slow);
    }
    &:nth-of-type(4) {
      animation-delay: 0.3s;
    }
    &:nth-of-type(5) {
      animation-delay: 0.4s;
    }
    &:nth-of-type(6) {
      animation-delay: 0.5s;
    }
    &:nth-of-type(7) {
      animation-delay: 0.6s;
    }
    &:nth-of-type(8) {
      animation-delay: 0.7s;
    }
    &:nth-of-type(9) {
      animation-delay: 0.8s;
    }
  }
}

.loader-done {
  .loading-text,
  .loading-icon {
    animation: none;
    opacity: 0.6;
  }
}

#timeline-list {
  padding: 0;
  min-width: 100%;
  &:empty + #stats {
    display: none;
  }
}

@media (width < 550px) {
  .year-row {
    content-visibility: auto;
  }
}

.year-row {
  position: relative;
  display: flex;
  gap: 10px;
  flex-direction: column;
  border-top: 1px dotted #ffffff20;
  padding-block: 12px;
  transition: background-color var(--duration-fast) ease;
  padding-inline: 15px 10px;
  @media (pointer: fine) {
    &:hover {
      background-color: #ffffff05;
    }
  }
  &.decade {
    border-top-style: solid;
    border-color: #ffffff40;
  }
  &:first-child {
    border-top: none;
  }

  @media (min-width: 550px) {
    flex-direction: row;
    gap: 0;
    padding-inline: 15px 10px;
    .size-s & {
      padding-block: 4px;
    }
    .size-m & {
      padding-block: 10px;
    }
    .size-l & {
      padding-block: 10px;
    }
  }
}

.year-container {
  @media (min-width: 550px) {
    min-width: 4ch;
    text-align: right;
    padding-right: 12px;
    margin-right: 12px;
    border-right: 1px dotted #ffffff20;
    min-height: 100%;
  }
  @media (min-width: 800px) {
    .size-l & {
      min-width: 5ch;
    }
  }
}

.year-text {
  display: flex;
  gap: 0.5em;
  font-size: 14px;

  @media (min-width: 550px) {
    position: sticky;
    top: calc(var(--header-lg) + 10px);
    flex-direction: column;
    gap: 0;
  }
  @media (min-width: 800px) {
    .size-s & {
      font-size: 10px;
    }
    .size-m & {
      font-size: 13px;
    }
    .size-l & {
      font-size: 13px;
    }
  }
}

.year-label {
  font-size: 1em;
  font-weight: bold;
  line-height: 1.1;
}

.year-total {
  font-size: 1em;
  line-height: 1;
  opacity: 0.6;
  &:before {
    content: "/";
  }
  @media (min-width: 550px) {
    font-size: clamp(10px, 0.8em, 12px);
  }
  @media (min-width: 800px) {
    .size-s & {
      display: none;
    }
  }
}

.cover-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  list-style: none;
}

.cover-link {
  position: relative;
  background-color: var(--body-bg);
  border: none;
  display: block;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
  transition:
    transform var(--duration-slow),
    box-shadow var(--duration-slow),
    outline var(--duration-slow);
  @media (pointer: fine) {
    &:hover,
    &:focus-visible {
      border-radius: 5px;

      transform: scale(1.2);
      box-shadow:
        0 10px 15px #00000060,
        0 30px 80px #00000090,
        0 50px 100px #00000050;
      z-index: 10;
      outline: 1px solid white;
    }
  }
  &.is-active {
    outline: 2px solid #fff;
    transform: scale(1.2);
    z-index: 1;
    box-shadow:
      0 10px 15px #00000060,
      0 30px 80px #00000090,
      0 50px 100px #00000050;
  }
  &.filtered {
    outline: 1px solid white;
    box-shadow:
      0 10px 15px #00000060,
      0 30px 80px #00000090,
      0 50px 100px #00000050;
  }
  &.dimmed {
    opacity: 0.15;
    filter: grayscale(1);
    pointer-events: none;
  }
}

.cover-format-label {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #00000090;
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  padding: 2px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  .size-s & {
    opacity: 0;
  }
}

.cover-art {
  display: block;
  width: 66px;
  height: 66px;
  object-fit: cover;
  background: #ffffff20;

  @media (min-width: 800px) {
    .size-s & {
      width: 12px;
      height: 12px;
    }
    .size-m & {
      width: 44px;
      height: 44px;
    }
    .size-l & {
      width: 80px;
      height: 80px;
    }
  }
}

/* STATS */
#stats {
  width: 100%;
  align-items: center;
  justify-content: center;
  pointer-events: none;

  &:has(.stat:not(:empty)) {
    border-bottom: 1px solid #ffffff40;
  }
}

#stats-inner {
  flex-wrap: wrap;
  width: 100%;
  flex: 1;
  font-size: 13px;
  gap: 0.25em;
  &:has(.stat:not(:empty)) {
    &:before {
      display: block;
      width: 1em;
      aspect-ratio: 1;
      content: "";
      background: url(./icn-info--white.svg) center no-repeat;
      background-size: 100%;
    }
  }
}

#stats-formats {
  opacity: 0.6;
}
