Solving Maxwell’s equations in photonic nanostructures to fundamentally study light-matter coupling