Fix accessibility found in the audit

- Text contrast: teal text and button fills use #0f7183 (5.7:1), section
  accents darkened to pass on white, solid CTA buttons instead of the
  gradient, footer and subnav text raised to white/65, event and region
  colours kept on borders and swatches with ink text
- Hidden carousel slides and collapsed past events are inert
- Admin list rows carry a real link for keyboard use
- Mobile menu is a modal dialog: focus, Escape, inert background, above
  the header
- Skip to content link, one focus-visible ring, reduced-motion rule,
  focus rings on the calendar inputs
- Region headings hold their button instead of sitting inside it
- font-700 style classes (not Tailwind v4 utilities) replaced with named
  weights, and the 700/800 font files loaded
- Migration 038: alt text for blog covers and schedule graphics; event
  logos next to their title are decorative
- Drop the Church Center script from index.html; Giving loads it itself

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:07:56 -05:00
parent 5274e09571
commit 185f9831e2
61 changed files with 310 additions and 207 deletions

View file

@ -25,7 +25,7 @@ const ACTION_VARIANTS: Record<
},
fancy: {
className: "font-bold text-white hover:scale-105",
style: { background: "linear-gradient(135deg, #008fa8, #88b668)" },
style: { background: "#0f7183" },
},
};
@ -73,6 +73,7 @@ export default function Layout() {
const [activeSection, setActiveSection] = useState<string | null>(null);
const [headerHeight, setHeaderHeight] = useState(72);
const headerRef = useRef<HTMLElement>(null);
const closeMenuRef = useRef<HTMLButtonElement>(null);
const location = useLocation();
const sections = PAGE_SECTIONS[location.pathname] ?? [];
@ -84,6 +85,16 @@ export default function Layout() {
setActiveSection(null);
}, [location.pathname]);
// The open menu is modal: focus starts on its close button, Escape
// shuts it, and everything behind it is inert (below).
useEffect(() => {
if (!mobileMenuOpen) return;
closeMenuRef.current?.focus();
const onKey = (e: KeyboardEvent) => e.key === "Escape" && setMobileMenuOpen(false);
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [mobileMenuOpen]);
// The header grows and shrinks: the banner can be dismissed and the
// subnav only exists on some pages. Measure it instead of guessing,
// so the spacer below always matches.
@ -140,11 +151,18 @@ export default function Layout() {
return (
<div className="min-h-screen overflow-x-hidden">
<a
href="#main"
className="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70] focus:rounded-full focus:bg-white focus:px-4 focus:py-2 focus:font-semibold focus:text-[#073d4a]"
>
Skip to content
</a>
{/* ── NAV ─────────────────────────────────────────────── */}
<header
ref={headerRef}
className="fixed top-0 left-0 right-0 z-50 backdrop-blur-md"
inert={mobileMenuOpen}
>
{/* Tier 0, site-wide announcement */}
@ -211,7 +229,7 @@ export default function Layout() {
borderBottom: "1px solid rgba(45,200,224,0.15)",
}}
>
<span className="text-xs text-white/45">{activePage?.label}</span>
<span className="text-xs text-white/65">{activePage?.label}</span>
{/* Separates the page label from its sections */}
<span
@ -244,20 +262,26 @@ export default function Layout() {
<div aria-hidden style={{ height: headerHeight }} />
{/* Page content */}
<main>
<main id="main" tabIndex={-1} className="outline-none" inert={mobileMenuOpen}>
<Outlet />
</main>
{/*Site Footer applied to every page*/}
<Footer />
<div inert={mobileMenuOpen}>
<Footer />
</div>
{/* Mobile menu */}
{mobileMenuOpen && (
<div
className="fixed inset-0 z-40 flex flex-col items-center justify-center overflow-y-auto py-16"
className="fixed inset-0 z-[60] flex flex-col items-center justify-center overflow-y-auto py-16"
style={{ background: "rgba(7,61,74,0.97)" }}
role="dialog"
aria-modal="true"
aria-label="Menu"
>
<button
ref={closeMenuRef}
className="absolute top-5 right-6 text-white text-3xl"
aria-label="Close menu"
onClick={() => setMobileMenuOpen(false)}