/* Light / dark mode helpers.
   main.js puts "light-mode" or "dark-mode" on <body>, so any CSS can be written as body.light-mode ... or body.dark-mode ...
   (the old html[data-theme] attribute is still set too). This file also holds the header icon alignment, the water-ripple
   switch animation, the Settings > Header Buttons switches, the dark mode text fixes and the font fallback that keeps
   the page from jumping when Mona Sans Expanded arrives. */

/* ===== No layout jump when the web font arrives =====
   Until Mona Sans Expanded has loaded, the text is drawn in Arial (or its look-alike Liberation Sans / Arimo / Helvetica),
   scaled so each line is as wide as it will be in Mona Sans Expanded: 103.7% for normal text and 112.4% for headings
   (headings use font-stretch 112%). Lines then break in the same places before and after the swap, so nothing moves.
   Measured in the browser: Arial text is 0.964x (body) and 0.890x (headings) as wide as Mona Sans Expanded. */
@font-face{font-family:'Mona Fallback';src:local('Arial'),local('Liberation Sans'),local('Arimo'),local('Helvetica');size-adjust:103.7%;ascent-override:normal;descent-override:normal;line-gap-override:normal}
@font-face{font-family:'Mona Fallback Display';src:local('Arial'),local('Liberation Sans'),local('Arimo'),local('Helvetica');size-adjust:112.4%;ascent-override:normal;descent-override:normal;line-gap-override:normal}
body{--wp--preset--font-family--display:'Mona Sans Expanded','Mona Fallback',system-ui,-apple-system,'Segoe UI',Arial,sans-serif}
:root :where(h1,h2,h3,h4,h5,h6){font-family:'Mona Sans Expanded','Mona Fallback Display',system-ui,-apple-system,'Segoe UI',Arial,sans-serif}

/* ===== Header icon buttons: one 44px circle each, all centred on the same line ===== */
.nx-actions{align-items:center}
.nx-actions>.nx-sound-btn,.nx-actions>.nx-search-btn,.nx-actions>.nx-theme-btn{flex:none;margin:0;line-height:0}
.nx-theme-btn .wp-block-button__link{display:block;box-sizing:border-box;line-height:0}

/* ===== Show / hide from Settings > Header Buttons (the classes come from functions.php) ===== */
body.hide-hdr-search .nx-search-btn,body.hide-hdr-theme .nx-theme-btn{display:none!important}

/* ===== Water ripple when the mode changes =====
   The new mode grows out of the button as a circle (View Transitions API) while a few soft rings spread out ahead of it.
   Browsers without View Transitions simply switch instantly. */
::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}
::view-transition-old(root){z-index:1}
::view-transition-new(root){z-index:2}
.nx-ripple{position:fixed;z-index:2147483000;border:2px solid var(--rp-c,#2A8A00);border-radius:50%;background:radial-gradient(circle,transparent 58%,var(--rp-c,#2A8A00) 100%);opacity:0;pointer-events:none;will-change:transform,opacity}
@media(prefers-reduced-motion:reduce){.nx-ripple{display:none}}

/* ===== Dark mode: text that was too dark to read =====
   The "dark" palette colour turns into a near-background green in dark mode, so anything that used it as a text colour
   (the services slider, the reviews line, the FAQ label) disappeared. */
body.dark-mode .svt{--svt-ink:#EAF4E8}
body.dark-mode #reviews>.wp-block-columns .wp-block-group>p:not(.stat-n){color:#CFE8C8;background:rgba(111,206,61,.16)}
body.dark-mode #reviews>.wp-block-columns .stat-n.stat-n{color:#6FCE3D!important}
body.dark-mode #faq p.faq-eyebrow{color:#8FE05A;background:rgba(111,206,61,.14)}

/* ===== Light mode, home: header menu stays readable while a sub menu is open =====
   The home header is transparent with white text over the dark hero. Only when a drop down panel is open does the header
   turn white, so only then do the links go dark. Hovering a plain link (Home, Contact) keeps the white text. */
html:not([data-theme="dark"]) body.home .wp-site-blocks>header:not(.is-scrolled):has(.mm-i.is-armed){--hd-fg:var(--nx-ink,#0E2B16);--hd-line:var(--nx-line-strong,rgba(14,43,22,.25))}
html:not([data-theme="dark"]) body.home .wp-site-blocks>header:not(.is-scrolled):has(.mm-i.is-armed) :is(.mm-top>li.is-armed>a,.mm-top>li>a:hover){color:var(--nx-brand-text,#237500)!important}
html:not([data-theme="dark"]) body.home .wp-site-blocks>header:not(.is-scrolled):has(.mm-i.is-armed) :is(.nx-sound-btn a,.nx-search-btn a,.nx-theme-btn .wp-block-button__link):hover{background:rgba(14,43,22,.08)!important}
/* Plain hover on the transparent header: a soft light pill instead of the dark green one. */
html:not([data-theme="dark"]) body.home .wp-site-blocks>header:not(.is-scrolled):not(:has(.mm-i.is-armed)) .mm-i:hover>a{background:rgba(255,255,255,.14)}
