I'm very new to blender and 3D rendering in general, so I'm not really sure what I'm doing. I've been following various YouTube tutorials to learn but none have addressed this problem. It's probably an easy fix, which is why I can't find a video about it, but I can't seem to figure it out. When I try to parent the rig with automatic weights, the mesh rotates. Here's what I mean.
This is what it looks like before automatic weights.
This is what it looks like after I apply automatic weights. Thank you to anyone who helps! Here's my blender file if you need it.