Weight Loss and Muscle Gain
I'm a little confused about how this works. Losing weight, I know, requires a calorie deficit. I understand that and it makes sense to me. I've (embarrassingly recently) learned that a calorie surplus is needed in order to gain muscle. I guess I'd just believed that if you exercise you gain muscle, but it makes sense (thinking about it now) that a surplus would be needed in order to gain anything.
I'd like to lose weight (fat) and gain a few pounds of muscle; is it possible to do these things at the same time? Does resistance training while losing weight only help to maintain muscle mass and not increase it?