Query a selector while ignoring matches within specific nested elements.