It depends on how off road you're planning. If it's just some dirt track thrown in to a ride with tarmac then you're probably best off getting something that's a road bike but with enough space for bigger tyres (30c -ish), like a Cannondale Synapse or Genesis Datum. But if you're thinking of rides that are majority off road or with bits of forest thrown in then you probably want a more "all-road" or cross specific frame that can take 33c+. Generally the bigger the tyres the frame can take the more compromised the speed/handling will be on tarmac.
It depends on how off road you're planning. If it's just some dirt track thrown in to a ride with tarmac then you're probably best off getting something that's a road bike but with enough space for bigger tyres (30c -ish), like a Cannondale Synapse or Genesis Datum. But if you're thinking of rides that are majority off road or with bits of forest thrown in then you probably want a more "all-road" or cross specific frame that can take 33c+. Generally the bigger the tyres the frame can take the more compromised the speed/handling will be on tarmac.