Ayatollah Ali Khamenei is dead, leaving Iran at war and without its most powerful figure. Here's how the system will choose his successor.