/* POP'n WASH — fixed 130% header UI, compact sun/moon, discoverable Browse menu.
   Loaded AFTER legacy/refonte styles so text-size controls affect the PAGE only. */
:root{--pop-header-font-scale:1.3}

/* A true fixed navigation size: no --display-scale dependency. */
html body #top.site-header .desktop-nav a{
  font-size:calc(14px * var(--pop-header-font-scale))!important;
  font-weight:800!important;line-height:1.25!important;
  white-space:nowrap!important;hyphens:none!important;
  overflow-wrap:normal!important;word-break:normal!important;
  padding:10px 8px!important;
}
html body #top.site-header .brand-main{
  font-size:20px!important;line-height:1.06!important;white-space:nowrap!important;
}
html body #top.site-header .brand-place{
  font-size:11px!important;line-height:1.15!important;white-space:nowrap!important;
}
html body #top.site-header .lang-button{
  font-size:15px!important;
  flex:0 0 auto!important;
}
html body #top.site-header .lang-button #langCode{font-size:14px!important}
html body #top.site-header .lang-button .chev{font-size:15px!important}
html body #top.site-header .header-actions{
  gap:6px!important;align-items:center!important;flex:0 0 auto!important;
  margin-left:auto!important;
}

/* Always icons, including on wide monitors. Two independent, accessible choices
   already provided by the existing light/dark buttons and theme JS. */
html body #top.site-header #themeControl{
  flex:0 0 auto!important;min-width:0!important;
}
html body #top.site-header #themeControl .theme-slider-shell{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  width:72px!important;min-width:72px!important;max-width:72px!important;
  height:42px!important;
}
html body #top.site-header #themeControl .theme-option-label{
  padding:0!important;gap:0!important;min-width:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
}
html body #top.site-header #themeControl .theme-option-label span{
  display:none!important;
}
html body #top.site-header #themeControl .theme-option-label svg{
  display:block!important;width:19px!important;height:19px!important;flex:0 0 19px!important;
}
html body #top.site-header #themeControl .theme-slider-shell .theme-knob{
  left:4px!important;top:4px!important;width:calc(50% - 4px)!important;
  height:calc(100% - 8px)!important;
  transform:translateX(0)!important;
}
html body #top.site-header #themeControl[data-mode="dark"] .theme-knob{
  transform:translateX(100%)!important;
}
html body #top.site-header #themeControl[data-mode="light"] .theme-knob{
  transform:translateX(0)!important;
}

/* Menu is a real button, with a visible caption BELOW three familiar strokes.
   The caption is kept for all viewport widths and translated at runtime. */
