/* Explicit visitor variants only. Site mode inherits every saved/native color. */
html[data-he-appearance="light"] { --he-ex-bg:#fcfbf8; --he-ex-text:#172128; --he-ex-surface:#eeede7; --he-ex-muted:#4c5a61; --he-ex-border:#b8c1c8; --he-ex-link:color-mix(in srgb,var(--wp--preset--color--accent) 85%,#000); --he-ex-focus:#215d9c; color-scheme:light; }
html[data-he-appearance="dark"] { --he-ex-bg:#11171e; --he-ex-text:#edf1f5; --he-ex-surface:#1a232d; --he-ex-muted:#b7c2ce; --he-ex-border:#526170; --he-ex-link:color-mix(in srgb,var(--wp--preset--color--accent) 40%,#fff); --he-ex-focus:#f4ca8a; color-scheme:dark; }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]),
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :is(.he-portal-dark,.he-modern-header,.he-modern-footer) {
 --wp--preset--color--background:var(--he-ex-bg); --wp--preset--color--foreground:var(--he-ex-text); --wp--preset--color--surface:var(--he-ex-surface); --wp--preset--color--muted:var(--he-ex-muted); --wp--preset--color--border:var(--he-ex-border);
 --he-dark-bg:var(--he-ex-bg); --he-dark-text:var(--he-ex-text); --he-dark-surface:var(--he-ex-surface); --he-dark-muted:var(--he-ex-muted); --he-dark-rule:var(--he-ex-border);
}
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) body { background:var(--he-ex-bg); color:var(--he-ex-text); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :is(.he-modern-header,.he-modern-footer) { background:var(--he-ex-bg); color:var(--he-ex-text); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks .he-modern-footer :where(.wp-block-site-title,.wp-block-site-tagline,h2,h3,p,li) { color:var(--he-ex-text); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks .he-kicker { color:var(--he-ex-link); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks .he-modern-footer .he-footer-socials .wp-social-link a { color:var(--he-ex-text); background:var(--he-ex-surface); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks a { color:var(--he-ex-link); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :is(.wp-block-post-title,.wp-block-site-title,.wp-block-navigation,.he-section-title) a { color:inherit; }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :is(.wp-block-search__input,input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),textarea,select) { background:var(--he-ex-bg); color:var(--he-ex-text); border-color:var(--he-ex-muted); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :is(input,textarea)::placeholder { color:var(--he-ex-muted); opacity:1; }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :is(.wp-block-search__button,.wp-block-button__link,input[type="submit"]) { background:var(--he-ex-text); color:var(--he-ex-bg); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :is(.wp-block-navigation__submenu-container,.wp-block-navigation__responsive-container.is-menu-open) { background:var(--he-ex-surface); color:var(--he-ex-text); }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .wp-site-blocks :where(a,button,input,select,textarea,summary):focus-visible { outline:2px solid var(--he-ex-focus); outline-offset:3px; }
/* Keep dark photo overlays legible in Light; whole photos and mobile stay contextual. */
@media(min-width:761px) {
 html[data-he-appearance="light"] .he-portal-dark .he-module:not(.he-fit--contain) .he-feed--cover .he-card:has(figure) .he-card-copy { --he-dark-text:#edf1f5; --he-dark-muted:#cbd5df; color:#edf1f5; }
 html[data-he-appearance="light"] .he-portal-dark .he-module:not(.he-fit--contain) .he-feed--cover .he-card:has(figure) .he-card-copy a { color:#edf1f5; }
}
.he-navigation-tools { display:flex; align-items:center; gap:.5rem 1rem; max-width:var(--wp--style--global--wide-size); margin-inline:auto; margin-block:0; min-width:0; grid-column:1/-1; background:inherit; color:inherit; box-sizing:border-box; padding:5px 12px; border-block:1px solid var(--wp--preset--color--border); border-bottom:2px solid transparent; }
.he-modern-header .he-navigation-tools>.he-primary-nav { flex:1; min-width:0; margin:0; border:0; padding:0; }
.he-navigation-tools .he-appearance { flex:0 1 auto; max-width:100%; }
.he-navigation-tools.he-navigation-fixed { position:fixed; top:var(--he-nav-top,0px); left:var(--he-nav-left,0px); width:var(--he-nav-width); max-width:none; margin:0; z-index:1000; box-sizing:border-box; background:var(--wp--preset--color--background); box-shadow:0 3px 12px #0002; }
.he-navigation-placeholder { margin-block:0; pointer-events:none; grid-column:1/-1; }
.he-navigation-tools.he-nav-compact .he-primary-nav .wp-block-navigation__responsive-container:not(.is-menu-open) { display:none; }
.he-navigation-tools.he-nav-compact .he-primary-nav .wp-block-navigation__responsive-container-open { display:flex; }
.he-navigation-tools.he-nav-compact>.he-primary-nav { flex:1 0 44px; min-inline-size:44px; }
/* Reserve the selector and start compact before first paint; JS measures the real menu.
   With JS disabled the head marker is absent and native desktop navigation is retained. */
html[data-he-motion] .he-navigation-pending .he-primary-nav .wp-block-navigation__responsive-container:not(.is-menu-open) { display:none; }
html[data-he-motion] .he-navigation-pending .he-primary-nav .wp-block-navigation__responsive-container-open { display:flex; }
html[data-he-motion] .he-appearance[hidden] { display:inline-flex; visibility:hidden; }
.he-navigation-tools:has(.is-menu-open) { z-index:100001; }
.he-appearance { align-items:center; flex-wrap:wrap; gap:.375rem .5rem; min-width:0; font:500 .8125rem/1.4 var(--wp--preset--font-family--system); color:inherit; }
.he-appearance:not([hidden]) { display:inline-flex; }
.he-appearance select { box-sizing:border-box; font:inherit; width:auto; min-inline-size:min(100%,10.5rem); max-inline-size:100%; min-height:44px; padding:.5rem 2rem .5rem .75rem; border:1px solid var(--wp--preset--color--muted); border-radius:5px; background:var(--wp--preset--color--background); color:var(--wp--preset--color--foreground); }
.he-appearance-label { max-width:100%; overflow-wrap:anywhere; }
.he-appearance .he-appearance-label-hidden,.wp-site-blocks .he-appearance select.he-appearance-native { position:absolute; width:1px; height:1px; min-width:0; min-height:0; padding:0; border:0; clip-path:inset(50%); overflow:hidden; white-space:nowrap; }
.he-appearance svg { width:20px; height:20px; margin:0; vertical-align:middle; }
.he-appearance-current-icon>span { display:none; }
.he-appearance-field { display:inline-flex; align-items:center; gap:8px; min-width:0; max-width:100%; }
.he-appearance-current-icon { flex:0 0 20px; }
.he-appearance--text-icons select { min-inline-size:min(100%,9rem); }
.he-appearance[data-he-selection="site"] [data-he-state-icon="site"],.he-appearance[data-he-selection="light"] [data-he-state-icon="light"],.he-appearance[data-he-selection="dark"] [data-he-state-icon="dark"] { display:inline-flex; }
.he-appearance-choices { display:flex; gap:4px; border:1px solid var(--wp--preset--color--border); border-radius:7px; padding:3px; }
.he-appearance-choices button { position:relative; display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:8px; border:1px solid transparent; border-radius:4px; background:transparent; color:inherit; cursor:pointer; }
.he-appearance-choices button[aria-pressed="true"] { border-color:currentColor; background:color-mix(in srgb,currentColor 10%,transparent); }
.he-appearance-check { display:none; position:absolute; inset-inline-end:1px; bottom:0; font-size:10px; line-height:1; }
.he-appearance-choices button[aria-pressed="true"] .he-appearance-check { display:block; }
.he-appearance :is(button,select):focus-visible { outline:3px solid var(--he-ex-focus,var(--wp--preset--color--accent)); outline-offset:3px; }
.he-appearance-footer { margin-block:1rem 0; }
.he-back-to-top { position:fixed; bottom:max(1rem,env(safe-area-inset-bottom)); right:max(1rem,env(safe-area-inset-right)); width:44px; height:44px; padding:0; border:1px solid var(--wp--preset--color--muted); border-radius:50%; background:var(--wp--preset--color--background); color:var(--wp--preset--color--foreground); box-shadow:0 2px 8px #0002; z-index:90; cursor:pointer; }
.he-back-to-top:not([hidden]) { display:grid; place-items:center; }
.he-back-to-top:focus-visible { outline:3px solid var(--he-ex-focus,var(--wp--preset--color--accent)); outline-offset:3px; }
html { scroll-padding-top:var(--he-navigation-offset,0px); }
/* Discovery remains native: clear editoria/continuation links and visible keyboard feedback. */
.he-section-title a,.he-reading-related a,.he-reading-navigation a { text-decoration:underline; text-underline-offset:.2em; text-decoration-thickness:1px; }
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
 html[data-he-motion="on"] .he-card .wp-block-post-title a,
 html[data-he-motion="on"] :is(.he-section-title a,.he-reading-navigation a,.he-appearance select,.he-back-to-top) { transition:color .15s ease,border-color .15s ease,box-shadow .15s ease; }
 html[data-he-motion="on"] .he-card .wp-block-post-title a:hover { text-decoration:underline; text-underline-offset:.15em; }
 html[data-he-motion="on"] .he-back-to-top:hover { box-shadow:0 3px 12px #0004; }
}
/* Preserve tablet's editorial bar when complete links fit in at most two rows. */
@media(min-width:600px) and (max-width:1023px) {
 .he-navigation-tools { gap:.5rem .75rem; align-items:center; }
 .he-navigation-tools>.he-appearance { flex-basis:min-content; min-inline-size:min(100%,10.5rem); }
 .he-navigation-tools .he-appearance-label { flex-basis:100%; }
 .he-nav-tablet .he-primary-nav .wp-block-navigation__container { flex-wrap:wrap; gap:0 .375rem; }
 .he-nav-tablet .he-primary-nav .wp-block-navigation__container>.wp-block-navigation-item { flex:0 0 auto; }
 .he-modern-header .he-nav-tablet .he-primary-nav .wp-block-navigation-item__content { font-size:.875rem; min-height:44px; padding:.5rem .375rem; white-space:nowrap; }
 .he-nav-tablet .he-primary-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { white-space:normal; }
 .he-nav-tablet .he-menu-icon { width:18px; height:18px; margin-inline-end:.3em; }
 .he-nav-tablet .he-sticky-identity { display:none; }
}
@media(max-width:599px) { .he-navigation-tools { gap:.5rem; flex-wrap:wrap; } .he-navigation-tools>.he-appearance { margin-inline-start:auto; } }
/* Refine the same fixed bar, respecting brand colors and the existing anchor. */
.he-navigation-tools.he-navigation-fixed { padding:5px 12px; border-block:1px solid var(--wp--preset--color--border); border-bottom:2px solid color-mix(in srgb,var(--wp--preset--color--accent) 35%,var(--wp--preset--color--border)); border-radius:0 0 6px 6px; background:var(--he-header-background,var(--wp--preset--color--background)); color:var(--he-header-text,var(--wp--preset--color--foreground)); box-shadow:0 6px 18px #0002; }
.he-modern-header .he-navigation-fixed>.he-primary-nav { border:0; padding:0; }
.he-navigation-tools .he-appearance { padding-block:2px; }
.he-navigation-fixed .he-primary-nav .wp-block-navigation__submenu-container { box-shadow:0 8px 20px #0002; }
html:is([data-he-appearance="light"],[data-he-appearance="dark"]) .he-navigation-tools.he-navigation-fixed { background:var(--he-ex-bg); color:var(--he-ex-text); }
@media(prefers-reduced-motion:reduce) { .he-navigation-tools *,.he-back-to-top,.he-appearance { transition:none; animation:none; } }
