As you can see in this demo, :has() seams not to be interpreted by paged.js. https://printcss.live/4openZle7A
Then I realized :has() is very poorly supported by our common browsers. Then I realized Prince and Docraptor support it, so I give a try with this issue! Let me know if it is out of scope.