V1005 Her: a solar-type shallow-contact binary in a triply fossil system