On the diameter and girth of zero-divisor graphs of posets