/*
 * ONE EVENT, three ways. A washed ground with matching ink — never a saturated
 * fill with white on it — because a month with a dozen colours in it has to stay
 * a surface you can look at. The dot is the one place the solid shade belongs:
 * it is 6px, it carries identity rather than area, and it needs the contrast.
 *
 * The family is the call site's datum, so the family's four TONE roles arrive as
 * `--lotics-event-chip-*` and the sheet paints from them: a consumer repaints a
 * family by moving the tone, not by beating an inline background.
 *
 * NONE of the variants draws a border. A washed body states its own edge, and a
 * rule on top of it is that edge asserted twice on a surface already full of
 * grid lines.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-event-chip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0 solid transparent;
    background-color: transparent;
    color: var(--lotics-ink-default);
    font: inherit;
    text-align: start;
    appearance: none;
    cursor: default;
  }

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

  .lotics-event-chip__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    /* The chip's own height decides its corners: a fixed radius turns a 20px
       lane chip into a pill and barely marks a tall block. */
    border-radius: var(--lotics-event-chip-radius);
    background-color: var(--lotics-event-chip-ground);
    color: var(--lotics-event-chip-ink);
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

  .lotics-event-chip__body[data-variant="banner"] {
    padding-inline: var(--lotics-space-8);
  }

  .lotics-event-chip__body[data-variant="block"] {
    padding-inline: var(--lotics-space-8);
    padding-block: var(--lotics-space-2);
    justify-content: flex-start;
    overflow: hidden;
  }

  /* The dot row has no ground of its own, so its hover is a NEUTRAL wash: the
     row is mostly plain text, and tinting it with the event's own hue would read
     as the event changing state rather than as the pointer being over it. */
  .lotics-event-chip__body[data-variant="dot"] {
    flex-direction: row;
    align-items: center;
    /* The banner centres its single line VERTICALLY, which in a row would centre
       the dot and its label horizontally instead. */
    justify-content: flex-start;
    gap: var(--lotics-space-6);
    padding-inline: var(--lotics-space-4);
    background-color: transparent;
    color: var(--lotics-ink-default);
  }

  .lotics-event-chip[data-pressable]:hover .lotics-event-chip__body[data-variant="banner"],
  .lotics-event-chip[data-pressable]:hover .lotics-event-chip__body[data-variant="block"] {
    background-color: var(--lotics-event-chip-hover);
  }

  .lotics-event-chip[data-pressable]:hover .lotics-event-chip__body[data-variant="dot"] {
    background-color: var(--lotics-wash-selected);
  }

  .lotics-event-chip__dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: var(--lotics-radius-full);
    background-color: var(--lotics-event-chip-dot);
  }

  /* The floor is on the LABEL, not just the row: a clamped run is
     `white-space: nowrap`, so without it the title holds its full width and
     pushes the dot out of the cell instead of ellipsing. */
  .lotics-event-chip__label {
    flex-shrink: 1;
    min-width: 0;
    color: inherit;
  }

  /* The dot variant lays the body out as a ROW, where the time qualifies the
     label and the label is the half that clips — so the time holds its width
     rather than splitting the deficit with it. */
  .lotics-event-chip__meta {
    flex-shrink: 0;
    color: inherit;
    opacity: 0.7;
  }
}
