Geomechanical optimization of hydraulic fracturing in unconventional reservoirs: a semi-analytical approach