Personally, I'd look into finding the right teacher who's fluent in the styles you like.
'how would I construct efficient lead lines that fit over guitar riffs that hop about over a small passage of bars where each bar is different key'
First, remember the goal is melody. It's not "I play this in this chord, and that on that chord." Jazz isn't "playing over changes, it's playing through changes. As you alluded to, it's having a melody that works across and with the harmony underneath. if you don't read the rest of this post, here's the main takeaway: you do it by embellishing the melody.
Depending where you're starting from, I'd suggest a couple things:
1. start practicing over two non-diatonic (not in the same key) chords. 2-4 measures of each. For example, a measure of C and a measure of E. Get used to the difference in sound. If you can't do this yet in a variety of keys with a variety of chords, start here. Then do 3 chord loops, etc. Slowly expand.
2. Once you have that basic proficiency, start learning jazz standards. They're standards for a reason, and they have a lot to teach you. Step 1 above is almost mechanical, wrapping your brain around it. It's necessary, but get to step 2 - actual music - as soon as you can.
2a. Learn the tunes, harmony AND melody
2b. Learn to improvise through the changes, if you need to break it down into "practice the A section separately from the B section, so be it... at first, then put them together. A good way to do it is take the melody for thesong and start to embellish it. Don't just start whipping out scales that go over the chords.
Here's a starting point: https://vincedickinson.home.blog/2019/0 … her-tunes/
3. Once you have a few standards under your belt, learn to connect them. IMHO a lot of this, but obviously not the only part, is learning when and how to apply diminished scales in a musical fashion.
4. This should probably be step 0, but don't forget to work on your rhythm. Without good timing, you won't sound good and your phrases will be extremely limited. It's rhythm that largely defines genres, and gives the feel and interest to a particularly line.
https://vincedickinson.home.blog/2019/0 … es-rhythm/
5. I highly, highly recommend reading Victor Wooten's "The Music Lesson."
I also can't recommend learning to read music enough. Even at a basic level, it will open up so much - including the Real Book, and a myriad online sheet music resources for every genre. I used Modern Method for Guitar, Vol 1 - I spent 15 minutes a day and worked through it. I'm not a great reader by any stretch, but fluent enough to figure things out, and it really opened a world of possibilities to me.
As for Youtube resources, watch all the Hal Galper videos. Mandatory viewing for every musician in any style:
https://vincedickinson.home.blog/2020/0 … r-classes/