I'm a big fan of hardtail mountain bikes. Relatively cheap & easy to find. You can spend $600 for a decent used bike & complete gear if you shop carefully. Swap the tires for street tires. A mountain bike is a bit more effort than a road bike, and you won't be going as fast. It will do what you want. All bikes are a compromise.
I did motorcycle touring on a GPZ 750 sportbike for many years, even after experts told me it was impossible. It wasn't optimum but I had more fun & adventure using it than I would have waiting to get the Goldwing I was told was required.
The cyclocross bike is a good suggestion. Bit harder to find in your budget range.
And get a good tire pump. Most bikes I see are struggling around on under-inflated tires.