How do i put a Focus style only if not in readonly on input

So i have an input border:
default: Solid 1px Black
readonly: 0 border
focus: solid 2px Black

The problem is when i click on the input while in readonly mode, i have the focus border (which i don’t want)
I have tried to add the readonly as a condition in the focus state, but it doesn’t work. Is there a way of doing that ?