Mechanisms of adaptation to the fitness cost of antibiotic resistance