Despite national result, Houston area goes blue - and...

Donald Trump won a surprising victory last night, built on taking traditionally Democratic states like Michigan, Wisconsin and Pennsylvania.

But Texas and the greater Houston area moved in the opposite direction. Republicans still won Texas, but with the slimmest margin since 1996. And in the greater Houston area, Fort Bend County flipped from red to blue for the first time in a presidential election since 1960, according to an analysis by the Houston Chronicle.

It wasn't increased turnout

The percentage of registered voters going to the polls stayed about the same compared to 2012.

Instead, Houston has become more urban and dense.

Thanks to population growth in the suburban Houston counties, historically red precincts also turned blue.

Harris County 2012 vs. 2016 Results: Interactive Written By John D. Harden

Copyright © Houston Chronicle 2016

Caption:

Use the map above to see where the GOP and Democrate have strengthened or weakened their grips on Harris County since 2012, based on presidential voting figures.Click the checkbox to between maps.

Urban vs. rural

Election officials draw precincts, based on population, to make sure there's enough polling places for people within a reasonable distance of where they live. So as population increases, precincts get smaller. Rural precincts grow larger.

Nowhere is that urban versus rural divide more clear than in Fort Bend County.

Precincts held by Democrats are more than four times smaller than precincts held by Republicans.

Hillary Clinton won 86 of the county's 151 precincts - a stark contrast to the 60 precincts that Barack Obama won in 2012.

Across Texas, however, rural voters still outnumber urban ones.

Harris County becomes a Democratic stronghold

The GOP lost its grip on Inner Loop areas like River Oaks, Upper Kirby, Washington Avenue, Central Northwest and Briar Forest. Democrats also are slowly moving their way beyond Beltway 8 to unincorporated areas of Harris County.

Sixty-four percent of the county precincts turned blue on Tuesday, following a trend since at least 2008, which has the county turning a darker shade of blue each election.

In 2012, Obama won by an average margin of victory of about 51 points. Clinton increased that margin by one percentage point.

See more interactive maps and results at HoustonChronicle.com/2016.