For years, we’ve faithfully heeded dermatologists’ advice to lather up with sunscreen when we head outside — and with good reason. Up to half of Americans who live to age 65 will receive a skin cancer diagnosis in their lifetime.

There’s also the less life-or-death issue of accelerated aging. Spend too much time in the sun and you’ll look older than your years.

But there’s a downside to our obsession with sun protection. We’re not getting enough vitamin D. It’s a Catch-22 — one that’s codified in the scientific literature. A study published in the American Journal of Clinical Nutrition says that “although excessive exposure to sunlight increases the risk of nonmelanoma skin cancer, the avoidance of all direct sun exposure increases the risk of vitamin D deficiency, which can have serious consequences.”

Those consequences include weakened immune function, poor calcium absorption, increased risk of certain cancers as well as increased risk of diabetes, heart disease, high blood pressure, and multiple sclerosis.

So what’s the health-conscious person to do? The key is to find a sunshine middle ground — not too much unprotected exposure, but just enough for the body to make some vitamin D. Most experts recommend 15 to 20 minutes of sunscreen-free exposure each day.

After that, it’s worth it to prioritize sun protection. But you may want to rethink high-SPF sunscreen as your first line of defense, according to the Environmental Working Group. High-SPF sunscreens provide a false sense of security, encouraging users to stay in the sun longer than they would otherwise — and ultimately increasing exposure to damaging UVA rays. Sunscreens sold in the United Stated aren’t as good at blocking UVA rays as those sold in Europe.

Many sunscreens also contain retinyl palmitate, which research has linked to skin cancer.

So when it comes to sun protection, your best bets — and your most stylish options — are the classics: maxi skirts, billowing sleeves, drapey scarves, wide-brimmed hats and sunglasses. And what better justification to go shopping than to protect your health?