/*
 * ONE pressable over the disc and the words, so the pill takes the wash; the disc is a part, since
 * a button inside a button is invalid. Hover takes the selection rung (§2.3): 2% over a page ground
 * is invisible.
 */
@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);
  }

  /* Bare, the disc is the target and padding would inflate it past the 40px band. */
  .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;
  }
}
