/* Aggregates between a toolbar and its rows; the column gap is wider so "value label" pairs read as pairs. The
   line stands at a control's height, so the rows under it start at one place in every register. */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-totals-line {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: var(--lotics-space-24);
    row-gap: var(--lotics-space-8);
    flex-shrink: 0;
    min-height: var(--lotics-control-height);
  }

  /* The ROW wraps, never the item: a "value label" pair is one object. */
  .lotics-totals-line__item {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    gap: var(--lotics-space-6);
  }

  /* A figure naming a set is the way to it: it keeps its ink and shows its rule on reach, never at rest. */
  .lotics-totals-line__door {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    gap: var(--lotics-space-6);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: calc(var(--lotics-radius-control) - var(--lotics-space-6));
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    text-decoration-line: none;
    appearance: none;
    cursor: pointer;
  }

  .lotics-totals-line__door:hover,
  .lotics-totals-line__door:focus-visible {
    text-decoration-line: underline;
  }

  .lotics-totals-line__door:focus-visible {
    outline: var(--lotics-ring-width) solid var(--ring);
    outline-offset: var(--lotics-space-2);
  }

  /* A held figure keeps its rule while its condition narrows the rows. */
  .lotics-totals-line__door[data-pressed] {
    text-decoration-line: underline;
  }

  /* Matches `LegendItem`'s swatch: the two annotate the same charts. */
  .lotics-totals-line__swatch {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: calc(var(--lotics-radius-control) - var(--lotics-space-8));
    background-color: var(--lotics-totals-line-swatch);
  }
}
