/* Where the screen works inside: a heading's words with an affordance, not a field, so no resting border —
   the hover wash says it opens. The menu's rows are the option list's, each a mark, a name and a count. */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-folder-switcher {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    min-height: var(--lotics-control-height);
    gap: var(--lotics-space-8);
    margin: 0;
    padding-block: 0;
    padding-inline: var(--lotics-space-8);
    border: 0 solid var(--border);
    border-radius: var(--lotics-radius-control);
    background-color: transparent;
    background-image: none;
    color: var(--lotics-ink-default);
    font-family: var(--font-sans);
    text-align: start;
    appearance: none;
    cursor: default;
    user-select: none;
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

  .lotics-folder-switcher:hover {
    background-color: var(--lotics-wash-hover);
  }

  .lotics-folder-switcher:active,
  .lotics-folder-switcher[data-popup-open] {
    background-color: var(--lotics-wash-press);
  }

  .lotics-folder-switcher:focus-visible {
    outline: var(--lotics-ring-width) solid var(--ring);
    outline-offset: 0;
  }

  .lotics-folder-switcher__mark {
    display: flex;
    flex-shrink: 0;
  }

  /* The name gives way, never the mark or the chevron that says it opens. */
  .lotics-folder-switcher__label {
    min-width: 0;
  }

  .lotics-folder-switcher__chevron {
    flex-shrink: 0;
  }

  /* The option list's content is a column hugging its start; the row takes its width, so counts share an
     edge. */
  .lotics-folder-switcher__option {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: stretch;
    min-width: 0;
    gap: var(--lotics-space-8);
  }

  .lotics-folder-switcher__option-label {
    flex: 1;
    min-width: 0;
  }

  .lotics-folder-switcher__option-count {
    flex-shrink: 0;
    font-variant-numeric: var(--lotics-font-numeric);
  }

  /* What the menu does not hold, under its last row, on the rows' own inset. */
  .lotics-folder-switcher__note {
    padding-block: var(--lotics-space-8);
    padding-inline: var(--lotics-space-12);
    border-top: 1px solid var(--border);
  }
}
