diff --git a/nextjs-app/components/SchoolDetailView.module.css b/nextjs-app/components/SchoolDetailView.module.css index 9d74c1c..4413aae 100644 --- a/nextjs-app/components/SchoolDetailView.module.css +++ b/nextjs-app/components/SchoolDetailView.module.css @@ -205,6 +205,7 @@ flex: none; display: inline-flex; align-items: center; + gap: 0.3rem; padding: 0.3rem 0.625rem; font-size: 0.75rem; font-weight: 600; @@ -294,6 +295,119 @@ color: white; } +/* ── Mobile: the scrolling links collapse into one "section" menu button ── + (hidden on desktop, where the links fit). */ +.sectionNavMenu { + display: none; /* shown only ≤640px */ + flex: 1; + min-width: 0; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + min-height: 38px; + padding: 0.34rem 0.7rem; + background: var(--bg-secondary, #f3ede4); + border: 1px solid var(--border-color, #e5dfd5); + border-radius: 8px; + cursor: pointer; + font-family: var(--font-dm-sans), "DM Sans", sans-serif; + color: var(--text-primary, #1a1612); +} + +.sectionNavMenuCur { + display: flex; + align-items: center; + gap: 0.45rem; + min-width: 0; +} + +.sectionNavMenuEyebrow { + flex: none; + font-size: 0.64rem; + font-weight: 600; + letter-spacing: 0.04em; + text-transform: uppercase; + color: var(--text-muted, #6d685f); +} + +.sectionNavMenuNow { + font-size: 0.85rem; + font-weight: 600; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.sectionNavMenuChev { + flex: none; + color: var(--text-muted, #6d685f); + font-size: 0.7rem; +} + +/* Compact icon version of the Compare CTA, used on mobile. */ +.sectionNavCompareIcon { + display: none; /* shown only ≤640px */ + position: relative; + flex: none; + align-items: center; + justify-content: center; + width: 38px; + height: 38px; + border-radius: 9px; + border: 1px solid var(--accent-coral, #e07256); + background: var(--accent-coral, #e07256); + color: white; + cursor: pointer; + transition: background 0.15s ease, border-color 0.15s ease; +} + +.sectionNavCompareIcon svg { + width: 19px; + height: 19px; +} + +.sectionNavCompareBadge { + position: absolute; + top: -5px; + right: -5px; + width: 16px; + height: 16px; + border-radius: 50%; + background: var(--bg-card, white); + color: var(--accent-coral-dark, #c45a3f); + border: 1.5px solid var(--accent-coral, #e07256); + display: flex; + align-items: center; + justify-content: center; + font-size: 0.7rem; + font-weight: 800; + line-height: 1; +} + +.sectionNavCompareIconIn { + background: var(--bg-card, white); + border-color: var(--accent-teal, #2d7d7d); + color: var(--accent-teal, #2d7d7d); +} + +/* Swap which controls show at the mobile breakpoint. */ +@media (max-width: 640px) { + .sectionNavLinks, + .sectionNavCompare, + .sectionNavAll, + .sectionNavBackLabel { + display: none; + } + + .sectionNavMenu { + display: flex; + } + + .sectionNavCompareIcon { + display: inline-flex; + } +} + /* Compare CTA carried into the bar once the hero's button scrolls away. */ .sectionNavCompare { flex: none; @@ -333,13 +447,9 @@ } } -/* "All ▾" jump menu. */ -.sectionNavAllWrap { - flex: none; - position: relative; -} - +/* "All ▾" jump menu (desktop). */ .sectionNavAll { + flex: none; display: inline-flex; align-items: center; gap: 0.25rem; diff --git a/nextjs-app/components/SchoolDetailView.tsx b/nextjs-app/components/SchoolDetailView.tsx index 0f9b19c..7b77a5c 100644 --- a/nextjs-app/components/SchoolDetailView.tsx +++ b/nextjs-app/components/SchoolDetailView.tsx @@ -291,6 +291,9 @@ export function SchoolDetailView({ const heroAcademicYear = latestResults ? formatAcademicYear(latestResults.year) : ''; + // Label shown in the mobile "section" menu button — the section in view. + const activeNavLabel = (navItems.find((n) => n.id === activeSection) ?? navItems[0])?.label ?? ''; + return (