/*
 * THE TOOLBAR ROW above a list. WHAT WRAPS IS THE VERB, NEVER THE SEARCH: the
 * field keeps its readable floor at every width, so a long primary verb pushes
 * itself onto the next line instead of squeezing the query box.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-filter-band {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    min-width: 0;
    gap: var(--lotics-space-8);
  }

  /* Takes the slack, but never so much that the pills beside it lose their
     words. */
  .lotics-filter-band__search {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 220px;
    min-width: 180px;
    max-width: 320px;
  }

  /* Collapsed the cap goes and the field takes the whole row. The FLOOR stays:
     it is what decides that the verb wraps under the search. */
  .lotics-filter-band[data-collapsed] .lotics-filter-band__search {
    flex-basis: auto;
    max-width: none;
  }

  .lotics-filter-band__action {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-shrink: 0;
    min-width: 0;
  }

  /* Wide, the verb sits at the far edge, away from the dimensions. Collapsed it
     follows the one Filters button: a gap that wide on a phone reads as a
     missing control. */
  .lotics-filter-band:not([data-collapsed]) .lotics-filter-band__action {
    margin-left: auto;
  }
}
