When Elisabeth Asbrink invites you to visit her in Stockholm, Sweden, be sure to wear your very best socks.

“I hate it when people walk into my home in their shoes. In that way I am extremely Swedish,” she said. “We find it very, very rude.”

Removing your shoes before entering a home is a universal norm in Sweden, Asbrink says — but not a lesson her immigrant parents, born in Budapest and London, ever taught her.

“When they went to the homes of colleagues and friends they would dress up, then had to have dinner in their socks. Which they found very strange,” Asbrink recalled. “They believed that it was an old tradition, from when Sweden was a peasant country full of earth and mud.”

They were wrong, as Asbrink, an acclaimed journalist, learned years later.

In “Made in Sweden” (Scribe), out Tuesday, Asbrink explains the awkward truth: Sweden’s no-shoes rule is not a quaint custom carried to the city from Sweden’s farms but the lingering effect of an edict handed down by its all-encompassing welfare state.

“In the 1930s, one of the first things the welfare state organized was housing,” Asbrink told The Post. “These were tax-paid flats, and the state wanted to control the inhabitants. So they had inspectors and actually sent them into people’s homes.”

The government issued extensive, exacting rules of conduct, cleanliness and behavior for its agents to enforce.

“The residents had to open the windows at certain times of the day. Everyone had to take a bath once a week,” Asbrink said. “And they were required to take their shoes off indoors.”

Anyone who refused to comply could be evicted.

That quirky facet of everyday Swedish life “did not rise naturally from the people at all,” Asbrink said. “It came from the state wanting to train them.”

It’s a telling glimpse of the regimentation and conformity lurking beneath the shiny surface of Sweden’s apparent utopia, a society that represents the highest hopes of the American left.

Sen. Bernie Sanders and Rep. Alexandria Ocasio-Cortez have heaped praise on Sweden as the political system of their dreams. They point to its cradle-to-grave welfare state as the source of a comfortable yet egalitarian way of life that Americans, they insist, should be clamoring to copy.

“We want to model our socialist policies off of European countries,” Ocasio-Cortez told Anderson Cooper in January. “What we have in mind and what my policies most closely resemble are what we see in the UK, in Norway, in Finland, in Sweden.”

Not so fast, says Asbrink, who was born and raised in Gothenburg, Sweden’s second-largest city. Her deep dive into the Swedish national character reveals a dark undercurrent threading through Sweden’s social paradise.

“Sweden has a very strong self-image of being a good country,” Asbrink said. “It’s in the tradition of Sweden to put itself forth as a moral role model.”

For more than a century, that moral imperative has driven Swedes — from philanthropist Alfred Nobel to diplomat Olof Palme to teen climate activist Greta Thunberg — to lecture the world on peace, justice and progress.

“Of course it’s a lie,” Asbrink said. “But it’s at the foundation of a lot of our political decisions.”

To maintain their notion of national goodness, Swedes turn a blind eye to the more disturbing elements of their history, Asbrink writes.

They don’t discuss the 63,000 of their fellow citizens who were forcibly sterilized, right up until 1976, to keep the welfare system free of children who might inherit mental or physical disabilities. “As soon as welfare is based on all citizens contributing,” Asbrink writes, “those who are not considered contributors become a problem.”

Swedes also suppress the memory of their nation’s willing collaboration with Nazi Germany during most of World War II even while technically maintaining neutrality.

“Sweden managed to maneuver itself through the war without officially taking sides,” Asbrink said. “So all the people in Sweden who wanted Hitler to win — and there were many of them — never had to deal with the consequences or the stigma that collaborators in the occupied countries received.”

That meant even members of the Swedish Nazi party, including IKEA founder Ingvar Kamprad, could remain unrepentant.

“That ideology went below, like a submarine, but was never really dealt with,” Asbrink said. In the 1980s, some of the former fascists helped form the Sweden Democrats, now the nation’s third-largest political party and the focal point of its anti-immigration movement.

