/* One header on every theorie.rijsim.nl page (round 24, blind critics 3 of 6). Loaded LAST on every theory-host page by
   functions/_middleware.js (withTheme, HEAD_V), never on rijsim.nl or Theorie Wereld.
   1. The language menu: the theorie home and help pages (body.ts, build/theorie-shop-build.py + theorie-plus-build.py) and the
      skinned course, lesson, mock-exam, e-book and login pages (functions/_middleware.js theorySkin) all carry the same
      <details class="lang-dd"> (globe + language, a list of the languages the page exists in). Same look on all of them, in the
      same place: after the menu links, before the sun/moon button and "Inloggen". It matches those two header buttons
      (40 px, 10 px corners, hairline edge). ":root header.nav" outranks the older .ts/.tsp rules and the light-theme rules.
   2. Phones: computer "🌐 Nederlands ▾", 441-700 px "🌐 NL ▾", up to 440 px the globe alone (38 px, like the sun/moon button).
      375 px: icon + "RijSim", one menu link, globe, sun/moon, Inloggen with room to spare; under 375 px the name goes (icon only).
   (The lesson's "Toon in mijn taal" is a separate button inside the lesson, les-taal.js, untouched.) */
:root header.nav details.lang-dd{position:relative;flex:none;margin:0 0 0 6px;padding:0;border:0;background:none}
:root header.nav .lang-dd summary{list-style:none;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;gap:6px;
  height:40px;min-height:40px;padding:0 11px;border:1px solid var(--line-strong);border-radius:10px;background:transparent;color:var(--text);
  font-size:14.5px;font-weight:700;line-height:1;white-space:nowrap;text-shadow:none;-webkit-tap-highlight-color:transparent}
:root header.nav .lang-dd summary::before{content:"";position:absolute;inset:-3px}   /* 46 px touch target, as the sun/moon button */
:root header.nav .lang-dd summary::-webkit-details-marker{display:none}
:root header.nav .lang-dd summary::marker{content:""}
:root header.nav .lang-dd summary::after,:root header.nav .lang-dd[open] summary::after{content:"▾";font-size:11px;line-height:1;color:var(--muted)}
:root header.nav .lang-dd summary:hover{background:rgb(var(--ink,255 255 255) / .07)}
:root header.nav .lang-dd summary:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
:root header.nav .lang-dd[open] summary{background:rgb(var(--ink,255 255 255) / .07)}
:root header.nav .lang-dd .lc{display:none}
:root header.nav .lang-dd ul{position:absolute;inset-inline-end:0;top:calc(100% + 6px);z-index:60;list-style:none;margin:0;padding:6px;min-width:190px;
  background:var(--card);border:1px solid var(--line-strong);border-radius:14px;box-shadow:0 20px 50px rgba(0,0,0,.5)}
[data-theme=light] header.nav .lang-dd ul{box-shadow:0 20px 50px rgba(17,24,39,.18)}
:root header.nav .lang-dd li a{display:block;min-height:0;padding:10px 12px;border-radius:9px;color:var(--copy,var(--text));font-size:15px;font-weight:600;
  line-height:1.3;text-decoration:none;text-shadow:none;box-shadow:none}
:root header.nav .lang-dd li a:hover{background:rgb(var(--ink,255 255 255) / .08);color:var(--text)}
:root header.nav .lang-dd li a[aria-current]{color:var(--accent-ink,var(--accent))}
:root header.nav .lang-dd li a:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}

/* 2. phones */
@media (max-width:700px){:root header.nav .lang-dd .ln{display:none}:root header.nav .lang-dd .lc{display:inline}}
@media (max-width:440px){
  :root header.nav nav{gap:4px}
  :root header.nav details.lang-dd{margin-inline-start:2px}
  :root header.nav .lang-dd summary{width:38px;height:38px;min-height:38px;padding:0;gap:0;font-size:17px}
  :root header.nav .lang-dd .lc,:root header.nav .lang-dd summary::after{display:none}
  :root header.nav .brand{flex:none;gap:6px;margin-inline-end:6px}
  :root header.nav nav>a:not(.ts-acct){padding-inline:5px}
  /* the skinned course pages (no body.ts): their price link gives way, as on the shop pages (hide-s) */
  body:not(.ts) header.nav nav>a[href$="#passen"]{display:none}
}
/* icon + "RijSim" from 375 px on every page type (r29head); below that the icon alone, on every page type */
@media (min-width:375px) and (max-width:440px){:root header.nav .brand>span{position:static;width:auto;height:auto;overflow:visible;clip:auto}}
@media (max-width:374px){:root header.nav .brand>span{display:none}:root header.nav .wrap{padding:0 12px}}

/* 3. r32nav (round 24 critics, 3 of 6: "language control differs ... phone header crowded"): the shop pages (body.ts) and the
   skinned course, lesson, mock-exam and login pages now share one menu too, not only one language menu. Same link weight and
   size, same gaps (so the globe sits in the same place), same "Inloggen" button, and the same items per width: the skinned
   menu (functions/_middleware.js NAV) carries the shop's hide-s / hide-xs classes (build/theorie-plus-build.py nav_html).
   Phone: NL keeps "Wereld", EN keeps "Mock exam" (EN course pages showed no menu link at all). */
:root header.nav nav{gap:14px}
:root header.nav nav>a:not(.ts-acct){font-size:15px;font-weight:600}
:root header.nav nav>a.ts-acct{font-size:14.5px;font-weight:700}
@media (max-width:700px){:root header.nav nav{gap:8px}:root header.nav nav>a:not(.ts-acct){font-size:14px}:root header.nav nav>a.ts-acct{font-size:14px}
  :root header.nav nav>a.hide-s{display:none}}
@media (max-width:600px){:root header.nav nav>a.hide-xs{display:none}}
@media (max-width:440px){:root header.nav nav{gap:4px}}
/* tablets (the sweep 320-1280 px found "Inloggen" pushed past the right edge at 441, 521 and 701-800 px on every page type):
   441-600 px the globe alone, as on a phone; 701-1000 px "NL" instead of "Nederlands" and "Wereld" instead of "Theorie Wereld";
   the five menu items only from 861 px (below: the phone set plus Proefexamen) */
@media (min-width:441px) and (max-width:600px){
  :root header.nav .lang-dd summary{width:40px;padding:0;gap:0;font-size:17px}
  :root header.nav .lang-dd .lc,:root header.nav .lang-dd summary::after{display:none}}
@media (min-width:701px) and (max-width:1000px){:root header.nav .lang-dd .ln{display:none}:root header.nav .lang-dd .lc{display:inline}
  header.nav nav a .nav-tw{display:none}}
/* "Wereld" up to 640 px on every page type (the shop pages showed "Theorie Wereld" at 481-640, the course pages "Wereld") */
@media (max-width:640px){header.nav nav a .nav-tw{display:none}}
@media (min-width:701px) and (max-width:860px){:root header.nav nav>a.hide-s{display:none}}
