It is unnecessary to use too high f number (f/11 and above - it depends on what lens you use) because too narrow apperture can cause diffraction (it ruins the sharpness).
https://luminous-landscape.com/understanding-lens-diffraction/
You have got that right. If the foreground is not too close (2-3 meter, it depends on the aperture), your pic will be sharp. It is a base and easy method. In most cases it gives good result.
There is an another technique, it is better but it is more difficult to use. First you have to determine the hyperfocal distance (or use hyperfocal distance table or calculator) then you have to set the focus to hyperfocal distance and select correct aperture. With this method the close foreground also will be sharp.
http://digital-photography-school.c...-hyperfocal-distances-and-aperture-selection/
I'd recommend you to use the latest Adobe Camera Raw to stitch photos. It can handle RAW files and works very well. The fact it uses RAWs is truly awesome, resulting image contains all of the desired shadow, midtone, and highlight information with all of the editing flexibility that comes with RAW.