On the basis of micro- and mesoscale investigations, a new mathematical formulation is introduced in detail to investigate multiscale gas-transport phenomena in organic-rich-shale core samples. The formulation includes dual-porosity continua, where shale permeability is associated with inorganic matrix with relatively large irregularly shaped pores and fractures, whereas molecular phenomena (diffusive transport and nonlinear sorption) are associated with the kerogen pores. Kerogen is considered a nanoporous organic material finely dispersed within the inorganic matrix. The formulation is used to model and history match gas-permeation measurements in the laboratory using shale core plugs under confining stress. The results indicate significance of molecular transport and strong transient effects caused by gas/solid interactions within the kerogen. In the second part of the paper, we present a novel multiscale perturbation approach to quantify the overall impact of local porosity fluctuations associated with a spatially nonuniform kerogen distribution on the adsorption and transport in shale gas reservoirs. Adopting weak-noise and mean-field approximation, the approach applies a stochastic upscaling technique to the mathematical formulation developed in the first part for the laboratory. It allows us to investigate local kerogen-heterogeneity effects in spectral (Fourier-Laplace) domain and to obtain an upscaled "macroscopic" model, which consists of the local heterogeneity effects in the real timespace domain. The new upscaled formulation is compared numerically with the previous homogeneous case using finite-difference approximations to initial/boundary value problems simulating the matrix gas release. We show that macrotransport and macrokinetics effects of kerogen heterogeneity are nontrivial and affect cumulative gas recovery. The work is important and timely for development of new-generation shale-gas reservoir-flow simulators, and it can be used in the laboratory for organic-rich gas-shale characterization.