Housing has gotten less affordable in all Southern California counties, compared to a year ago.

Statewide housing affordability reached its lowest level since mid-2018, as higher prices fueled by a shortage of homes for sale pushed the state’s median home price more than 22 percent higher on a year-over-year basis, according to the California Association of Realtors (C.A.R.).

The percentage of home buyers who could afford to purchase a median-priced, existing single-family home in California in the first quarter of 2021 dropped to 27 percent from 35 percent in the first quarter of 2020, the organization said.

The first-quarter 2021 figure is less than half of the affordability index peak of 56 percent in the first quarter of 2012.

Among Southern California counties, Orange County was the least affordable at 20 percent and a median home price of $1million.

Los Angeles County was at 25-percent affordability for the first quarter, with a median home price of $682,360.

C.A.R. estimated that L.A. County residents would need a minimum annual income of $124,400 to afford the $3,110 in monthly home payments, including taxes and insurance.

Orange County residents would need to earn $182,400 per year to afford average monthly home payments of $4,560.

San Bernardino County was the most affordable at 45-percent and a median home price of $399,000.

Statewide, a minimum annual income of $131,200 was needed to qualify for the purchase of a $720,490 statewide median-priced, existing single-family home in the first quarter of 2021. The monthly payment, including taxes and insurance on a 30-year, fixed-rate loan, would be $3,280, assuming a 20-percent down payment and an effective composite interest rate of 3.08 percent.