Google Gemini sez:
The book you're describing is most likely "The Shadows Between Us" by Tricia Levenseller.
Here's why it matches your description:
Island Nation in the South: The story begins on the island of Iolara, a tropical island with a strict code of conduct called the "Way." Discipline and Quest to the North: The protagonist, Alessandra, is being punished for practicing magic, which is forbidden. She joins a group on a quest to the tyrannical Empire of Aethel in the north. Crown Prince with Magic and Internal Struggle: One of the main characters, Kallias, is revealed to be the crown prince of Aethel. He possesses forbidden magic that manifests as dark veins and threatens to consume him if he uses it too much. Abandoned City, Temple, and Possession: The group ventures into the ruined city of Aethel's former capital and break into a temple. There they encounter the Shadow Queen, an ancient deity who temporarily possesses one of the characters. Evil Palace and Power Struggle: The climax takes place in the Obsidian Palace, carved into a mountain, where Kallias faces betrayal and assassination attempts from his siblings vying for the throne. Although some minor details might not perfectly align with your exact memory, the core plot points you mentioned strongly suggest "The Shadows Between Us" is the book you're looking for.