/* THE RECORD'S OUTLINE, in its two forms — a rail floating in a gutter, and the
 *  pinned bar it collapses to where there is none. One list either way, so the
 *  ROWS are one rule and only the box around them changes. Which form is drawn is
 *  the CALLER's answer (`wide`), read from its own measured container. */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-section-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--lotics-space-8);
    /* Short of the caller's gutter by the button's own text inset: a fill-less
       button shows no box, so its INK is what lines up with the section titles
       under it. `max()`, so a container with less padding than that inset does
       not push the bar out of its own box. */
    padding-inline: max(
      0px,
      calc(var(--lotics-section-nav-bar-gutter) - var(--lotics-control-text-inset))
    );
    padding-block: var(--lotics-space-6);
    border-bottom: 1px solid var(--border);
  }

  /* The rail: a column in the gutter, holding its width so the outline does not
     move as the reader scrolls through sections of different name lengths. */
  .lotics-section-nav[data-wide] {
    flex-direction: column;
    align-items: stretch;
    flex-shrink: 0;
    width: var(--lotics-section-nav-rail-width);
    gap: var(--lotics-space-10);
    padding-inline: 0;
    padding-block: 0;
    border-bottom: 0;
  }

  /* The rows, in the rail and inside the picker alike. The gap is a hair, not a
     rung: the rows are one object and their own height carries the rhythm. */
  .lotics-section-nav__list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--lotics-space-2);
  }

  /* The attention mark. It carries its own name, so it is a box rather than the
     bare dot. */
  .lotics-section-nav__dot {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
}
