/*
 * A SORTABLE COLUMN LABEL, seated in the header cell: its padding is cancelled
 * by an equal negative margin, so the wash has room while the label still starts
 * on its column's own edge.
 *
 * A column header is CHROME — the active column steps up in INK, never in
 * weight; semibold belongs to the heading ladder.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-sort-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--lotics-space-4);
    min-width: 0;
    /* THE BAND, because this IS the column's press target. */
    min-height: var(--lotics-register-head);
    padding-inline: var(--lotics-space-6);
    margin-inline: calc(var(--lotics-space-6) * -1);
    border: 0 solid var(--border);
    border-radius: calc(var(--lotics-radius-control) - var(--lotics-space-4));
    background-color: transparent;
    background-image: none;
    /* §5 rule 1 — a `<button>` carries the UA's own 13.33px Arial. */
    font-family: var(--font-sans);
    font-size: var(--lotics-text-sm);
    line-height: var(--lotics-leading-sm);
    letter-spacing: var(--lotics-tracking-sm);
    font-weight: var(--lotics-weight-medium);
    color: var(--lotics-ink-muted);
    appearance: none;
    /* The ARROW: a column heading is a label first and a control second. */
    cursor: auto;
    text-align: start;
    touch-action: manipulation;
    /* Drag jitter on a heading starts a selection and swallows the press. */
    user-select: none;
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
    flex-shrink: 0;
  }

  /* The digits run to the column's edge, so the heading does too. */
  .lotics-sort-header[data-align="right"] {
    justify-content: flex-end;
  }
  .lotics-sort-header[data-align="right"] .lotics-sort-header__glyph {
    order: -1;
  }

  .lotics-sort-header:hover {
    background-color: var(--lotics-wash-selected);
  }
  .lotics-sort-header:active {
    background-color: var(--lotics-wash-press);
  }

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