Ward throws 3 TD passes, Washington State tops Idaho 24-17