/* The one switch for every page of every site (Robert, 30 Nov 2026): "Take the code exactly how it is from the Heart of
   Nature site … right across all websites." Lifted from The Heart of Nature shop (public/assets/shop.css "Header
   switchers", dark.css sun/moon, base.css .icon/.visually-hidden), with rem turned into the same px so it looks the
   same whatever a site's root font size. Copy this file UNCHANGED (site-pages-check.mjs measures the result); only the
   colours come from the site, through the six tokens below. Rules: QUIET-DESIGN-RULES.md / SIMPLE-REELS-DESIGN-RULES.md,
   "One switch". Reference numbers: both buttons 38 px high, 10 px corners, 1 px soft line; mode button 38 x 38;
   language label 13.6 px semibold; globe 16 px; moon/sun 18 px; 9.6 px between them; mode first, then language.

   Colour tokens (set them on :root and :root[data-theme="dark"] from the site's own palette; the fallbacks are HON's
   names, then the family kit's):
     --sw-line     the soft outline              --sw-ink      text/icon on hover and open
     --sw-ink-soft resting text and icons        --sw-surface  the language list's background
     --sw-tint     hover/open background         --sw-accent   the chosen language */

.site-switch {
  --_line: var(--sw-line, var(--c-line, var(--line, #E8DDC7)));
  --_ink: var(--sw-ink, var(--c-ink, var(--hdr-ink, #1D2A20)));
  --_ink-soft: var(--sw-ink-soft, var(--c-ink-soft, var(--hdr-ink-2, #55645A)));
  --_surface: var(--sw-surface, var(--c-surface, var(--card, #FFFFFF)));
  --_tint: var(--sw-tint, var(--c-bg-alt, var(--hdr-tint, #F7EEDC)));
  --_accent: var(--sw-accent, var(--c-accent, var(--accent, #2E6B45)));
  display: inline-flex; align-items: center; gap: 9.6px; flex-shrink: 0;
}
.site-switch .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.site-switch .icon { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* the two buttons: one family, same height, corners and line */
.site-switch .theme-toggle, .site-switch .lang-menu summary {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; box-sizing: border-box; border: 1px solid var(--_line);
  border-radius: 10px; background: transparent; color: var(--_ink-soft); cursor: pointer; transition: color .15s, border-color .15s;
  font-family: inherit; line-height: normal; margin: 0; }
.site-switch .theme-toggle { width: 38px; padding: 0; }
.site-switch .theme-toggle:hover, .site-switch .lang-menu summary:hover, .site-switch .lang-menu[open] summary {
  color: var(--_ink); border-color: color-mix(in srgb, var(--_ink) 22%, transparent); background: var(--_tint); }
.site-switch .theme-toggle:focus-visible, .site-switch .lang-menu summary:focus-visible { outline: 2px solid var(--_accent); outline-offset: 2px; }

/* sun/moon: a moon in light mode (go dark), a sun in dark mode (go light) */
.site-switch .theme-toggle .icon-sun { display: none; }
.site-switch .theme-toggle .icon-moon, :root[data-theme="dark"] .site-switch .theme-toggle .icon-sun { display: grid; place-items: center; }
:root[data-theme="dark"] .site-switch .theme-toggle .icon-moon { display: none; }
.site-switch .theme-toggle svg { width: 18px; height: 18px; }
.no-js .site-switch .theme-toggle { display: none; }

/* language: globe, code, small caret; the list shows each language in its own name with its code */
.site-switch .lang-menu { position: relative; font-size: 14.4px; margin: 0; }
.site-switch .lang-menu summary { gap: 4.8px; padding: 0 10.4px; font-size: 13.6px; font-weight: 600; letter-spacing: .02em; list-style: none; user-select: none; }
.site-switch .lang-menu summary::-webkit-details-marker { display: none; }
.site-switch .lang-menu summary::after, .site-switch .lang-menu[open] summary::after { content: none; }
.site-switch .lang-menu .icon--globe { width: 16px; height: 16px; }
.site-switch .lang-menu__caret { font-size: 11.2px; opacity: .8; }
.site-switch .lang-menu__list { position: absolute; inset-inline-end: 0; top: calc(100% + 5.6px); z-index: 40; list-style: none; margin: 0;
  min-width: 210px; padding: 6px; border: 1px solid var(--_line); border-radius: 12px; background: var(--_surface);
  box-shadow: 0 10px 30px rgba(29, 42, 32, .15); max-height: min(70vh, 560px); overflow-y: auto; box-sizing: border-box; }
:root[data-theme="dark"] .site-switch .lang-menu__list { box-shadow: 0 10px 30px rgba(8, 16, 11, .5); }
.site-switch .lang-menu__list li { margin: 0; padding: 0; list-style: none; }
.site-switch .lang-menu__list a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 8px;
  color: var(--_ink); text-decoration: none; font-size: 14.4px; border: 0; }
.site-switch .lang-menu__list a small { color: var(--_ink-soft); font-size: 12px; letter-spacing: .04em; }
.site-switch .lang-menu__list a:hover { background: var(--_tint); }
.site-switch .lang-menu__list a[aria-current] { color: var(--_accent); font-weight: 600; }
.site-switch .lang-menu__list a[aria-current] small { color: var(--_accent); }
.site-switch .lang-menu__list a[aria-current]::after { content: none; }

/* Phones, as in the shop: below 750 px the language button moves into the site's phone menu. Put a second copy there:
   <div class="site-switch menu-lang">languageMenuHTML(…)</div>. The header then keeps only the sun/moon. A site with no
   phone menu keeps the button in the header (it only hides when a .menu-lang copy exists). */
.site-switch.menu-lang { display: none; }
@media (max-width: 749px) {
  header:has(.menu-lang) .site-switch:not(.menu-lang) .lang-menu { display: none; }
  .site-switch.menu-lang { display: block; margin: 16px 0 4px; }
  .site-switch.menu-lang .lang-menu summary { gap: 5.6px; height: 40px; padding: 0 12.8px; }
  .site-switch.menu-lang .lang-menu__list { position: static; box-shadow: none; max-height: none; border: 0; padding: 6px 0; background: transparent; min-width: 0; }
  .site-switch.menu-lang .lang-menu__list a { font-size: 16.8px; padding: 8.8px 16px; }
}
