/* ==========================================================================
   Component: Avatars
   Description: User profile images, initials, and grouped stacks
   ========================================================================== */

/* --- Base avatar --- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--surface-sunken);
  color: var(--text-secondary);
  font-weight: 600;
}

/* --- Size variants --- */
.avatar--xs {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar--md {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.avatar--xl {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

/* --- Image fill --- */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Ring highlight --- */
.avatar--ring {
  box-shadow:
    0 0 0 2px var(--surface-base),
    0 0 0 4px var(--accent-primary);
}

/* --- Grouped avatar stack --- */
.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar {
  margin-left: -8px;
  border: 2px solid var(--surface-base);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* --- Overflow count chip --- */
.avatar-group .avatar--count {
  background-color: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}
