@use 'sass:math';
@use '_variables' as *;
@use '_mixins' as *;
@use '_miniature' as *;

.margin-content {
  @include grid-videos-miniature-margins;
}

.channel {
  max-width: $max-channels-width;
  background-color: pvar(--bg-secondary-350);

  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 15px;

  @include padding(1.75rem);
  @include margin(2rem, 0);
}

.channel-avatar-row {
  grid-column: 1;
  grid-row: 1;

  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: auto 1fr;

  my-actor-avatar {
    grid-column: 1;
    grid-row: 1 / 3;

    @include margin-right(15px);
  }

  a {
    color: pvar(--fg);

    @include peertube-word-wrap;
  }

  h2 {
    grid-row: 1;
    grid-column: 2;
  }

  .actor-counters {
    grid-row: 1;
    grid-column: 3;

    @include margin-left(15px);
    @include actor-counters;
  }

  .description-html {
    grid-column: 2 / 4;
    grid-row: 2;

    max-height: 80px;

    @include fade-text(50px, pvar(--bg-secondary-350));
  }
}

my-subscribe-button {
  grid-row: 1;
  grid-column: 2;
}

.videos {
  display: flex;
  grid-column: 1 / 3;
  grid-row: 2;

  position: relative;

  my-video-miniature {
    min-width: $video-thumbnail-medium-width;
    max-width: $video-thumbnail-medium-width;

    @include margin-right(15px);
  }

}

.videos-overflow-workaround {
  overflow-x: hidden;

  @include margin-top(2rem);
}

.miniature-show-channel {
  height: 100%;
  position: absolute;
  right: 0;
  background: linear-gradient(90deg, transparent 0, pvar(--bg-secondary-350) 45px);
  padding: (math.div($video-thumbnail-medium-height, 2) - 10px) 15px 0 60px;
  z-index: z(miniature) + 1;
}

.button-show-channel {
  display: none;
}

@include on-small-main-col {
  .channel-avatar-row {
    grid-template-columns: auto auto auto 1fr;

    .avatar-link {
      grid-row: 1 / 4;
    }

    .actor-counters {
      margin: 0;
      font-size: 13px;
      grid-row: 2;
      grid-column: 2 / 4;
    }

    .description-html {
      grid-row: 3;
      font-size: 14px;
    }
  }

  .videos {
    display: none;
  }

  my-subscribe-button,
  .button-show-channel {
    grid-column: 1 / 4;
    grid-row: 3;
    margin-top: 15px;
  }

  my-subscribe-button {
    justify-self: start;
  }

  .button-show-channel {
    display: block;
    justify-self: end;
  }
}
