Static and sliding contact of rough surfaces: Effect of asperity-scale properties and long-range elastic interactions