/*
 * TWO READINGS ON ONE AXIS. Each arm is a head line over a full-width track, so both tracks share
 * two x's. The subject fills with the accent; the reference is neutral.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-comparison-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--lotics-space-12);
    min-width: 0;
    /* `Progress`'s default, so a meter and a comparison share one bar weight. */
    --lotics-comparison-bar-thickness: var(--lotics-space-10);
  }

  .lotics-comparison-bar__arm {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* The head and its track are one object. */
    gap: var(--lotics-space-4);
    min-width: 0;
  }

  .lotics-comparison-bar__head {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--lotics-space-8);
    min-width: 0;
  }

  /* Flex, so a block wrapper carries no page-size strut. */
  .lotics-comparison-bar__label {
    display: flex;
    /* The label gives way: a cut figure is a wrong number. */
    min-width: 0;
    flex-shrink: 1;
  }

  .lotics-comparison-bar__figure {
    display: flex;
    flex-shrink: 0;
  }

  .lotics-comparison-bar__track {
    position: relative;
    height: var(--lotics-comparison-bar-thickness);
    border-radius: var(--lotics-radius-full);
    background: var(--muted);
    overflow: hidden;
    /* As `progress.css`: a groove, not a grey strip. */
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lotics-shadow-color) 4%, transparent);
  }

  .lotics-comparison-bar__indicator {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--lotics-comparison-bar-share);
    border-radius: var(--lotics-radius-full);
    background: var(--lotics-accent);
  }

  /* A solid, to separate from the palest neutral under it. */
  .lotics-comparison-bar__arm[data-arm="reference"] .lotics-comparison-bar__indicator {
    background: var(--lotics-tone-zinc-solid);
  }
}
