@use "../../styles/utils";

@include utils.layer {
  $borderBWidth: 2px;
  $borderBPassiveColor: var(--cmm-Tab-border);
  $borderBActiveColor: var(--cmm-Tab-border-active);

  .group {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .Block {
    display: flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap;
    padding: 0 0.5rem;
    line-height: 2.5;
    color: var(--cmm-Tab-font);
    border-bottom: solid $borderBWidth $borderBPassiveColor;
    margin-bottom: calc($borderBWidth * -1);
    transition: var(--cmm-transition-bg), color 0.3s, border 0.3s;

    &:hover {
      &:not(.--active) {
        border-color: var(--cmm-Tab-border-hover);
        border-color: var(--cmm-Tab-bg-hover);
        color: var(--cmm-Tab-font-hover);
      }
    }

    &:focus-visible {
      outline-color: var(--cmm-outline-color-primary);
      outline-offset: var(--cmm-outline-offset);
    }

    &--active {
      border-color: var(--cmm-Tab-border-active);
      background: var(--cmm-Tab-bg-active);
      color: var(--cmm-Tab-font-active);
    }
  }

  .list {
    display: flex;
    gap: 0.75rem;
    flex-direction: row;
    flex-wrap: wrap;
    border-bottom: $borderBWidth solid $borderBPassiveColor;
    background: var(--cmm-Tab-list-bg);
  }

  .panel {
    margin-top: 1rem;
  }
}
