Facebook’s earnings rise, but so do costs