Employee Benefit Plans - Additional Information (Details) - USD ($) $ in Thousands |
12 Months Ended | ||
|---|---|---|---|
Jul. 31, 2026 |
Jul. 31, 2025 |
Jul. 31, 2024 |
|
| Retirement Benefits [Abstract] | |||
| Deferred compensation arrangement with individual, recorded liability | $ 22,019 | $ 19,998 | |
| Accrued retirement and profit-sharing contributions | 4,962 | 4,742 | |
| Pension and other postretirement benefit expense | $ 20,657 | $ 17,921 | $ 16,134 |