  The magnetic fields generated in non-central heavy-ion collisions are among
the strongest fields produced in the Universe, reaching magnitudes comparable
to the scale of the strong interactions. Backed by model simulations, the
resulting field is expected to be spatially modulated, deviating significantly
from the commonly considered uniform profile. To improve our understanding of
the physics of quarks and gluons under such extreme conditions, we use lattice
QCD simulations with $2+1$ staggered fermion flavors with physical quark masses
and an inhomogeneous magnetic background for a range of temperatures covering
the QCD phase transition. We assume a $1/\cosh^2$ function to model the field
profile and vary its strength to analyze the impact on the computed observables
and on the transition. We calculate local chiral condensates, local Polyakov
loops and estimate the size of lattice artifacts. We find that both observables
show non-trivial spatial features due to the interplay between the sea and the
valence effects.
