/* ===========================
 * Avatar Component Styles (Phase 3)
 * ===========================
 * Reusable identity primitive — round, image OR initials, density-aware
 * when inside .lsh-table. Standalone-usable outside tables.
 *
 * Custom-property hooks for consumer theming:
 *   --avatar-bg : background color (default --bg-tertiary)
 *   --avatar-fg : text/initials color (default --text-secondary)
 * ===========================
 * Dark mode handled by upstream semantic tokens (--bg-tertiary,
 * --text-secondary). Theme-specific tints come from custom-property
 * overrides on the element.
 * =========================== */


/* ─── 1. Base avatar ─── */

.avatar {
  --avatar-bg: var(--bg-tertiary);
  --avatar-fg: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--avatar-bg);
  color: var(--avatar-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-medium);
  font-size: 12px;
  line-height: 1;
  overflow: hidden;
  user-select: none;
  box-sizing: border-box;
}


/* ─── 2. Image variants ─── */

/* When the avatar IS the <img> directly */
img.avatar {
  object-fit: cover;
}

/* When the avatar wraps an <img> (image-with-fallback pattern) */
.avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ─── 3. Density-scoped sizing inside .lsh-table ─── */

/* Sm density — 24px */
.lsh-table[data-density="sm"] .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

/* Lg density — 40px */
.lsh-table[data-density="lg"] .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

/* Md is the default — no override needed (32px from §1 applies) */
