/* =========================
   Lists
   Figma: Lists / Menu items.
========================= */

@use "../kit-deps" as *;

.list {
  margin: 0;
  padding: $space-2 0;
  list-style: none;
  border: $border-width-base $border-style-base $border-color-muted;
  border-radius: $radius-md;
  background-color: $surface-panel-muted;
  min-width: 240px;
  max-width: 100%;
}

.list-item {
  display: flex;
  align-items: center;
  gap: $space-3;
  padding: $space-3 $space-4;
  color: $neutral-900;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color $motion-base $motion-ease;

  &:hover:not(.is-disabled) {
    background-color: rgba($neutral-900, 0.04);
  }

  &:focus-visible {
    @include focus_ring;
    outline-offset: -2px;
  }

  &.is-active {
    background-color: rgba($mint-500, 0.12);
    color: $neutral-900;
  }

  &.is-disabled {
    color: $neutral-400;
    cursor: not-allowed;
  }

  .list-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: $neutral-600;
    flex-shrink: 0;
  }

  .list-item-meta {
    margin-left: auto;
    color: $neutral-500;
    font-size: 12px;
    font-weight: $font-weight-semibold;
  }
}

.list-compact {
  padding: $space-1 0;

  .list-item {
    padding: $space-2 $space-3;
    font-size: 13px;
  }
}

.list-flush {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;

  .list-item {
    border-radius: $radius-md;
  }
}

.list-divided {
  .list-item + .list-item {
    border-top: $border-width-base $border-style-base $border-color-muted;
  }
}
