Yorkshire need 361 runs, with five wickets remaining, to beat Hampshire, who dominated play on day three at Headingley.