Photo: Jessica Christian / The Chronicle Photo: Jessica Christian / The Chronicle Photo: Gabrielle Lurie / The Chronicle Photo: Gabrielle Lurie / The Chronicle Photo: Jessica Christian / The Chronicle Photo: Jessica Christian / The Chronicle Photo: Jessica Christian / The Chronicle Photo: Todd Trumbull Photo: Todd Trumbull Photo: Blanchard; John Photo: Blanchard; John

Adrian Caratowsa was lucky.

After six years of trying and failing to score an affordable apartment in San Francisco, he won the lottery for a city-subsidized apartment in the Transbay district.

Caratowsa, who once lived in a South of Market warehouse with 27 roommates, now pays around $1,000 a month for a one-bedroom at 255 Fremont St. Nearly 70 people applied for each apartment in the building.

“I can’t imagine living in the city if I didn’t have it,” said Caratowsa.

San Francisco is struggling with a herculean task: creating as much housing as possible for people like Caratowsa to make up for decades of underproduction. But the enormous cost of building in the city has meant that developers can’t create nearly enough affordable or market-rate homes. More than 30,000 homes that have been approved haven’t yet started construction, as developers try to find financing and enough workers to build.

The Chronicle found numerous factors that contribute to San Francisco’s now astronomical housing development costs. Interviews with experts and those in the building industry and a review of the data point to the culprits: a worker shortage, long waits for permits, restrictive zoning and high fees, among other things. The result is a city consistently failing to produce enough housing to meet its needs.

Caratowsa lives in Natalie Gubb Commons, a project that cost a total of $58 million to design, obtain approvals for and build. Nonprofit developer Mercy Housing relied on federal, state and city financing to build the project at a cost of nearly $500,000 per unit. The per unit price would have been far higher if the city hadn’t donated the land. The cost to build one new apartment or condo unit in San Francisco today — whether market-rate or affordable — tops $700,000, nearly triple what it cost about 10 years ago.

That means that this year, San Francisco surpassed New York for the highest construction costs in the world, according to consulting firm Turner & Townsend.

By contrast, the cost to build the average U.S. single-family house was $237,760 in 2017, according to the National Association of Homebuilders.

Construction costs are one of the primary reasons that so little housing is getting built in San Francisco. From January to September this year, construction began on just 1,281 market-rate homes, down 62% from that period last year, according to real estate data firm CoStar.

Here’s a breakdown of the factors taking San Francisco housing costs to record highs.

Key elements: It’s not surprising that actually building a structure is one of the biggest costs. “Hard costs” — paying for construction workers and materials like lumber, concrete and steel — account for about half of the total price tag, said Mark Hogan, an architect at OpenScope Studio.

Land costs vary, but on average account for around 20% of the budget. The remaining 30% are “soft costs” that include city fees and hiring consultants, attorneys, architects and other professionals.

Developer Patrick Kennedy of Panoramic Interests said market-rate developers seek around 5% annual returns, so an apartment that costs $750,000 to build would need to generate $37,500 a year after operating expenses and taxes. Rents would have to exceed $5,000 a month to make it feasible to build.

Construction costs: Labor costs have jumped 5% a year because of a shortage of workers. The 2008 recession devastated the construction industry, forcing many workers to switch careers. The Bay Area’s commercial building boom has made the problem more severe.

In recent years, projects like Salesforce Tower and Apple Park competed with housing developments for the same pool of workers, from carpenters to electricians to plumbers.

Kennedy, who has a 200-unit project under construction at 333 12th St. in San Francisco, said that a skilled worker can cost as much as $1,000 for an eight-hour day. Panoramic, he said, may spend $300,000 just on parking for its workers over an 18-month period.

Construction workers also must contend with high housing costs, which create a vicious cycle. Workers needed to build new housing must earn enough money to afford to live in the area.

Workers who move to the Bay Area from outside California require more time to be trained. They don’t know the local building codes or earthquake safety requirements, said Joseph Olla, a vice president at San Francisco general contractor Nibbi Brothers.

