Three-phase capillary pressure, hysteresis and trapping in mixed-wet rock