BEAUFORT, S.C. — In America’s happiest seaside town, it’s legal to beat your wife on the courthouse steps. But only on Sundays.

The law is certainly archaic (if not apocryphal), but it’s the sort of nugget you might seize on as a counterpoint to the outward perfection of this quintessential Southern town. Indeed, Coastal Living magazine proclaimed Beaufort the nation’s Happiest Seaside Town earlier this year, citing “Lowcountry friendliness and urban refinement … antebellum architecture, exquisite local cuisine, and rich African-American heritage.”

In nominating towns, editors considered qualities such as rankings in the Gallup-Healthways Well-Being Index, as well as the number of sunny days, beach health, walkability and intangibles such as “coastal vibe.”

KIAWAH ISLAND: The happiest seaside town in America in 2012
PHOTOS: Kiawah, America’s happiest seaside town

Beaufort (pronounced BYOO-fort) possesses all those attributes, though strictly speaking, it isn’t seaside. It lies on Port Royal Sound and the banks of the brackish Beaufort River. Open water is 16 miles east of the historic town center, where Hunting Island State Park sports 3 miles of pristine beachfront, acres of woodland and a historic lighthouse.

Set in the heart of South Carolina’s Sea Islands, Beaufort has a walkable downtown that boasts art galleries, bookstores and antiques shops. Restaurants serve fresh-off-the-boat seafood and classic Lowcountry cuisine such as thick, spicy gumbos and just-picked collard greens. And a sprawling waterfront park doubles as a stage for live concerts.

History here is as palpable as a Lowcountry breeze blowing through the salt marshes. Roots run deep in downtown Beaufort, designated a National Historic Landmark, as well as on nearby St. Helena Island, home to a rich Gullah heritage nurtured by slave descendents.

10Best: 10 things you didn’t know about South Carolina
10Best: Explore Gullah culture in the Lowcountry

“You’re a comeyeah,” Kelly McGowan tells a woman in the back seat of her van as she shuttles passengers past stately Federal, Greek Revival and neoclassical homes along Bay Street. “Just because you’ve been here 20 years doesn’t make you a beanyeah.”

The passenger on McGowan’s Spirit of Old Beaufort tour isn’t about to contest the point.

“My daddy’s a beanyeah. My mother’s a beanyeah. We’ve beanyeah since the 1700s,” McGowan continues.

Comeyeah, she explains, is local vernacular for “come here,” or newcomer. Beanyeah translates “been here,” referring to locals. But in the state’s second oldest city (after Charleston), beanyeah status isn’t causally conveyed.

HISTORY GOES WAY, WAY BACK

The Spanish arrived in the early 1500s but failed to make a go of it. The French later met a similar fate. In 1711, the British established the first successful settlement, despite attacks from Yemasee Indians. (The town’s oldest house, said to date to 1717, still has holes that supposedly were designed as rifle slots for defense against Indian attacks.)

But for all this layered history, it’s the Civil War — or, “the recent unpleasantness,” as McGowan calls it — that still resonates with many.

“Down here there’s only one war,” says college student and Beaufort native Collin Davidson. “My granddad is still sorta bitter about it. He was actually born in Pennsylvania, but that’s a deep, dark secret.”

Davidson is strolling under a canopy of Spanish-moss-draped live oaks in the historic Old Point neighborhood. With its magnificent old homes and gracious gardens, it’s one of Beaufort’s loveliest.

“I’ve heard stories of people finding (Civil War-era) arm bones in their yards and bullets with teeth marks on them,” he says.

Beaufort was the first — and last — Confederate town occupied by Union troops during the war. They arrived in 1861, causing 1,400 residents — among them, wealthy owners of cotton plantations on nearby St. Helena Island — to flee. Ironically, the Northerners’ long occupation helped ensure Beaufort’s preservation. Some homes were confiscated and converted into Union hospitals. Of 7,500 casualties buried in the town’s National Cemetery, just 117 are Confederates.

Across the Beaufort River on St. Helena Island, 55 cotton plantations were home to 10,000 enslaved Africans who became classified as “contraband” after Union troops arrived in Beaufort. Because they were largely left to themselves after — and even before — the owners fled, their language, a Creole English dialect called Gullah, survived, along with many of their West African tribal rituals.

Penn Center, one of the first schools for former slaves, was established in 1862. Today, the site is a 50-acre National Historic Landmark District with 19 original buildings. Its museum offers a fascinating view into the island’s Gullah culture.

“This is the beginning of education for the freemen of the South,” says Victoria Smalls, the center’s director of historical and cultural programs and a native of the island.

The spot also figures into civil rights history as a place where early movement leaders gathered, and where Martin Luther King Jr. wrote part of his “I Have a Dream” speech.

MADE IT IN THE MOVIES

Hollywood discovered Beaufort with the filming of The Great Santini, released in 1979. It was based on the novel by longtime resident Pat Conroy, who’s still a fixture around town. Enough notable films — The Big Chill and Forrest Gump, among others — followed, to spark the creation of drive-by tours of on-location sites.

Guides like Carly Ware of the Beaufort Movie Tour dish about celebrities who have spent time in town. For every Barbra Streisand-as-diva story, there’s a Tom Hanks-as-mensch anecdote. (Streisand is said to have called the nearby Beaufort Marine air station and asked the commanding officer to suspend flights so they would not disturb her Prince of Tides film crew. “The noise you hear is the sound of freedom,” he reportedly replied. Hanks was accessible and friendly, posing for photos with newlyweds exiting a church.)

ARCHIVES: The 10 happiest towns in the West
ARCHIVES: San Luis Obispo named the happiest place in the USA

Other sorts of artists predate the movie makers’ arrivals. Beaufort has been an art mecca since the late 1800s, notes J.W. Roane, executive director of the local arts council.

But is it a happy arts town?

“It’s special. The spreading oaks and Spanish moss give it a romantic nature. It’s hard to break in — all of us comeyeahs are reconciled that we’re among the beanyeahs,” says the decade-long resident. “But people come to Beaufort because it’s beautiful. And yes, you could say it’s the happiest seaside place.”

10Best: 10 ways to eat shrimp in the Carolinas
10Best: Waterfront towns and villages worth visiting

If you go …

Getting there: Beaufort lies roughly midway between Charleston and Savannah.

Where to stay: A handful of plantation-style houses in the historic downtown have been converted to bed and breakfasts. Also centrally located is the contemporary City Loft Hotel, with weekday rates starting at $ 149. Cottage rentals are popular, too. For complete lodging options: http://www.beaufortsc.org/lodging/

Upcoming festivals:

• 19th Annual Beaufort Shrimp Festival, Oct. 4-5

• Annual Fall Festival of Houses and Gardens, Oct. 25-27

• Annual Penn Center Heritage Days Celebration, Nov. 7-9

Information: Visit Beaufort http://www.beaufortsc.org/