An elegant and robust solution for this problem uses Lucas's Theorem. This theorem breaks down the calculation of `nCr % p` into smaller calculations involving the digits of `n` and `r` in base `p`. This approach is efficient and correctly handles large values of `n`, including cases where `n >= p`.

The implementation uses a nested helper function to calculate `nCr % p` for the base case where `n < p`. This keeps the solution self-contained and easy to follow.

```python
def ncr_modp(n, r, p):
    """
    Computes the value of nCr mod p.

    This function uses Lucas's Theorem, which requires p to be a prime number.
    The theorem allows computing nCr mod p by considering the base-p
    representations of n and r.
    """

    # Helper function to compute nCr % p for n < p.
    # It uses the formula n! / (r! * (n-r)!) with modular arithmetic.
    def _combinations_small(n_small, r_small):
        # Base cases
        if r_small < 0 or r_small > n_small:
            return 0
        if r_small == 0 or r_small == n_small:
            return 1
        # Use the identity nCr = nC(n-r) to minimize calculations
        if r_small > n_small // 2:
            r_small = n_small - r_small

        # Calculate numerator: n * (n-1) * ... * (n-r+1) mod p
        numerator = 1
        for i in range(r_small):
            numerator = (numerator * (n_small - i)) % p

        # Calculate denominator: r! mod p
        denominator = 1
        for i in range(1, r_small + 1):
            denominator = (denominator * i) % p

        # Modular inverse of the denominator using Fermat's Little Theorem
        # (denominator^(p-2)) % p
        inv_denominator = pow(denominator, p - 2, p)

        return (numerator * inv_denominator) % p

    # Main logic for Lucas's Theorem
    if r < 0 or r > n:
        return 0

    result = 1
    # Process n and r by their digits in base p
    while n > 0 or r > 0:
        # Get the last digits of n and r in base p
        n_digit = n % p
        r_digit = r % p

        # If r_digit > n_digit, then (n_digit C r_digit) is 0,
        # which makes the entire nCr % p result 0.
        if r_digit > n_digit:
            return 0

        # Calculate (n_digit C r_digit) % p and multiply it with the result
        term = _combinations_small(n_digit, r_digit)
        result = (result * term) % p

        # Move to the next digits (equivalent to a right shift in base p)
        n //= p
        r //= p

    return result
```