diff --git a/nextjs-app/components/SchoolDetailView.module.css b/nextjs-app/components/SchoolDetailView.module.css index 843266e..b4f25bd 100644 --- a/nextjs-app/components/SchoolDetailView.module.css +++ b/nextjs-app/components/SchoolDetailView.module.css @@ -4,6 +4,29 @@ max-width: 100%; } +/* Standalone back link, sits above the header card on the page background. */ +.topBack { + display: inline-flex; + align-items: center; + gap: 0.4rem; + margin: 0 0 0.75rem; + padding: 0.25rem 0; + font-size: 1.0625rem; + font-weight: 600; + color: var(--accent-coral, #e07256); + background: none; + border: none; + cursor: pointer; + line-height: 1.2; + transition: color 0.15s ease; +} + +.topBack:hover { + color: var(--accent-coral-dark, #c85a3e); + text-decoration: underline; + text-underline-offset: 2px; +} + /* Header Section */ .header { background: var(--bg-card, white); diff --git a/nextjs-app/components/SchoolDetailView.tsx b/nextjs-app/components/SchoolDetailView.tsx index 85acc15..c982c69 100644 --- a/nextjs-app/components/SchoolDetailView.tsx +++ b/nextjs-app/components/SchoolDetailView.tsx @@ -106,6 +106,10 @@ export function SchoolDetailView({ } }; + const scrollToTop = () => { + if (typeof window !== 'undefined') window.scrollTo({ top: 0, behavior: 'smooth' }); + }; + useEffect(() => { const el = sectionLinksRef.current; if (!el) return; @@ -306,6 +310,13 @@ export function SchoolDetailView({ return (
+ {/* Standalone back link, above the header — returns to wherever the + user came from. Scrolls away with the page (the sticky bar keeps a + "back to top" control in its place). */} + + {/* Header */}
@@ -439,9 +450,9 @@ export function SchoolDetailView({ {/* Sticky Section Navigation — docks under the global header */}