/*
 * ONE pressable over the disc AND the words, so the pill — not the circle — is
 * what the pointer washes. The disc is a part rather than a nested control for
 * the same reason: a button inside a button has no valid markup.
 *
 * A control standing on the page takes the neutral ladder's SELECTION rung for
 * its hover (§2.3): 2% over a page ground is a hover nobody sees, and this
 * control has no selected state to collide with.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-back-button {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    align-self: flex-start;
    flex-shrink: 0;
    gap: var(--lotics-space-8);
    margin: 0;
    padding: 0;
    border: 0 solid var(--border);
    border-radius: var(--lotics-radius-full);
    background-color: transparent;
    background-image: none;
    font-family: var(--font-sans);
    font-size: var(--lotics-text-sm);
    line-height: var(--lotics-leading-sm);
    letter-spacing: var(--lotics-tracking-sm);
    color: var(--lotics-ink-default);
    appearance: none;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

  /* Only words need seating: bare, the disc IS the target and any padding would
     inflate it past the 40px band every other control aligns to. A gutter less
     half a step — the pill ends closer to the word than a full rung would. */
  .lotics-back-button[data-labelled] {
    padding-inline-end: var(--lotics-space-12);
  }

  .lotics-back-button:hover {
    background-color: var(--lotics-wash-selected);
  }

  .lotics-back-button:active {
    background-color: var(--lotics-wash-press);
  }

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

  .lotics-back-button__disc {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--lotics-control-height);
    height: var(--lotics-control-height);
    border-radius: var(--lotics-radius-full);
    background-color: var(--muted);
  }

  .lotics-back-button__label {
    flex-shrink: 1;
    min-width: 0;
  }
}
