ASUS' dual-fan RX580 is 242mm in length. With 320mm to work with, it won't be an issue at all.
https://www.asus.com/ca-en/Graphics-Cards/DUAL-RX580-O8G/specifications/
320mm gives you a lot of room - even some of the longest cards top out right around 300mm (although there will be exceptions, of course).