Enumeration and structure of trapezoidal words