We solve the problem in three geometric steps using midsegment and isosceles trapezoid properties:
1. **Determine the Base Lengths:**
By the Trapezoid Midsegment Theorem, the midsegment \(MN\) has length:
\[ MN = \frac{AB + CD}{2} = 16 \implies AB + CD = 32 \]
In \(\triangle ACD\), \(MP\) connects the midpoint of \(AD\) parallel to base \(CD\), so \(MP = \frac{1}{2}CD\). In \(\triangle ABD\), \(MQ\) connects the midpoint of \(AD\) parallel to base \(AB\), so \(MQ = \frac{1}{2}AB\). Therefore, the segment along the midsegment between the two diagonals is:
\[ PQ = MQ - MP = \frac{AB - CD}{2} = 5 \implies AB - CD = 10 \]
Solving the linear system:
\[ AB = \frac{32 + 10}{2} = 21, \quad CD = \frac{32 - 10}{2} = 11 \]
2. **Determine the Height:**
Dropping altitudes from \(D\) and \(C\) perpendicular to base \(AB\) at \(D'\) and \(C'\), respectively, the projection of leg \(AD\) onto \(AB\) is:
\[ AD' = \frac{AB - CD}{2} = 5 \]
Applying the Pythagorean theorem in right triangle \(\triangle AD'D\):
\[ (DD')^2 = AD^2 - (AD')^2 = 13^2 - 5^2 = 169 - 25 = 144 \implies DD' = 12 \]
3. **Determine the Diagonal Length:**
The remaining segment along the base from \(D'\) to \(B\) has length:
\[ D'B = AB - AD' = 21 - 5 = 16 \]
Notice that for any isosceles trapezoid, \(D'B\) is equal to the midsegment length \(MN\).
Applying the Pythagorean theorem in right triangle \(\triangle BD'D\):
\[ BD = \sqrt{(DD')^2 + (D'B)^2} = \sqrt{12^2 + 16^2} = \sqrt{144 + 256} = \sqrt{400} = 20 \]
Since the diagonals of an isosceles trapezoid are congruent, \(AC = BD = 20\).