html body #top.site-header .menu-button{
  appearance:none;flex:0 0 65px!important;
  width:65px!important;min-width:65px!important;height:58px!important;
  border:1px solid rgba(22,28,27,.12)!important;border-radius:12px!important;
  background:rgba(255,255,255,.64)!important;color:#17231c!important;
  padding:6px 4px 5px!important;margin:0!important;
  align-items:center!important;justify-content:center!important;
  flex-direction:column!important;gap:3px!important;
  cursor:pointer!important;
}
html body #top.site-header .menu-button > span:not(.menu-caption){
  display:block!important;flex:0 0 2px!important;
  width:23px!important;height:2px!important;
  margin:0!important;padding:0!important;border-radius:10px!important;
  background:#15271a!important;transform:none!important;
}
html body #top.site-header .menu-button > .menu-caption{
  display:block!important;
  flex:0 0 auto!important;
  width:100%!important;height:auto!important;
  margin:3px 0 0!important;padding:0!important;
  background:transparent!important;color:#17231c!important;
  font:800 11px/1.1 system-ui,-apple-system,"Segoe UI",Arial,sans-serif!important;
  text-align:center!important;white-space:nowrap!important;
  overflow-wrap:normal!important;hyphens:none!important;
}
html body #top.site-header .menu-button[aria-expanded="true"]{
  background:#e8f5de!important;border-color:#368640!important;
}
html body #top.site-header .menu-button:focus-visible{
  outline:3px solid #327b35!important;outline-offset:2px!important;
}
/* Desktop: give navigation more room than the logo or the preferences. */
@media(min-width:1025px){
  html body #top.site-header{
    display:flex!important;align-items:center!important;
    width:calc(100% - 28px)!important;max-width:1560px!important;
    min-height:76px!important;height:auto!important;
    gap:clamp(7px,1vw,16px)!important;padding:8px 12px!important;
  }
  html body #top.site-header .brand-lockup{
    display:grid!important;grid-template-columns:52px minmax(0,1fr)!important;
    flex:0 0 210px!important;width:210px!important;min-width:0!important;
    max-width:210px!important;gap:6px!important;
  }
  html body #top.site-header .brand-logo-wrap,
  html body #top.site-header .brand-logo-wrap img{
    width:50px!important;height:50px!important;flex:0 0 50px!important;
  }
  html body #top.site-header .brand-label{
    width:100%!important;min-width:0!important;height:auto!important;
    padding:0!important;justify-content:flex-start!important;
  }
  html body #top.site-header .desktop-nav{
    display:flex!important;flex:0 0 auto!important;
    width:max-content!important;min-width:0!important;max-width:none!important;
    gap:3px!important;justify-content:center!important;white-space:nowrap!important;
  }
  html body #top.site-header .header-actions{margin-left:auto!important}
  html body #top.site-header .menu-button{display:none!important}
  html body #top.site-header.nav-fit-compact .desktop-nav{display:none!important}
  html body #top.site-header.nav-fit-compact .menu-button{display:flex!important}
  /* Temporarily measure the ACTUAL translated labels, without a visible flash. */
  html body #top.site-header.pop-nav-measuring .desktop-nav{
    position:absolute!important;left:-10000px!important;top:0!important;
    display:flex!important;width:max-content!important;max-width:none!important;
    visibility:hidden!important;pointer-events:none!important;
  }
  /* During the invisible full-nav measurement, the Browse button must NOT
     consume 65px + its flex gap: it is absent when real nav is displayed. */
  html body #top.site-header.pop-nav-measuring .menu-button {
    display:none!important;
  }
}
@media(min-width:1601px) {
  /* Use the desktop canvas instead of wasting 320px at 1920px.
     Still cap header width and let the JS fall back for long locales. */
  html body #top.site-header {
    width:calc(100% - 28px)!important;
    max-width:1800px!important;
  }
}
@media(min-width:1025px) and (max-width:1120px){
  html body #top.site-header .brand-lockup{flex-basis:175px!important;width:175px!important;max-width:175px!important}
  html body #top.site-header .brand-main{font-size:17px!important}
}
@media(max-width:1024px){
  html body #top.site-header{
    display:flex!important;align-items:center!important;
    width:calc(100% - 18px)!important;min-height:68px!important;height:68px!important;
    padding:6px 8px!important;gap:5px!important;
  }
  html body #top.site-header .desktop-nav{display:none!important}
  html body #top.site-header .menu-button{display:flex!important}
  html body #top.site-header .brand-lockup{
    display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;
    width:auto!important;max-width:220px!important;min-width:0!important;
    flex:1 1 auto!important;gap:5px!important;
  }
  html body #top.site-header .brand-logo-wrap,
  html body #top.site-header .brand-logo-wrap img{
    width:43px!important;height:43px!important;flex-basis:43px!important;
  }
  html body #top.site-header .brand-label{min-width:0!important;width:100%!important;padding:0!important}
  html body #top.site-header .brand-title{
    transform:none!important;display:flex!important;flex-direction:column!important;
    gap:2px!important;align-items:flex-start!important;
  }
  html body #top.site-header .brand-main{font-size:16px!important}
  html body #top.site-header .brand-place{font-size:10px!important}
  html body #top.site-header .lang-button{height:42px!important;min-width:53px!important;padding:0 6px!important}
}
@media(max-width:600px){
  html body #top.site-header{
    width:calc(100% - 12px)!important;height:68px!important;
    min-height:68px!important;padding:5px 6px!important;gap:3px!important;
  }
  html body #top.site-header .brand-lockup{
    max-width:145px!important;grid-template-columns:37px minmax(0,1fr)!important;gap:3px!important;
  }
  html body #top.site-header .brand-logo-wrap,
  html body #top.site-header .brand-logo-wrap img{
    width:36px!important;height:36px!important;flex-basis:36px!important;
  }
  html body #top.site-header .brand-main{font-size:12px!important;letter-spacing:-.03em!important}
  html body #top.site-header .brand-place{font-size:9px!important;letter-spacing:.09em!important}
  html body #top.site-header .header-actions{gap:3px!important}
  html body #top.site-header #displaySizeButton{
    width:39px!important;min-width:39px!important;height:41px!important;
  }
  html body #top.site-header #themeControl .theme-slider-shell{
    width:62px!important;min-width:62px!important;max-width:62px!important;height:40px!important;
  }
  html body #top.site-header #themeControl .theme-option-label svg{
    width:17px!important;height:17px!important;flex-basis:17px!important;
  }
  html body #top.site-header .lang-button{
    width:48px!important;min-width:48px!important;height:40px!important;
    padding:0 3px!important;gap:2px!important;
  }
  html body #top.site-header .lang-button .chev{display:none!important}
  html body #top.site-header .menu-button{
    width:55px!important;min-width:55px!important;flex-basis:55px!important;
    height:55px!important;padding:6px 1px 4px!important;
  }
  html body #top.site-header .menu-button > .menu-caption{font-size:10px!important}
}
@media(max-width:355px){
  html body #top.site-header .brand-lockup{
    max-width:98px!important;grid-template-columns:33px minmax(0,1fr)!important;
  }
  html body #top.site-header .brand-logo-wrap,
  html body #top.site-header .brand-logo-wrap img{
    width:32px!important;height:32px!important;flex-basis:32px!important;
  }
  html body #top.site-header .brand-main{font-size:10.5px!important}
  html body #top.site-header .brand-place{font-size:8px!important}
  html body #top.site-header #displaySizeButton{width:36px!important;min-width:36px!important}
  html body #top.site-header #themeControl .theme-slider-shell{
    width:58px!important;min-width:58px!important;max-width:58px!important;
  }
  html body #top.site-header .lang-button{width:40px!important;min-width:40px!important}
  html body #top.site-header .menu-button{width:50px!important;min-width:50px!important;flex-basis:50px!important}
  html body #top.site-header .menu-button > .menu-caption{font-size:9px!important}
}
/* No intermediate visible oversize navigation while language changes.
   At medium viewport widths the 130%-fixed translated link row needs more
   room than the header can provide; show the labelled Browse menu immediately,
   without relying on a later rAF measurement. Full desktop navigation is
   restored above 1600px when the real content-width test passes. */
