Scottish politics used to be so classy, or so at least many of us thought so.

There was an old and firm idea that the better-off backed the Conservatives and the poorest, Labour. The theory was not without merit.

Sure, voters were never as easy to pigeon-hole as it suggested. There were always working-class Tories and well-to-do supporters of the once dominant party of the left.

Yet a political map of Scotland for much of the late 20th century would show working-class urban constituencies painted rose red.

They were surrounded by broad swathes of true blue suburbs and country seats with the occasional block of yellow SNP in, say, the North-East or Orange Liberal Democrats in the Highlands or Borders.

That has all changed. The SNP now takes most first-past-the-post seats for Holyrood and Westminster. The three pro-UK parties hold on to their redoubts, their islands of support - while commanding at least half of all votes.

We can see the big picture. But what is happening behind those electoral maps and tables? Thankfully, we have the Scottish Election Study (SES) to tell us. This landmark, gold-standard, non-partisan survey, funded by the Economy and Social Research Council, digs deeper, slicing and dicing the electorate every which way.

Earlier this month the latest issue came out, looking at last year’s Holyrood elections. It looked at breakdowns of voters for each of the four biggest parties across four social grades.

They were all very similar indeed.

The SES team used the same social grades as UK and Scottish government statisticians. So AB for senior managers and professionals, C1 for junior managers and professionals and clerical and administrative workers, C2 for skilled manual workers and DE and for the semi-skilled, unskilled and unemployed.

For each of these grades, the results were almost the same as the national average. The SNP came out a clear winner in each one. Its support was highest among DEs, above half. And lowest for ABs, though still well over two-fifths.

The Tories narrowly beat Labour to second place in almost every social grade category, bar DE. The Conservatives had their best results among people with skilled manual occupations, where they got around a quarter of the vote. Labour, although placed third, did best among the top brass of the ABs, with more than a fifth of the vote. The party pipped the Tories in to second place among DEs. But it still got less than a fifth of the vote here. Labour has lost most of what was once its strong social base, to the SNP.

There are nuances here. Flip to the list vote, and the SNP’s huge leads are slashed in all categories, but especially in AB and C1. More independence supporters in these social grades are splitting their tickets, giving the Greens their second vote.

These social grades are objective, not subjective They tell us what class we are, not what we feel.

A fair few Scots - even those a survey-taker would carefully rank as AB or C1 - will confidently describe themselves as ‘working’ people.

But does class still count in our politics?

“It doesn't play the same role that it used to in elections,” said Ailsa Henderson, the Edinburgh University professor who leads the SES team. “We don’t see the same strong relationship between objective social grade and vote choice.”

But that, she added, is not the end of the story. “Subjective social class - whether someone feels working class or middle class - remains interesting,” Prof Henderson explained. “The weaker relationship of class and voting shouldn't be taken to mean that class no longer matters for politics.”

Think of how successive Holyrood administrations - first Labour and Lib Dems and then the SNP - have pitched their policies. They have wanted to look and sound socially fairer.

Prof Henderson stresses that national debates on values tend to focus on “what, in years past, might have been described as a working-class approach to politics that prioritises equal access, egalitarianism, and the removal of obstacles to opportunity”.

“I’m not saying the policies are delivering these values,” she said. “But this is the language used about them. Many of the policies that are seen as flagship examples of Scottish distinctiveness post-devolution, including free tuition, free personal care for the elderly, free prescriptions, come from a particular ideological position, and that position has been aligned to class.

“Class doesn't deliver voters to parties in the simple way it used to, but it still informs our political life and the way we talk about who we are as a polity.”

It has been more a couple of decades since pundits talked about “Bearsden Man”, a term first coined by Prof Henderson’s Edinburgh University colleague James Mitchell in the 1990s.

This was not quite the Scottish equivalent of Essex Man, the upwardly mobile aspirational voter New Labour targeted in the 1990s. But it was a useful byword for a swing demographic north of the border.

The wealthy Glasgow suburb, on paper, has very roughly the same social and class profile as some of Tory heartlands of the southeast of England. But its Holyrood and Westminster constituencies have delivered broadly progressive MSPs and MPs since Labour’s Sam Galbraith defeated Tory Sir Michael Hirst in 1987.

The Tories are no longer contenders in the seat, now called East Dunbartonshire. For analysts zooming out over decades that is properly interesting. Bearsden Man - and Woman, for that matter - is represented by the SNP at both parliaments.

There are those who think class identity has vanished. “I just don't think it's relevant to most people now, outside of the political bubble,” said Andy Maciver, The Herald columnist and one time Tory strategist. “I don't know one single person who votes on the basis of the class they see themselves as being.”

The Tories are struggling to hoover up those AB votes, or win leafy suburban constituencies. What is going on here?

Well, the SES has some clues. There may not be strong patterns on social grade, but there are on age, religion, education and place of birth and, above all, national identity.

Take age. The Conservatives win the votes of about half the over-80s and more than a third of the 70-79s. They can barely scrape a tenth of the under-30s. By contrast, the SNP dominates younger demographics and struggles among pensioners.

And schooling? The Tories do their worst among the most educated, running well short of a fifth of the vote among those with degrees. The party fares best among those for whom National 5 qualifications are their highest, such as old ‘o’ or standard grades.

The SNP, in contrast, does its best among people with higher education, securing nearly half of the graduate vote - though only on the constituency ballot. It sheds some of its university-educated supporters for the list to the Greens.

Church matters too, quite dramatically as it turns out. The Tories also do rather well among protestants, winning the support of more than 45% of Episcopalians and 30% of Presbyterians. Their popularity crashes among Catholics and atheists, where the SNP does best (the pro-independence party takes more than half of the non-religious vote).

Voters also split very strongly on where they were came in to the world. Just under half of all those born in Scotland - 47% - voted SNP on the constituency ballot. More than half of those born outside the UK backed the Scottish Nationalists.

The party’s support was lowest among the English-born. But it was still the most popular in this demographic, winning a plurality. The Tories did better among those originally from south of the border than with Scottish and foreign-born voters.

As the SES stressed there had been movements in voting by place of birth. “These general patterns mirror Yes support in 2014, with support highest among Scottish-born voters and lowest among those born in the rest of the UK,’ said the authors. “The difference is that the level of support is higher now, and that in a multi-party system the pro-independence SNP won more than half the vote among new Scots born outside the nation.

“On the list vote, those same voters were most likely of the demographic groups to back the Green party. Across both ballots, Conservative support is shored up by those born in England.”

So is national identity more important than class identity? Most people in Scotland identify as Scottish so the SES team took an especially close look the relative attachment of Scottish and British identities. This reveals some pretty clear patterns.

“The Conservatives do very well among voters who feel very British but not Scottish but gain almost no support from those who feel very Scottish but not British,” said the authors. “For the SNP, they win almost no support from voters who feel very British but not Scottish but win the support of nearly everyone who feels very Scottish but not British.

“Labour does best among voters who feel more British than Scottish but still have some attachment to Scottish identity as well as among people who feel equally Scottish and British. Like the Conservatives they have very little support among voters who feel Scottish and not British.”

Has class gone? Or is a social identity hiding under a national one?