/*
 * Responsible for: the account place of a signed-in person, the same on every page: one quiet button that shows the
 * address the person signed in with. In the banner's row it stands just before the four links; in the footer's row it stands before
 * the footer's links.
 *
 * Must never: move, shrink or wrap the banner's four links or the footer's links (they keep their place at the end of
 * their row in every document), or let a long address push anything off the row: the address is cut with three dots.
 */

@layer base {
  .ia-account {
    display: flex;
    min-width: 0;
  }

  .ia-banner__row > .ia-account {
    margin-inline-start: auto;
  }

  .ia-account__button {
    appearance: none;
    margin: 0;
    border: 0;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    min-width: 0;
    max-width: 18rem;
    min-height: var(--tap);
    padding: 0 var(--s-2);
    border-radius: var(--r-md);
    color: var(--muted);
    font: 500 var(--t-sm) / 1.2 var(--sans);
  }

  .ia-footer__row > .ia-account {
    margin-inline: calc(-1 * var(--s-2));
  }

  .ia-account__email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* The kit's chevron points sideways; here it points down, at the menu it opens. */
  .ia-account__chevron {
    flex: none;
    width: var(--s-4);
    height: var(--s-4);
    transform: rotate(90deg);
  }

  .ia-account__button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .ia-account__button[aria-busy="true"] {
    opacity: 0.6;
  }

  /* What the person has bought, in plain lines above the account menu's choices: read, never chosen. */
  .ia-menu-notes {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    margin-bottom: var(--s-2);
    padding: var(--s-2) var(--s-3) var(--s-3);
    border-bottom: 1px solid var(--rule);
    color: var(--muted);
    font-size: var(--t-sm);
  }

  @media (hover: hover) {
    .ia-account__button:hover {
      color: var(--ink);
    }
  }
}
