$cssPath = "site\assets\style.css"
$css = Get-Content $cssPath -Raw

# 1. Clean up the corrupted print media query
$css = $css -replace '(\.nav-bg\{background:#fff !important;)[\s\r\n]*backdrop-filter[^}]+\}', '$1}'

# 2. Update the main .nav-bg class to include glassmorphism
# Find: .nav-bg{position:relative;overflow:hidden;background: ... transparent 60%);}
# Or we can just append a specific override at the bottom of the file to ensure it works correctly without parsing issues.

$glassCss = @"

/* Glassmorphism Override for .nav-bg */
.nav-bg {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.85) !important;
}
"@

if ($css -notmatch "Glassmorphism Override") {
    $css += $glassCss
}

Set-Content -Path $cssPath -Value $css -Encoding UTF8
Write-Host "CSS fixed properly."
