/* Rows render in data order and move by transform, so nothing reflows mid-gesture. Only displaced rows
   animate; the held row states `transition: none`, which would lag the finger. Selection is suppressed
   only during the drag, since a drag across rows is a text selection to the browser. */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-reorder-list {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  /* The rail runs through the rows, so each row pads its own bottom. The drag gap is a measurement, so it
     arrives inline. */
  .lotics-reorder-list[data-reorder="buttons"] {
    gap: 0;
  }

  .lotics-reorder-list[data-dragging] {
    user-select: none;
  }

  .lotics-reorder-list__item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-shrink: 0;
  }

  /* Only a drag list pays for the transition. */
  .lotics-reorder-list[data-reorder="drag"] .lotics-reorder-list__item {
    transition: transform var(--lotics-duration-base) var(--lotics-ease-standard);
  }

  .lotics-reorder-list__item[data-dragging] {
    /* The drag rung; a flex item gets a stacking context from `z-index` alone. */
    z-index: var(--lotics-z-drag);
    transition: none;
  }
}
