@use "core/functions" as *;
@use "core/mixins" as *;

// Related Content List (aside)
.related-details {
  &:not(:first-of-type)::before {
    content: '';
    display: block;
    border: 0;
    padding-top: 1px;
    background: fi-var(divider-edge-weak);
    margin-block: 1rem 0.5rem;
  }

  &:not(:last-of-type) {
    margin-bottom: 0.5rem;
  }

  .related-summary {
    display: flex;
    align-items: baseline;
    gap: 0.25em;
    padding: 0.2em 0.5em;
    user-select: none;
    
    > i.fa-layer-group {
      flex-shrink: 0;
    }

    .related-title {
      font-weight: bold;
      font-size: fi-var(related-title-font-size);
    }

    .related-count {
      flex-shrink: 0;
      color: fi-var(global-font-secondary-color);
    }

    .details-icon {
      flex-shrink: 0;
    }
  }

  .related-content {
    font-size: fi-var(related-list-font-size);

    .related-list {
      margin: 0;
      padding-inline: 1.6em 0.8em;
      padding-block: 0.4em;
      text-indent: -0.8em;
      list-style: none;
      overflow-y: auto;
      overscroll-behavior: contain;
      max-height: 60vh;
      @include scrollbar-width(none, 0);

      .related-item > a::before,
      .related-item > span::before {
        content: '|';
        font-weight: 600;
        margin-right: 0.5em;
        position: relative;
        bottom: 2px;
        color: fi-var(single-link-color);
      }
    }
  }
}