That level of inexperience has added to the overall cost of labor, said Kennedy. It takes up to 25% more workers today to be as productive as a decade ago, he said.

According to the McKinsey Institute, the construction industry’s labor productivity grew only 1% per year over the last 20 years, compared with 2.8% for the total world economy.

“We’re building wood framing pretty much the same way we did in 1833,” Kennedy said.

The average worker hasn’t seen huge benefits, despite the need for labor, said Scott Littlehale, senior research analyst for the Northern California Carpenters Regional Council, a construction union group. Average annual wages for construction jobs have increased 4% a year since 2012, below the 4.7% rise in the overall Bay Area economy, he said.

Olla of Nibbi Brothers said he sees higher profits for subcontractors specializing in scarcer, high-skilled jobs, such as plumbers and electricians.

Land purchase: San Francisco has among the highest land costs in the country. One extreme example: In 2017, a Chinese developer bought majority ownership of a waterfront condo site valued at a record $916,000 per unit — just for land.

Skyrocketing land costs are partially tied to how few areas in the city are zoned for apartments. Buildings with three or more apartments are allowed on only about a quarter of San Francisco’s land.

“If there’s a limited area where you are allowed to build multifamily, the prices for those areas are going to be much higher than they would be otherwise,” said David Garcia, policy director at UC Berkeley’s Terner Center for Housing Innovation. Allowing apartments in more areas could bring down the cost of housing, he said.

Fees and permits: Residents in new housing use transit, parks, schools, police and other vital services, so cities charge fees to offset the costs.

“We are trying to solve so many problems —all important — through housing” that it’s costing a lot, said Doug Shoemaker, president of Mercy Housing, the nonprofit developer that built Natalie Gubb Commons.

San Francisco fees add up to around $50,000 per unit for market-rate projects in the most active development areas, according to the Planning Department. Market-rate projects must also provide around 20% of units for low-income tenants — the highest proportion in the country — or pay fees to help fund affordable units elsewhere. Those fees add another $50,000 to $75,000 per unit.

Another factor driving up costs is San Francisco’s approval process. Developers say it is one of the most difficult in the world. Opponents of projects are empowered to easily delay them by requesting additional reviews or filing lawsuits.

Kennedy of Panoramic said these rules boost the cost of housing. “The lack of housing is a largely self-inflicted problem,” he said.

To navigate the approvals process, a slew of expensive professionals are usually required, including land use attorneys, architects, shadow consultants, open space designers and lobbyists.

Affordable projects can cost more per unit than some market-rate projects. They have additional open space and disabled-accessibility requirements, and there’s pressure for top-notch design, said Garcia of Terner Center.

“We have really high expectations of design quality that range from incredibly important to probably unnecessary,” Shoemaker said.

How to slash costs: San Francisco and California could make it cheaper to build housing by streamlining approvals, experts say. The city could adopt more “area plans,” which can speed up the process by establishing ground rules, and local officials and state legislatures could limit the ability of opponents to delay projects.

“Cities don’t control the price of materials and labor,” Garcia said, but they do have the authority to speed up approvals.

The average environmental review process, now lasting about two years, could be cut down to a few months through area plans.

Another way to save money: reduce parking requirements. Each space costs $50,000 to $100,000, Kennedy said.

Developers are also exploring modular construction, where modules are assembled elsewhere and shipped in. Kennedy said the practice can lead to a 20% savings, and cut 50% off of the construction time.

But that strategy has run into union opposition because some work on the modules is done in another city or overseas.

So for now, costs will probably keep climbing.

A San Francisco high-rise can now cost $1 million per apartment to build, about 20% higher than what is feasible, said Oz Erickson, chairman of developer Emerald Fund. With rents and home prices hitting a plateau and costs continuing to rise, he said, development is approaching “impossible.”

Roland Li is a San Francisco Chronicle staff writer. Email: roland.li@sfchronicle.com Twitter: @rolandlisf