@media(min-width:1025px) and (max-width:1600px){
  html body #top.site-header:not(.pop-nav-measuring) .desktop-nav{
    display:none!important;
  }
  html body #top.site-header .menu-button{
    display:flex!important;
  }
}
/* When the real header is hidden on scroll, the existing preferences dock
   keeps its own compact measurements from floating-preferences.css. */


/* R11: stable widths across translated desktop navigation; never render an
   oversized menu while a language/AAA change is awaiting animation frame. */
@media (min-width:1025px) and (max-width:1599px){
  html body #top.site-header:not(.pop-nav-measuring) .desktop-nav{display:none!important}
  html body #top.site-header .menu-button{display:flex!important}
}
@media (min-width:1600px){
  /* Expand into the real desktop width instead of forcing 8 translated links
     into a 1560px capsule on 1920/2560px monitors. */
  html body #top.site-header{
    width:calc(100% - 28px)!important;
    max-width:calc(100% - 28px)!important;
  }
  html body #top.site-header .desktop-nav{
    flex:0 0 auto!important;
    max-width:none!important;
    min-width:0!important;
    gap:clamp(3px,.35vw,8px)!important;
  }
}
/* On 320px-class devices there is only room for the brand image plus the four
   real controls. Keep the genuine accessible logo; never clip half the name. */
@media(max-width:340px){
  html body #top.site-header .brand-lockup{
    flex:0 0 40px!important;
    width:40px!important;min-width:40px!important;max-width:40px!important;
    grid-template-columns:minmax(0,1fr)!important;
    justify-content:center!important;
  }
  html body #top.site-header .brand-label{display:none!important}
  html body #top.site-header .brand-logo-wrap,
  html body #top.site-header .brand-logo-wrap img{
    width:40px!important;height:40px!important;min-width:40px!important;
    flex-basis:40px!important;
  }
}
