/*
 * THE FIXED-HEIGHT MENU ROW. One line, the control band's own height, the
 * control corner — a stack of these IS a popover menu, an outline rail or a
 * listbox.
 *
 * Selection and current-ness paint the SAME highlight and are different facts:
 * `data-selected` is a listbox option's state, `data-current` a navigation set's
 * — so the sheet answers `data-current`, which the component sets for both, and
 * the ARIA is what tells them apart. The keyboard/hover row sits one rung
 * lighter so the two stay distinguishable.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-menu-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    /* The control band's height by default. A DENSE list sets
       `--lotics-menu-button-height` on the box that holds the rows, so one
       declaration moves every row in that list. */
    height: var(--lotics-menu-button-height, var(--lotics-control-height));
    gap: var(--lotics-space-8);
    padding-block: 0;
    padding-inline: var(--lotics-space-8);
    margin: 0;
    border: 0 solid transparent;
    border-radius: var(--lotics-radius-control);
    background-color: transparent;
    color: var(--lotics-ink-default);
    --lotics-icon-color: currentColor;
    font-family: var(--font-sans);
    font-size: var(--lotics-text-md);
    line-height: var(--lotics-leading-md);
    letter-spacing: var(--lotics-tracking-md);
    text-align: start;
    appearance: none;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

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

  .lotics-menu-button__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
    color: inherit;
  }

  /* ─── Ink ─────────────────────────────────────────────────────────────── */

  .lotics-menu-button[data-tone="danger"] {
    color: var(--lotics-ink-danger);
  }

  /* A blocked row keeps its geometry and loses its weight — the label and glyph
     go muted, and the row stops inviting the press. */
  .lotics-menu-button[data-disabled] {
    color: var(--lotics-ink-inactive);
    opacity: var(--lotics-disabled-opacity);
    cursor: default;
  }

  /* ─── Highlights ──────────────────────────────────────────────────────── */

  .lotics-menu-button[data-current] {
    background-color: var(--lotics-wash-selected);
  }

  /* Two attributes, one rung, and neither is redundant: `data-focused` is the
     kit's, for the combobox pattern where the rows are never focused, and
     `data-highlighted` is Base UI's, emitted by a `Menu.Item` this row renders
     through (§3 forbids inventing a second name for it). */
  .lotics-menu-button[data-focused],
  .lotics-menu-button[data-highlighted] {
    background-color: var(--lotics-wash-hover);
  }

  .lotics-menu-button:not([data-disabled]):not([data-current]):hover {
    background-color: var(--lotics-wash-hover);
  }

  .lotics-menu-button:not([data-disabled]):active {
    background-color: var(--lotics-wash-press);
  }
}