The other pillar of Sweden’s national character is lagom, or “doing things according to the law,” as Asbrink translates the concept.

They tend to idealize Sweden . . . But they’re thinking of the Sweden of 1983. - author Elisabeth Asbrink on Dems’ admiration for her nation

“We Swedes like order,” she said. “We like to direct how to do things, and then we like to stick to it. It’s deeply integrated into Swedish mentality and culture: Each person stays in their place, and no one gets ahead of anyone else.”

Those twin concepts — the relentless sense of national goodness, the strict sense of national order — form the spine of Sweden’s welfare state. But maintaining them comes at a cost.

‘Nowhere else has the direct link between individual and state evolved as far as in Sweden,” Asbrink writes.

“You don’t expect your family or relatives or friends or charity organizations to help if you become vulnerable,” she said. “You expect the state to help you.” Swedish parents have no obligation to their children once they turn 18. The elderly turn to the state rather than their adult offspring for support.

“This of course means freedom from family bonds or ties,” Asbrink said. “But it also means isolation. People feel lonely. There is a built-in depression that comes with this deal with the state.”

From the 1950s through the 1970s, that translated into some of the developed world’s highest suicide rates and had a noticeable impact on Sweden’s artists.

“Our dark side can be seen in our culture, in our films and books,” Asbrink said. Ingmar Bergman’s “The Seventh Seal,” featuring a black-robed, chess-playing Death, and the cynical Scandi noir genre of crime fiction — which later gave rise to “The Girl with the Dragon Tattoo” and its sequels — captured the depths of Swedish dysphoria.

Alcohol offers a traditional escape from the emotional pall. But even Sweden’s drinking culture is constrained.

“The habit here is to drink on the weekend and not at all during working days. But then when you do drink, to drink a lot,” Asbrink said.

Dropping their everyday mask of lagom requires a kind of transformation. To do it, Swedes flash a universal signal: They sing the first few lines of “Helan Gar,” a 19th-century drinking song that translates as “Here’s the first” — and whose very lyrics herald a binge in the offing.

“A party is not properly Swedish without it,” Asbrink said.

The ubiquitous “Helan gar” has been Sweden’s unofficial anthem for decades. In 1957, the national ice-hockey team famously sang it on the medal podium after they pulled off a shocking World Cup victory over the Soviet Union.

“If you find two Swedes in any part of the world, they will happily sing it for you,” Asbrink says.

The shared heritage of this simple tune helped form the connective tissue that the Swedish state relied on as its social safety net grew. But over time and under pressure, even those bonds can begin to fray.

The Sweden that America’s democratic socialists want to emulate, in fact, no longer exists.

“I think they tend to idealize Sweden. Swedes do that as well. But they’re thinking of the Sweden of 1983,” Asbrink said. “In terms of economic equality, that was the year when income differences were as low as they have ever been. Our politicians in the last 25 years have actually chosen to make those differences bigger.”

A host of incremental changes, beginning in the early 1990s during a painful recession that shrank tax revenue while increasing demand for social services, have had a revolutionary effect, she explained. In Sweden’s cities, new rules shifted the housing balance away from rental units — which had encouraged economically mixed neighborhoods — toward condominiums, pushing low-income residents out to the suburbs in a major population shift.

Services that once were state-run, from pharmacies to postal deliveries, have been privatized. With the introduction of private schools, Sweden’s children no longer share the same educational opportunities. A public medical system plagued by long wait times convinced many employers to begin offering private health insurance to their workers.

Along with those gradual shifts, a steep increase in immigration since 2011, fueled by hundreds of thousands of Syrian and African refugees, has tested the limits of Swedish generosity. The rise of populist and nationalist political parties since 2014 reflects that continuing unrest.

“Swedes have become more individualistic,” she said. “They don’t say ‘we’ anymore — they say ‘I,’ they say ‘me.’

“Altogether, it means that equality here is not what it used to be.”