Resize APFS (encrypted) container
Simply resizing Files (disk0s3) and then expanding the container (disk0s2) while "shifting" disk0s3 won't work.

You have to take this path:


Resize disk0s3 with diskutil:

diskutil resizeVolume disk0s3 40g

Create a fourth partition Files2 (HFS+) with Disk Utility at the end of the disk
Copy all files from Files to Files2
Remove disk0s3 (Files) with Disk Utility
Rename Files2 to Files
Expand disk0s2 (if not already done automatically in step 4):

diskutil ap resizeContainer disk0s2 0