@use '_variables' as *;
@use '_mixins' as *;
@use '_miniature' as *;

.miniature {
  display: inline-block;
  width: 100%;

  &.no-videos:not(.to-manage) {
    a {
      cursor: default !important;
    }
  }

  &.to-manage,
  &.no-videos {
    .play-overlay {
      display: none;
    }
  }
}

.miniature-thumbnail {
  @include miniature-thumbnail;

  .miniature-playlist-info-overlay {
    @include static-thumbnail-overlay;

    position: absolute;
    right: 0;
    bottom: 0;
    height: 100%;
    padding: 0 10px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: $font-semibold;
  }
}

.miniature-info {

  .miniature-name {
    @include miniature-name;
  }

  .by {
    @include disable-default-a-behaviour;

    display: block;
    color: pvar(--greyForegroundColor);
  }

  .privacy-date {
    margin-top: 5px;
    font-size: 14px;

    .privacy {
      font-weight: $font-semibold;

      &::after {
        content: '-';
        margin: 0 3px;
      }
    }
  }

  .description {
    @include peertube-word-wrap;

    margin-top: 10px;
    color: pvar(--greyForegroundColor);
  }
}

.miniature:not(.display-as-row) {

  .miniature-name {
    margin-top: 10px;
    margin-bottom: 5px;
  }

  .miniature-thumbnail {
    @include block-ratio($selector: '::ng-deep a');

    margin-top: 10px;
    margin-bottom: 5px;
  }
}

.miniature.display-as-row {
  --rowThumbnailWidth: #{$video-thumbnail-width};
  --rowThumbnailHeight: #{$video-thumbnail-height};

  display: flex;

  .miniature-name {
    @include ellipsis-multiline($video-miniature-row-name-font-size, 2);
  }

  .miniature-thumbnail {
    @include margin-right(10px);

    min-width: var(--rowThumbnailWidth);
    max-width: var(--rowThumbnailWidth);
    height: var(--rowThumbnailHeight);
  }
}

@include on-small-main-col {
  .miniature.display-as-row {
    --rowThumbnailWidth: #{$video-thumbnail-medium-width};
    --rowThumbnailHeight: #{$video-thumbnail-medium-height};
  }
}

@include on-mobile-main-col {
  .miniature.display-as-row {
    --rowThumbnailWidth: #{$video-thumbnail-small-width};
    --rowThumbnailHeight: #{$video-thumbnail-small-height};
  }
}
