How to Select The Closest Previous Sibling with CSS (without knowing its position)

The idea is to first use the general sibling selector (~) to match all the relevant previous siblings. Then, with :nth-last-child…