src/modules/profile/topAlbums/topAlbums.css
.fade-in {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.fade-in.loaded {
  opacity: 1;
}

.top-albums {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  justify-content: center;
  padding: 14px;

  &.is-empty {
    &:before {
      content: 'No albums found for the selected period';
      padding: 10px;
    }
  }

  & > .loader {
    color: var(--color-lastfm);
    width: 182px;
    aspect-ratio: 1 / 1;
  }

  &.is-loaded > .loader { display: none; }

  &::after {
    content: '';
    inset: 0;
    display: none;
    background: rgba(0,0,0,.5);
    position: absolute;
    opacity: 0;
    transition: opacity .15s ease-out;
  }

  &.is-loading::after {
    display: block;
    opacity: 1;
  }

  .album-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    font-size: 0;
  }

  .album-wrapper {
    position: relative;
    --qty: 8;
    width: calc(100% / var(--qty));

    &:has(.album-link:hover) .album-title {
      text-decoration: underline;
    }
  }

  a { color: inherit; }

  .album-image {
    position: relative;
    aspect-ratio: 1 / 1;

    img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      position: absolute;
      opacity: 0;
    }

    .loader {
      position: absolute;
      height: 100%;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      inset: 0;

      svg {
        height: 60%;
        width: 60%;
        color: var(--color-lastfm);
      }
    }

    img.loaded {
      opacity: 1;
    }

    img.loaded + .loader { display: none; }

    &::after {
      background-image: linear-gradient(182deg,transparent 0,rgba(0,0,0,.45) 70%,rgba(0,0,0,.8));
      content: "";
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      width: 100%;
    }
  }

  .album-details {
    bottom: 0;
    font-size: 14px;
    line-height: 1.5;
    left: 0;
    line-height: 18px;
    margin: 0;
    position: absolute;
    right: 0;
    padding: 15px;
    text-shadow: 0 0 10px rgba(0,0,0,.7);
    display: flex;
    flex-direction: column;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    transform: translateY(0);
    opacity: 1;
    z-index: 10;
    pointer-events: none;

    @starting-style {
      opacity: 0;
      transform: translateY(20px);
    }

    .album-title {
      font-weight: bold;
      font-size: 16px;
    }

    a {
      pointer-events: auto;
      position: relative;
      z-index: 1;
      display: block;
      max-width: 100%;
      font-size: 12px;
      padding: 1px 0;
      line-height: 1.4;
      white-space: nowrap;
      overflow-x: hidden;
      text-overflow: ellipsis;

      &:hover {
        text-decoration: underline;
      }
    }
  }
}

.top-albums-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;

  & > div {
    display: flex;
    gap: 10px;
    align-items: stretch;
  }

  button, select { cursor: pointer; }

  button {
    background: var(--surface-primary);
    border-radius: 3px;
    padding: .15em .5em;
    color: var(--text-primary);
    border: 1px solid var(--ui-detail-neutral);
    font-size: 16px;
  }
}

html[data-scheme="light"] {
  .top-albums {
    &::after {
      background: rgba(255,255,255,.5);
    }
    .album-image::after {
      background-image: linear-gradient(182deg,transparent 0,rgba(255,255,255,.75) 70%,rgba(255,255,255,.95));
    }
     .album-details {
      text-shadow: 1px 1px 1px rgba(255,255,255,.4), 0px 0px 5px rgba(0,0,0,.5);
    }
  }
}

@media (width < 1280px) {
  .top-albums .album-wrapper {
    --qty: 4;
  }
}

@media (width < 1280px) {
  .top-albums .album-image {
    aspect-ratio: 1.5 / 1;
  }
}
