@use '../../../css/_config/_mixins';
@use '../../../css/_config/_vars';

.wrap {
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.scrollableOuter {
  overflow: auto;
  width: 100%;
  height: 100%;
  padding: 0 20px 30px;
  background: var(--color-primary-background);

  :global(.cq-800) & {
    padding: 0 30px 30px;
  }
}

.scrollableInner {
  // Note: This grid layout MUST match the logic in the calculateDimensions js function.
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0 10px;
  background: var(--color-primary-background);

  :global(.cq-620) & {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  :global(.cq-860) & {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  &Virtual {
    display: block;
  }
}

.measure {
  height: 0;

  :global(.env-local) & {
    height: 1px;
    background: var(--color-core);
    opacity: 0.15;
  }
}

.virtualRow {
  display: grid;
  gap: 0 10px;

  // :global(.env-local) & {
  //   background: rgba(255, 255, 255, 0.05);
  // }
}

.groupRow {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  padding: 0 10px 20px;
  font-size: 16px;
  font-weight: bold;

  .card + & {
    padding-top: 30px;
  }
}

.card {
  padding: 9px;
  margin-bottom: 20px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;

  @include mixins.focus-self-outline;

  &:hover {
    background: var(--color-secondary-card);
    border: 1px solid var(--color-secondary-border);
  }

  .virtualRow & {
    margin-bottom: 0;
  }

  &Link {
    cursor: pointer;
  }

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

.thumb {
  overflow: hidden;
  width: 100%;
  height: 0;
  padding: 0 0 60%;
  background: var(--color-opacity-01);
  background-image: vars.$thumbnail;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  // outline: 1px solid var(--color-opacity-01);

  &.thumbSquare {
    padding: 0 0 100%;
  }
  &.thumbWithIcon {
    background: var(--color-core);
    background: linear-gradient(to bottom, var(--color-core) 0%, var(--color-primary-background) 400%);
    color: var(--color-primary-background);
  }

  img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
}

.controlButtonWrap {
  display: block;
  position: absolute;
  pointer-events: none;
  bottom: 10px;
  right: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: all ease-in-out 0.25s;

  .card:hover &,
  .card.cardCurrent & {
    pointer-events: all;
    opacity: 1;
    transform: translateY(0);
  }
}

.playButton,
.pauseButton {
  display: block;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 11px 9px 11px 13px;
  background: var(--color-core);
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: all ease-in-out 0.25s;
  color: var(--color-secondary-background);
  cursor: pointer;

  .card:hover &:hover,
  .card.cardCurrent &:hover {
    transform: translateY(0) scale(1.1);
  }
}

.pauseButton {
  padding: 12px;
}

.body {
  padding: 10px 2px 2px;
  font-size: 11px;
}

.title {
  font-size: 12px;
  font-weight: 500;
}

.favourite {
  display: inline-block;
  position: relative;
  top: 3px;
  margin: -2px 6px -2px 0;
  color: var(--color-core);
}

.subtitle {
  display: block;
  color: var(--color-opacity-05);
}

.rating {
  margin-top: 6px;
  color: var(--color-opacity-04);
}
