I usually prefer to do research before I get too in-depth with the related plot point so I have a decent understanding of the subject matter and can write the details that make sense to include when the time comes. Often only about 10% of my research actually comes out on the page, but I think having the other 90% in my brain still makes the story better. Plus, I don't always know which details will be important to include until I actually write it. It's the third book in a police detective series, so completely leaving out legal details would be an oversight, but I tend to focus more on the emotional aspect in my books (whether that's a good thing depends on which reader you ask). The legal information is still important to me regardless of how much makes it into the final book. I just feel like I have a mental block if I can't envision exactly how something is going to work out!