Cosmic-ray gradient measurements and modulation beyond the inner solar wind termination shock