Files
CatoandClaude 8d347796dd fix(nav): show the desktop nav at 1220px, where it actually fits (#109)
Found by the fleet UI audit once it started rendering more than one width
(bitbaum/fleet PR 119). The audit reported "ANMELDEN" 19px past the right edge
at 834px. Measuring the rest of the range showed 834 was the mildest point in
it, not the worst:

    768px   the page scrolls sideways by 49px
    834px   "ANMELDEN" 19px past the right edge
   1000px   the CTA 117px past it
   1100px   17px past it
   1101px   118px past it
   1220px   fits

The nav switched to its desktop layout at 768 and did not fit until 1220, so
it was broken across that whole range — on every tablet and on a 1152 or 1194
laptop. The cliff at 1101 is the `min-width: 768px and max-width: 1100px`
block switching off: that rule shrank padding and type to buy room back, which
bought about 100px, which was not enough at any width in its range.

So the switch moves to 1220 and that tightening block goes. Compacting a nav
until it fits is a fight with the content; showing the menu that already
exists is not. The `.nav` page gutter keeps its own 768 breakpoint — it is
spacing, not a layout switch, and it was only sharing the media query.

Nothing is lost between 768 and 1219: the mobile menu carries the section
links, the blog, and NavAuthActions with sign-in and the CTA — the same set it
has always served below 768.

Verified in a production build. At 390 / 768 / 834 / 1000 / 1100 / 1101 /
1219 / 1220 / 1280 / 1440 nothing in the nav crosses the viewport edge, and
the hamburger and the desktop links are exact inverses across 1219/1220.

verify clean: format, lint (one pre-existing unused-arg warning, unchanged),
typecheck, 1340 tests across 90 files. Build succeeds.

One note for whoever reads design-discipline.test.ts next: its raw-colour
regex matched "#119" in a CSS comment referencing a pull request, and read it
as a hex colour. Reworded here rather than changing the gate, but a hex in a
comment is not a raw colour in a stylesheet.


Claude-Session: https://claude.ai/code/session_01NkjZ1jJPhHzxAPvbSSG3wH

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-21 05:56:56 -07:00

407 lines
9.5 KiB
CSS

.nav {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: var(--z-nav);
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 1.5rem;
background: var(--white-97);
backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
}
.logoLink {
text-decoration: none;
flex-shrink: 0;
}
/* ─── Nav links row ────────────────────────────────────────────────────────── */
.navLinks {
display: none;
align-items: center;
gap: 0;
}
/* Simple (no dropdown) nav link */
.navLink {
font-size: 0.72rem;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--muted);
text-decoration: none;
padding: 0.5rem 0.9rem;
transition: color var(--transition-fast);
white-space: nowrap;
}
.navLink:hover {
color: var(--ink);
}
/* ─── Megamenu item (trigger + panel) ─────────────────────────────────────── */
/* Wraps all 3 mega items — the single ref useClickOutside watches, so a
click on ANY trigger (switching panels) never counts as "outside". */
.megaGroup {
display: flex;
align-items: center;
gap: 0;
}
.megaItem {
position: relative;
}
.megaTrigger {
display: flex;
align-items: center;
gap: 0.3rem;
font-size: 0.72rem;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--muted);
text-decoration: none;
padding: 0.5rem 0.9rem;
transition: color var(--transition-fast);
white-space: nowrap;
cursor: pointer;
background: none;
border: none;
font-family: var(--font-dm-sans), sans-serif;
}
.megaTrigger:hover,
.megaTrigger[aria-expanded="true"] {
color: var(--ink);
}
.chevron {
opacity: 0.5;
transition:
transform var(--transition-fast),
opacity var(--transition-fast);
flex-shrink: 0;
}
.megaTrigger[aria-expanded="true"] .chevron {
transform: rotate(180deg);
opacity: 0.8;
}
/* ─── Dropdown panel ───────────────────────────────────────────────────────── */
.megaPanel {
position: absolute;
top: 100%;
left: 50%;
padding-top: 0.75rem;
background: transparent;
opacity: 0;
visibility: hidden;
transform: translateX(-50%) translateY(-6px);
transition:
opacity var(--transition-fast) ease,
transform var(--transition-fast) ease,
visibility var(--transition-fast);
pointer-events: none;
min-width: 16rem;
z-index: var(--z-dropdown);
}
/* Open state is a class, driven by React state — not :hover/:focus-within.
Hover alone never worked on a tablet or hybrid laptop with imprecise
pointer input; click/focus is the only way in on every device now. */
.megaPanelOpen {
opacity: 1;
visibility: visible;
transform: translateX(-50%) translateY(0);
pointer-events: auto;
}
/* Inner card that carries the visual styling */
.megaPanelInner {
position: relative;
background: var(--white);
border: 1px solid var(--border);
border-radius: var(--radius-xl);
box-shadow: var(--shadow-lg);
}
/* Small decorative arrow pointing up */
.megaPanelInner::before {
content: "";
position: absolute;
top: -5px;
left: 50%;
transform: translateX(-50%) rotate(45deg);
width: 9px;
height: 9px;
background: var(--white);
border-left: 1px solid var(--border);
border-top: 1px solid var(--border);
border-radius: var(--radius-2xs) 0 0 0;
}
/* ─── Programme cards layout ───────────────────────────────────────────────── */
.megaCards {
display: flex;
flex-direction: column;
padding: 0.75rem;
gap: 0.25rem;
min-width: 22rem;
}
.megaCard {
display: flex;
flex-direction: column;
gap: 0.15rem;
padding: 0.75rem 1rem;
border-radius: var(--radius-lg);
text-decoration: none;
transition: background var(--transition-fast);
}
.megaCard:hover {
background: var(--off);
}
.megaCardLabel {
font-size: 0.8rem;
font-weight: 500;
color: var(--ink);
letter-spacing: 0.02em;
}
.megaCardSub {
font-size: 0.72rem;
color: var(--muted);
line-height: 1.4;
}
.megaPanelFooter {
border-top: 1px solid var(--border);
padding: 0.75rem 1.75rem;
}
.megaFooterLink {
font-size: 0.7rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--teal);
text-decoration: none;
transition: color var(--transition-fast);
}
.megaFooterLink:hover {
color: var(--teal-dark);
}
/* ─── Simple list layout (approach, diagnostics) ───────────────────────────── */
.megaList {
display: flex;
flex-direction: column;
padding: 0.75rem;
gap: 0.1rem;
min-width: 18rem;
}
.megaListItem {
display: block;
padding: 0.6rem 1rem;
font-size: 0.8rem;
color: var(--ink2);
text-decoration: none;
border-radius: var(--radius-lg);
transition:
background var(--transition-fast),
color var(--transition-fast);
letter-spacing: 0.01em;
}
.megaListItem:hover {
background: var(--off);
color: var(--ink);
}
/* ─── Actions (right side) ─────────────────────────────────────────────────── */
.navActions {
display: flex;
align-items: center;
gap: 0.75rem;
flex-shrink: 0;
}
.navSignIn {
font-size: 0.72rem;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--muted);
text-decoration: none;
transition: color var(--transition-fast);
white-space: nowrap;
}
.navSignIn:hover {
color: var(--ink);
}
.navBtn {
background: var(--ink);
color: var(--white);
border: none;
padding: 0.55rem 1.4rem;
font-size: 0.7rem;
letter-spacing: 0.14em;
text-transform: uppercase;
cursor: pointer;
font-family: var(--font-dm-sans), sans-serif;
border-radius: var(--radius-xs);
transition: background var(--transition-fast);
text-decoration: none;
display: inline-block;
white-space: nowrap;
}
.navBtn:hover {
background: var(--teal);
}
/* ─── Mobile menu ──────────────────────────────────────────────────────────── */
.menuToggle {
display: none;
align-items: center;
justify-content: center;
width: 2.75rem;
height: 2.75rem;
background: none;
border: none;
padding: 0;
color: var(--ink);
cursor: pointer;
}
.mobileMenu {
position: fixed;
top: 100%;
left: 0;
right: 0;
height: calc(100dvh - 100%);
overflow-y: auto;
background: var(--white);
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 1rem 1.5rem 2rem;
border-top: 1px solid var(--border);
}
.mobileMenuLinks {
display: flex;
flex-direction: column;
}
.mobileMenuLink {
font-size: 1rem;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--ink2);
text-decoration: none;
padding: 0.9rem 0;
border-bottom: 1px solid var(--border);
}
.mobileMenuActions {
display: flex;
flex-direction: column;
gap: 0.75rem;
padding-top: 1.5rem;
}
.mobileMenuBtn {
background: var(--ink);
color: var(--white);
padding: 0.9rem 1.4rem;
font-size: 0.8rem;
letter-spacing: 0.14em;
text-transform: uppercase;
text-align: center;
text-decoration: none;
border-radius: var(--radius-sm);
}
.mobileMenuSignIn {
border: 1px solid var(--border);
color: var(--ink2);
padding: 0.9rem 1.4rem;
font-size: 0.8rem;
letter-spacing: 0.14em;
text-transform: uppercase;
text-align: center;
text-decoration: none;
border-radius: var(--radius-sm);
}
/* ─── Responsive ───────────────────────────────────────────────────────────── */
/*
* The desktop nav appears at 1220px, not 768px.
*
* Measured on the live site 2026-09-21, after the fleet UI audit started
* rendering more than one width (bitbaum/fleet PR 119). This nav does not fit
* anywhere between 768 and 1219, and the audit's single 834px sample was the
* mildest point in that range rather than the worst:
*
* 768px the page scrolls sideways by 49px
* 834px "ANMELDEN" 19px past the right edge
* 1000px the CTA 117px past it
* 1100px 17px past it — the tightening rule below was holding it
* 1101px 118px past it, because that rule stops at 1100
* 1220px fits
*
* The `min-width: 768px and max-width: 1100px` block that used to sit here
* was an attempt to buy the room back by shrinking padding and type. It bought
* about 100px, which was not enough at any width in its range, and the cliff
* at 1101 was it switching off. Compacting a nav until it fits is a fight with
* the content; showing the menu that already exists is not.
*
* Nothing is lost between 768 and 1219: the mobile menu carries the section
* links, the blog and NavAuthActions (sign-in and the CTA), which is the same
* set it has always served below 768.
*/
@media (max-width: 1219px) {
.navBtn,
.navSignIn {
display: none;
}
.menuToggle {
display: flex;
}
}
/* Page gutter, not a layout switch — it has always widened at 768. */
@media (min-width: 768px) {
.nav {
padding: 1rem 2.5rem;
}
}
@media (min-width: 1220px) {
.navLinks {
display: flex;
}
.mobileMenu {
display: none;
}
}