The magnetic Bp star 36 Lyncis. I. Magnetic and photospheric properties