/* A press target around a name, id or chip. `text` sits in a line of reading, so its taller box bleeds
   back out and the line does not grow; `control` fills the control band. Both bleed horizontally so the
   token keeps the surface's left edge. Both take the control radius, since the ladder asks what a thing
   is, not its size (`docs/theming.md` §2.3). The short register's press area is a pseudo-element, since
   padding would grow the box or shift neighbours. */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-peek__trigger {
    display: flex;
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    min-width: 0;
    min-height: 32px;
    padding-block: 0;
    padding-inline: var(--lotics-space-8);
    margin-block: calc(var(--lotics-space-4) * -1);
    margin-inline: calc(var(--lotics-space-8) * -1);
    border: 0 solid transparent;
    border-radius: var(--lotics-radius-control);
    background-color: transparent;
    color: var(--lotics-ink-default);
    font-family: var(--font-sans);
    font-size: var(--lotics-text-md);
    line-height: var(--lotics-leading-md);
    letter-spacing: var(--lotics-tracking-md);
    text-align: start;
    appearance: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

  /* 40 − 32, halved: the touch target the short register still answers. */
  .lotics-peek__trigger[data-variant="text"]::after {
    content: "";
    position: absolute;
    inset: calc(var(--lotics-space-4) * -1);
  }

  .lotics-peek__trigger[data-variant="control"] {
    min-height: var(--lotics-control-height);
    margin-block: 0;
  }

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

  /* Always standalone, since a peek is ruled out of pressable rows, so the standalone hover pair
     (`docs/theming.md` §2.3). */
  .lotics-peek__trigger:hover {
    background-color: var(--lotics-wash-selected);
  }

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

  /* 320 is the reading column; the panel adds its inset each side. */
  .lotics-peek__popup {
    --lotics-popover-width: calc(320px + 2 * var(--lotics-popover-inset));
  }
}
