Housing affordability reached its lowest level in more than a decade, driven by a combination of rising mortgage rates, elevated construction costs, and limited resale inventory.

Just 37.4% of new and existing homes sold between the beginning of July and the end of September were affordable to families earning the U.S. median income of $96,300, according to the NAHB/Wells Fargo Housing Opportunity Index (HOI). The share is the lowest reading since NAHB began tracking affordability in 2012 and represents a 3.1% decrease sequentially from the second quarter.

“Steadily rising interest rates since the beginning of the year are taking a toll on housing affordability by raising housing costs for buyers and increasing the cost of development and construction loans for builders,” says NAHB chairman Alicia Huey.

Huey says that NAHB’s builder surveys indicate market conditions will likely remain challenging through the end of the year due to mortgage rates near 8%, even though the Federal Reserve appears to be done raising interest rates.

The HOI shows the national median home price held steady at $388,000 in the third quarter, while the average mortgage rate jumped to 7.13% from 6.59% in the previous quarter.

“Rising mortgage rates have clearly been the key cause of declining housing affordability conditions, and shelter costs have been the main driver of inflation,” says NAHB chief economist Robert Dietz. “And with shelter cost increases driven by a lack of affordable supply and increasing development costs, the best way to tackle America’s growing housing affordability challenges is to enact policies that will allow builders to increase the housing supply.”

The HOI also includes a metro-level analysis of the most and least affordable markets, ranked overall and by size. Lansing-East Lansing, Michigan, was the nation’s most affordable major housing market in the third quarter, defined as a metro with a population of at least 500,000. In Lansing-East Lansing, 79.8% of all new and existing homes sold in the third quarter were affordable to families earning the area’s median income of $97,800. The other most affordable major markets include Youngstown-Warren-Boardman, Ohio-Pennsylvania; Harrisburg-Carlisle, Pennsylvania; Indianapolis-Carmel-Anderson, Indiana; and Scranton-Wilkes-Barre, Pennsylvania.

The least five affordable major markets all are located in California, led by Los Angeles-Long Beach-Glendale, where just 2.7% of the homes sold during the quarter were affordable to families earning the area’s median income of $98,200. Anaheim-Santa Ana-Irvine, San Diego-Chula Vista-Carlsbad, Oxnard-Thousand Oaks-Ventura, and San Francisco-San Mateo-Redwood City rounded out the top five least affordable major markets.

Among small markets, defined as metros with populations below 500,000, Cumberland, Maryland-West Virginia was rated as the most affordable market, with 93.7% of homes sold in the quarter affordable to families earning the median income of $89,900. Other top affordable small markets include Elmira, New York; Bay City, Michigan; Davenport-Moline-Rock Island, Iowa-Illinois; and Kokomo, Indiana.

Similarly to the major housing markets, all five of the least affordable small markets were in California, including Napa, Salinas, Santa Maria-Santa Barbara, San Luis Obispo-Paso Robles, and Santa Cruz-Watsonville.