fix(nav): center About/Blog using 3-col grid layout

Replace flex+ml-auto with grid-cols-[1fr_auto_1fr]:
- Col 1 (1fr): logo, left-aligned
- Col 2 (auto): nav links, truly centered regardless of button width
- Col 3 (1fr): auth button, flex justify-end

Works on mobile too: About sits perfectly centered between logo and button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Manohar Gupta 2026-05-31 02:11:32 +05:30
parent c5cb9570b2
commit 52a60a7cff

View file

@ -17,9 +17,10 @@ export function MarketingNav() {
return ( return (
<header className="sticky top-0 z-50 bg-white/95 backdrop-blur-md border-b border-rose-100 shadow-sm"> <header className="sticky top-0 z-50 bg-white/95 backdrop-blur-md border-b border-rose-100 shadow-sm">
<div className="max-w-5xl mx-auto px-5 py-3.5 flex items-center gap-3"> {/* 3-col grid: logo left · nav truly centered · auth right */}
{/* Logo */} <div className="max-w-5xl mx-auto px-5 py-3.5 grid grid-cols-[1fr_auto_1fr] items-center">
<Link href="/" className="flex items-center gap-2 group shrink-0"> {/* Left: Logo */}
<Link href="/" className="flex items-center gap-2 group">
<span className="text-2xl transition-transform duration-200 group-hover:scale-110">🌸</span> <span className="text-2xl transition-transform duration-200 group-hover:scale-110">🌸</span>
<span <span
className="text-xl font-bold text-gray-900 tracking-tight" className="text-xl font-bold text-gray-900 tracking-tight"
@ -29,8 +30,8 @@ export function MarketingNav() {
</span> </span>
</Link> </Link>
{/* Center nav — grows to fill space, links pushed right via ml-auto */} {/* Center: nav links */}
<nav className="flex items-center gap-0.5 ml-auto mr-2"> <nav className="flex items-center gap-0.5">
{/* About — always visible, including mobile */} {/* About — always visible, including mobile */}
<Link href="/about" className={navLinkClass(pathname, "/about")}> <Link href="/about" className={navLinkClass(pathname, "/about")}>
About About
@ -44,7 +45,10 @@ export function MarketingNav() {
</Link> </Link>
</nav> </nav>
<NavAuthButton /> {/* Right: auth button */}
<div className="flex justify-end">
<NavAuthButton />
</div>
</div> </div>
</header> </header>
); );