/**
 * Seeds DualAvatar component classes
 * Use these instead of writing out individual Tailwind utility classes.
 *
 * Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
 * CSS variable definitions and dark mode support, plus avatar.css for the
 * two Avatars themselves.
 *
 * Usage:
 *   <div class="seeds-dual-avatar" style="--seeds-dual-avatar-offset: 4px">
 *     <div class="seeds-avatar ...">JD</div>
 *     <div class="seeds-avatar seeds-dual-avatar-secondary ...">JR</div>
 *   </div>
 *
 * The overhang is driven by the --seeds-dual-avatar-offset custom property, set
 * inline by the component as a fraction of its `size` prop and inherited by the
 * secondary avatar.
 *
 * This file sits alongside avatar.css rather than inside src/DualAvatar/ because
 * racine's stylesheet aggregation globs `src/*.css` per package and does not
 * recurse into subdirectories.
 *
 * Rules live in `@layer components` so that consumer Tailwind utilities win in
 * the cascade and can override these component styles.
 */

@layer components {
  .seeds-dual-avatar {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
  }

  .seeds-avatar.seeds-dual-avatar-secondary {
    position: absolute;
    right: calc(-1 * var(--seeds-dual-avatar-offset));
    bottom: calc(-1 * var(--seeds-dual-avatar-offset));
  }

  /*
   * An image secondary has no border of its own (.seeds-avatar sets border: none),
   * so it needs a ring to separate it from the primary underneath.
   */
  .seeds-avatar.seeds-dual-avatar-secondary:not(.seeds-avatar-fallback) {
    box-shadow: 0 0 0 1px var(--color-container-bg-base);
  }
}
