maybe a bit unrelated, but Why would you use a selector like
[src*="figure"] {
? It's as if you're trying to set up a time bomb to blow up in a few months. "hey, can you change that image from /figure.png to /image.png", boom, half your styling broken. I'd use a class instead, not only would it be more readable and intuitive and performant, it would also be less likely to break when doing unrelated changes.