I came across this while looking for a completely different book! Servant of the Crown.
Alison Quinn, Countess of Waxwold, is content with her bookish life—until she’s summoned to be a lady-in-waiting to the Queen of Tremontane’s mother for six months. Even the prospect of access to the Royal Library doesn’t seem enough to make up for her sacrifice, but Alison is prepared to do her service to the Crown. What she’s not prepared for is Prince Anthony North, Queen Zara’s playboy brother, who’s accustomed to getting what he wants—including the Countess of Waxwold.
When the fallout from an unfortunate public encounter throws the two of them together, Alison has no interest in becoming the Prince’s next conquest. But as the weeks pass, Alison discovers there’s more to Anthony than she—or he—realized, and their dislike becomes friendship, and then something more—until disaster drives Alison away, swearing never to return.
Then Alison is summoned by the Queen again, this time to serve as Royal Librarian. A threat to Tremontane’s government, with her treasured Library at stake, draws Alison into the conflict…and into contact with Anthony once more. Can they work together to save the Royal Library and Tremontane? And can she open her heart to love again?