It is my understanding that participial clauses can modify any noun in a sentence, but with some constructions this can give rise to ambiguities.
My question is whether participial phrases can modify nouns mentioned as part of a larger complex noun phrase. So, for example:
The river ran through the wood and under the bridge that James had whiled away entire afternoons on, thinking about nothing in particular.
Is the above example acceptable? Can writers construct sentences like this as long as they are unambiguous? The participial clause beginning with "thinking" clearly should apply to James, as rivers and bridges are incapable of thinking, but is its placement in the sentence incorrect? The noun James is, I think, acting as part of the post-modifier of the complex noun phrase in which "the bridge" is the head noun. Can participial clauses modify such nouns, or should I generally avoid constructions like this and rewrite them to avoid confusion?