Target (TGT 1.03%) has been reeling this year as it deals with the effects of inflation and a big inventory adjustment to reposition stores for what consumers want right now. After yet another sell-off in the market overall, Target is now sporting a 33% decline on the year as we head into the busy fourth-quarter shopping season.

As ugly as things have been, though, this looks like a top dividend stock to buy right now. Here's why.

1. An enduring dividend growth story, in good times and bad

Target has taken it on the chin this year. As inflation rose sharply and consumers shifted spending habits to compensate, stores had to pivot as well to meet present demand. Target opted for a "pull the Band-aid off quick" approach to alter its inventory, but the result was an operating profit margin of just 1.2% in Q2 2022, compared to 9.8% last year (more on that in a moment).

Despite the ugly quarterly print, though, the big-box store still felt comfortable doling out a 20% increase to its quarterly dividend back in June. Target is a Dividend Aristocrat (a company that has paid a dividend for at least 25 years), and has been steadily raising that dividend payout for half a century. Shares currently yield 2.8% a year.

But given inflation's nasty bite this year, is Target's dividend safe? Though the company took a big hit in its bottom line in the first half of the year, it's still profitable. Net income after tax was still substantial enough to cover dividends paid. For the time being, Target's status as an income-generating stock looks safe.

2. A quick rally in profits on the way

Back to Target's inventory adjustment. As inflation roared and consumers started spending more on food and essentials, Target found itself with excess products -- particularly in home goods. Management canceled orders and slashed prices to offload this excess and refocus on the basics that its shoppers need right now. 

It was a painful decision, but Target's top brass indicated it was the right move. After just a 1.2% operating margin in Q2, the expectation is to hit an operating margin of around 6% in the fall quarter this year, before lapping some cost headwinds from 2021 in the final quarter of the year. Talk about a quick turnaround! 

Now, 6% would still be well below the 8.4% operating margin in 2021. However, that was unusually high due to early pandemic effects. But if Target does get to 6% the second half of this year, that would still be a bit higher than pre-pandemic margins. For example, operating margins were 6%, 5.5%, and 5.8% in 2019, 2018, and 2017, respectively. If Target pulls it off, this would be a testament to the investments it made years ago in its merchandise lineup, fulfillment centers, and store remodels to drive better guest experiences.

Basically, while Target's profitability doesn't look great through the first half of 2022, a rebound in subsequent quarters could help the stock follow suit.

3. A graceful transition to an e-commerce business

Target isn't the only retailer working hard to keep consumers engaged right now. Even e-commerce giant Amazon (AMZN -2.56%) witnessed a grinding halt to its online retailing empire. Target will have to continue contending with Amazon and others to maintain the guest loyalty it's won in recent years.

But it's so-far, so-good for Target. Declining margins took the spotlight in the spring quarter, but guest traffic was an overlooked positive. In fact, in-store comparable sales grew 1.3% in Q2, and digital comparable sales jumped 9%. This marks the 21st consecutive quarter of positive comparable sales for the company, driven in particular by its efforts at increasing its proficiency in same-day delivery and pickup services that shoppers want in this era of digital commerce. 

Target's progress is significant, especially considering the amount of disruption to shopping flow the retail world experienced this year. If Target can continue to sustain or slightly build on those comp sales the second half of this year, plus increase profit margins again, shares could be a real value right now. The stock currently trades for 21 times enterprise value to trailing 12-month earnings per share -- a metric that includes the big drop-off in Q2. 

To be sure, it could take a few quarters for Target's reboot to be reflected in this valuation. However, if the company does in fact mount its comeback this fall, the market could reward Target to the upside. And don't forget that dividend you'll pick up along the way.