/* "Client login" header button — shared by EVERY page header variant
   (v4 .g-nav, v3 .cdc-topbar, blog-engine topbar, BlitzBox .bb-topbar).
   Literal v4 values on purpose: these pages load different token sets
   (v3 tokens.css, v4 tokens.css, or none), so this file depends on none.
   v4 refs: ink #F2F3F5 · copper #C6711F / hi #E9A65F · hairline .16 white. */

.cdc-login {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .85rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: rgba(242, 243, 245, .82) !important;   /* beat per-page nav link colours */
  font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: .84rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.cdc-login:hover {
  color: #F2F3F5 !important;
  border-color: rgba(198, 113, 31, .6);
  background: rgba(198, 113, 31, .08);
}
.cdc-login:focus-visible { outline: 2px solid #E9A65F; outline-offset: 3px; }
.cdc-login svg { width: 12px; height: 12px; flex: none; }

/* v4 frost nav: the pages hide every non-CTA link under 700px with
   `.g-nav__links a:not(.is-cta)`; the login button must survive that. */
.g-nav .g-nav__links a.cdc-login { display: inline-flex; }
/* language switch: the only way to change language, so it survives every narrow-width hide rule above and on the pages */
.g-nav .g-nav__links a.lang-switch { display: inline-flex; }
/* privacy/terms: the nav is dark with inline light link colours; inherit them (primitives.css would make it dark ink) */
.cdc-topbar nav a.lang-switch { color: inherit; }
/* two-letter label on phones (AF / EN): the full name stays for screen readers, clipped rather than display:none */
.lang-switch .lang-switch__short { display: none; }
@media (max-width: 440px) {
  .lang-switch .lang-switch__short { display: inline; }
  .lang-switch .lang-switch__full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* privacy/terms: the dark topbar holds brand + Home + Notes + login + switch on one line, so the short label stays up to
   640px (the full "Afrikaans" / "English" pushed it onto a second line at 561 to 600px), and on the Afrikaans pages the
   Home link, a copy of the brand link, goes too (the 560px rule below hides it at phone widths; this reaches 640px). */
@media (max-width: 640px) {
  .cdc-topbar nav .lang-switch__short { display: inline; }
  .cdc-topbar nav .lang-switch__full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html[lang="af"] .cdc-topbar nav a[href="/af/"] { display: none; }
}
/* the v4 nav with the switch is 1px wider than a 320px screen; tighten its gaps there only */
@media (max-width: 340px) {
  .g-nav .g-nav__links:has(.lang-switch) { gap: .7rem; }
}

/* v4 frost nav crowding — measured 2026-10-01 on the home page: brand 140 +
   all links + CTA + login = 1,267px against 1,084px usable (the inner caps at
   1180px, so no desktop width ever fits). nav-tier-2 links are, by their own
   markup, the first to drop: they leave the top bar for good (both live
   in-page and in the footer). Below 1160px only the CTA + login remain, as on
   phones ("Commission research" was already clipping at 768px before login). */
.g-nav .g-nav__links a.nav-tier-2 { display: none; }
@media (max-width: 1160px) {
  .g-nav .g-nav__links a:not(.is-cta):not(.cdc-login):not(.lang-switch) { display: none; }
}

/* phones: icon-only capsule; the accessible name stays on the link */
@media (max-width: 560px) {
  .cdc-login { padding: .5rem; }
  .cdc-login span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cdc-login svg { width: 14px; height: 14px; }
}

/* v3 / blog-engine topbars: their navs are flex without cross-axis centring */
.cdc-topbar nav, .bb-topbar nav { align-items: center; }

/* phones, v3 + BlitzBox topbars (measured 2026-10-01 at 375px): the login pill
   pushed operational-ip's nav to 413px, and BlitzBox's nav already overflowed
   to 503px before it. "← Home" duplicates the brand link; BlitzBox keeps its
   own CTA + login. Inline gap styles on the blog-engine nav need !important. */
@media (max-width: 560px) {
  .cdc-topbar nav, .bb-topbar nav { gap: .9rem !important; }
  /* the builder rewrites the home link to /af/ on translated pages; hide it there too */
  .cdc-topbar nav a[href="/"], .cdc-topbar nav a[href="/af/"] { display: none; }
  /* a link with the small "EN" marker must never break in two (Afrikaans labels run longer).
     Phones only: at 561px the English header already wraps "← Home" and that layout stays as it is. */
  .cdc-topbar nav a { white-space: nowrap; }
  .bb-topbar nav a:not(.bb-cta):not(.cdc-login) { display: none; }
}
