@use '../../../../mx-core/src/base/typography';
@use '../../../../mx-core/src/base/shape';

:host {
  display: block;
}

.mdc-list,
.mdc-list-item {
  padding: 0;
}

.two-cols {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
}

.three-cols {
  display: grid;
  grid-template-columns: 24px 20px 1fr;
  align-items: center;
}

.mx-side-nav-node {
  @extend .rounded-x-sm;
  box-sizing: border-box;
  display: flex;
  height: 36px !important;

  &__item {
    height: 100%;
    width: 100%;

    .mat-icon {
      height: 20px;
      width: 20px;
      padding: 0;
      border-radius: 0;
      font-size: 20px;
    }

    .node-name {
      @extend .gl-body-md;
      margin-left: 6px;
      padding-right: 8px;
      overflow: hidden;
      white-space: nowrap;
    }
  }

  &[category] {
    height: 24px !important;
    display: flex;
    align-items: center;
    padding: 0 4px;

    .node-name {
      @extend .gl-label-sm;
      white-space: nowrap;
    }
    .mat-divider {
      width: 100%;
    }
  }

  &[group] {
    .node-expand-icon {
      width: 16px;
      height: 16px;
      margin: 0 2px 0 6px;
    }
    &.is-group-item {
      &.is-side-nav-close::after {
        content: '';
        display: inline-block;
        position: absolute;
        z-index: 3;
        right: 13px;
        width: 1px;
        height: 100%;
      }
      .node-name {
        @extend .gl-body-md;
      }
      &.is-active {
        .node-name {
          @extend .gl-label-md;
        }
      }
    }
  }

  &[route] {
    &.is-active {
      &::before {
        content: '';
        position: absolute;
        left: 0;
        width: 4px;
        opacity: 1;
      }
      .node-name {
        @extend .gl-label-md;
      }
    }
    &.is-group-item {
      &.is-side-nav-close::after {
        content: '';
        display: inline-block;
        position: absolute;
        z-index: 3;
        right: 13px;
        width: 1px;
        height: 100%;
      }
    }
  }
}
