/* ==========================================================================
   Nulectrics — Global Styles
   Design tokens, reset, typography, utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */

:root {
  /* Brand Colours (immutable) */
  --nu-green: #79C68C;
  --nu-blue: #20B6BA;
  --nu-text-dark: #272724;
  --nu-bg-dark: #0F1820;
  --nu-mid-grey: #525353;
  --nu-light-grey: #EFEFEF;
  --nu-white: #FFFFFF;
  --nu-gradient-green-start: #119F6B;
  --nu-gradient-green-end: #87CC9F;

  /* BG variation tokens — two subtle variants per theme (dark defaults below;
   * light overrides in the [data-theme="light"] / @media block).
   * Dark mode: slightly lighter shades of the base dark.
   * Light mode: very light greys (#F7F7F7, #EFEFEF). */
  --nu-theme-bg-var-1: #141F28;
  --nu-theme-bg-var-2: #1A2631;

  /* Semantic Theme Tokens (dark mode defaults) */
  --nu-theme-bg: #0F1820;
  --nu-theme-text: #FFFFFF;
  --nu-theme-heading: #FFFFFF;
  --nu-theme-muted: #C0C0C0;
  --nu-theme-surface: rgba(255, 255, 255, 0.04);
  --nu-theme-border: rgba(255, 255, 255, 0.1);
  --nu-theme-input-bg: rgba(255, 255, 255, 0.05);
  --nu-theme-input-border: rgba(255, 255, 255, 0.15);
  --nu-theme-accent: #79C68C;
  --nu-theme-accent-hover: #20B6BA;
  --nu-theme-accent-subtle: rgba(121, 198, 140, 0.15);
  --nu-theme-card-bg: rgba(255, 255, 255, 0.03);
  --nu-theme-focus: rgba(121, 198, 140, 0.5);
  --nu-theme-link: var(--nu-green);
  --nu-theme-link-hover: var(--nu-blue);

  /* Standard gap (33px throughout) */
  --nu-gap: 33px;
  --nu-gap-sm: 20px;
  --nu-gap-lg: 50px;

  /* Legacy aliases */
  --nu-text: var(--nu-text-dark);
  --nu-bg: var(--nu-theme-bg);
  --nu-white: #FFFFFF;

  /* Typography */
  --nu-font: 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --nu-fw-regular: 400;
  --nu-fw-bold: 700;

  /* Font sizes */
  --nu-fs-body: clamp(0.95rem, 0.9rem + 0.2vw, 1.17rem);      /* ~15px → ~19px body */
  --nu-fs-h1: clamp(2rem, 1.7rem + 1.13vw, 2.83rem);         /* ~32px → ~45px (was 24→34, +33%) */
  --nu-fs-h2: clamp(1.7rem, 1.41rem + 0.9vw, 2.33rem);       /* ~27px → ~37px (was 20→28, +33%) */
  --nu-fs-h3: clamp(1.41rem, 1.25rem + 0.56vw, 1.83rem);     /* ~22px → ~29px (was 17→22, +33%) */
  /* Small text (meta, dates, eyebrows) now matches body size for a uniform
   * typographic rhythm per design direction. Pill/badge-style labels that
   * should stay compact keep their own literal size (0.75rem). */
  /* Small text (eyebrows, meta, dates, breadcrumbs, form labels, pills).
   * Floor raised to 15px 2026-07-21 (was 12px, then 14px) on the client's
   * readability preference. Now sits just below body (15.2 -> 18.7px),
   * a subtle rather than strong step down. Every small usage reads this
   * token, so this is the single point of control. */
  --nu-fs-small: clamp(0.9375rem, 0.9rem + 0.13vw, 1rem);

  /* CTA size — for prominent inline-link CTAs that need to read bigger
   * than body without going full H3. Used by the Gravity Forms submit
   * button. ~17 → ~21px. */
  --nu-fs-cta: clamp(1.05rem, 1rem + 0.35vw, 1.3rem);

  /* Lead — one step above body for intro paragraphs, answer blocks,
   * post deks and author names. ~17 → ~20px. Amalgamates the former
   * one-off em sizes (1.08 / 1.1 / 1.15em) that bypassed the scale. */
  --nu-fs-lead: clamp(1.05rem, 1rem + 0.25vw, 1.25rem);

  /* Line heights — three rungs. Headings sit tight, compact UI/meta
   * snug, body prose relaxed. (line-height:1 is kept literal where it
   * is a pure glyph reset, e.g. the hero star row.) */
  --nu-lh-tight: 1.2;   /* headings, card titles */
  --nu-lh-snug: 1.4;    /* pills, meta, compact UI text */
  --nu-lh-body: 1.6;    /* body prose, ledes, list items */

  /* Letter spacing — three rungs. Amalgamates ten scattered values.
   * (The hero star row keeps its literal 4px glyph spacing.) */
  --nu-ls-tight: 0.02em; /* subtle tracking */
  --nu-ls-label: 0.08em; /* uppercase labels */
  --nu-ls-wide: 0.12em;  /* eyebrows, widest tracking */

  /* Layout */
  --nu-container: 1333px;
  --nu-gutter: 20px;

  /* Section padding options */
  --nu-pad-sm: 33px;
  --nu-pad-md: 66px;
  --nu-pad-lg: 99px;

  /* Transitions */
  --nu-transition: 0.3s ease-in-out;
  --nu-transition-slow: 0.6s ease-in-out;

  /* Shadows */
  --nu-glow: 0 0 13px 0 rgba(183, 218, 151, 0.13);
  --nu-glow-hover: 0 0 13px 0 rgba(183, 218, 151, 0.23);

  /* Border radius */
  --nu-radius: 0;
  --nu-radius-sm: 3px;

  /* ---- EG Google Reviews plugin overrides ---- */
  /* These map the plugin's --egr-* variables to theme tokens so the
     testimonials shortcode picks up the brand automatically. */
  --egr-accent:       var(--nu-green);
  --egr-accent-start: var(--nu-gradient-green-start);
  --egr-accent-end:   var(--nu-gradient-green-end);
  --egr-text:         var(--nu-theme-text);
  --egr-heading:      var(--nu-theme-heading);
  --egr-muted:        var(--nu-theme-muted);
  --egr-surface:      var(--nu-theme-surface);
  --egr-border:       var(--nu-theme-border);
  --egr-gap:          var(--nu-gap);
  --egr-padding:      33px;
  --egr-font:         var(--nu-font);
  --egr-fs-body:      var(--nu-fs-body);
  --egr-fs-small:     var(--nu-fs-small);
  --egr-fs-heading:   var(--nu-fs-h2);
  --egr-fw-regular:   var(--nu-fw-regular);
  --egr-fw-bold:      var(--nu-fw-bold);
}

/* =========================================================
 * THEME LAYER PATTERN
 *
 * Dark mode is the default (:root). Light mode activates via
 * @media (prefers-color-scheme: light) when no JS override is
 * present, OR via [data-theme="light"] set by the JS toggle.
 *
 * Cascade priority:
 *   :root                                → dark defaults
 *   @media (prefers-color-scheme: light)
 *     :root:not([data-theme="dark"])     → auto light (no JS)
 *   [data-theme="light"]                 → manual light (JS)
 *   [data-theme="dark"]                  → manual dark  (JS)
 *
 * To add a new theme:
 * 1. Copy the [data-theme="light"] block below
 * 2. Rename to [data-theme="your-theme"]
 * 3. Override only the --nu-theme-* tokens
 * 4. Add the option to theme-toggle.js cycle
 * 5. Add the @media query if it should auto-detect
 *
 * Tokens to override (all required):
 *   --nu-theme-bg, --nu-theme-text, --nu-theme-heading,
 *   --nu-theme-muted, --nu-theme-surface, --nu-theme-border,
 *   --nu-theme-input-bg, --nu-theme-input-border,
 *   --nu-theme-accent, --nu-theme-accent-hover,
 *   --nu-theme-accent-subtle, --nu-theme-card-bg,
 *   --nu-theme-focus, --nu-theme-link, --nu-theme-link-hover,
 *   --nu-glow, --nu-glow-hover
 * ========================================================= */

/* --- Light tokens (shared by auto-detect and manual toggle) --- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --nu-theme-bg: #FFFFFF;
    --nu-theme-text: #272724;
    --nu-theme-heading: #0F1820;
    --nu-theme-muted: #525353;
    --nu-theme-surface: #F7F7F7;
    --nu-theme-border: rgba(0, 0, 0, 0.08);
    --nu-theme-input-bg: #F5F5F5;
    --nu-theme-input-border: rgba(0, 0, 0, 0.15);
    --nu-theme-accent: #0C7B4E;                       /* 5.6:1 on white — AA ✓ */
    --nu-theme-accent-hover: #0F1820;
    --nu-theme-accent-subtle: rgba(17, 159, 107, 0.08);
    --nu-theme-card-bg: #FFFFFF;
    --nu-theme-focus: rgba(12, 123, 78, 0.4);
    --nu-theme-link: #0C7B4E;                         /* AA on white ✓ */
    --nu-theme-link-hover: #0F1820;
    --nu-bg: #FFFFFF;
    --nu-glow: 0 0 13px 0 rgba(17, 159, 107, 0.08);
    --nu-glow-hover: 0 0 13px 0 rgba(17, 159, 107, 0.16);
    --nu-theme-bg-var-1: #F7F7F7;
    --nu-theme-bg-var-2: #EFEFEF;
  }
}

/* --- Manual light (JS toggle) --- */
[data-theme="light"] {
  --nu-theme-bg: #FFFFFF;
  --nu-theme-text: #272724;
  --nu-theme-heading: #0F1820;
  --nu-theme-muted: #525353;
  --nu-theme-surface: #F7F7F7;
  --nu-theme-border: rgba(0, 0, 0, 0.08);
  --nu-theme-input-bg: #F5F5F5;
  --nu-theme-input-border: rgba(0, 0, 0, 0.15);
  --nu-theme-accent: #0C7B4E;
  --nu-theme-accent-hover: #0F1820;
  --nu-theme-accent-subtle: rgba(17, 159, 107, 0.08);
  --nu-theme-card-bg: #FFFFFF;
  --nu-theme-focus: rgba(12, 123, 78, 0.4);
  --nu-theme-link: #0C7B4E;
  --nu-theme-link-hover: #0F1820;
  --nu-bg: #FFFFFF;
  --nu-glow: 0 0 13px 0 rgba(17, 159, 107, 0.08);
  --nu-glow-hover: 0 0 13px 0 rgba(17, 159, 107, 0.16);
  --nu-theme-bg-var-1: #F7F7F7;
  --nu-theme-bg-var-2: #EFEFEF;
}

/* --- Manual dark (JS override when OS prefers light) --- */
[data-theme="dark"] {
  --nu-theme-bg: #0F1820;
  --nu-theme-text: #FFFFFF;
  --nu-theme-heading: #FFFFFF;
  --nu-theme-muted: #C0C0C0;
  --nu-theme-surface: rgba(255, 255, 255, 0.04);
  --nu-theme-border: rgba(255, 255, 255, 0.1);
  --nu-theme-input-bg: rgba(255, 255, 255, 0.05);
  --nu-theme-input-border: rgba(255, 255, 255, 0.15);
  --nu-theme-accent: #79C68C;
  --nu-theme-accent-hover: #20B6BA;
  --nu-theme-accent-subtle: rgba(121, 198, 140, 0.15);
  --nu-theme-card-bg: rgba(255, 255, 255, 0.03);
  --nu-theme-focus: rgba(121, 198, 140, 0.5);
  --nu-theme-link: var(--nu-green);
  --nu-theme-link-hover: var(--nu-blue);
  --nu-bg: #0F1820;
  --nu-glow: 0 0 13px 0 rgba(183, 218, 151, 0.13);
  --nu-glow-hover: 0 0 13px 0 rgba(183, 218, 151, 0.23);
  --nu-theme-bg-var-1: #141F28;
  --nu-theme-bg-var-2: #1A2631;
}

/* --------------------------------------------------------------------------
   2. Font Face Declarations
   -------------------------------------------------------------------------- */

/* NOTE: @font-face descriptors do NOT accept var()/custom properties —
   they must be literal. Using var(--nu-fw-*) here silently makes both
   faces register as weight 400, so 700 requests fall back to faux-bold.
   Keep these literal 400 / 700. (Regression from the 2026-08-03 weight
   token sweep, fixed 2026-08-06.) */
@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/proximanova-regular-webfont.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Proxima Nova';
  src: url('../fonts/proximanova-bold-webfont.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   3. Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--nu-font);
  font-weight: var(--nu-fw-regular);
  font-size: var(--nu-fs-body);
  line-height: var(--nu-lh-body);
  color: var(--nu-theme-text);
  background-color: var(--nu-theme-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  /* Defensive backstop against horizontal overflow leaks (e.g. a future
   * module accidentally extending past viewport, or trackpad rubber-band
   * from inner scroll containers). `clip` is preferred over `hidden`:
   * `hidden` makes body a scroll container and breaks position: sticky
   * descendants (notably the merged sticky header). `clip` is purely
   * visual clipping with no scroll-container side effects. */
  overflow-x: clip;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--nu-theme-accent);
  text-decoration: none;
  transition: color var(--nu-transition);
}

a:hover {
  color: var(--nu-theme-accent-hover);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* --------------------------------------------------------------------------
 * Default list styling.
 *
 * Plain <ul> (no class attribute) — i.e. anything a WYSIWYG editor types
 * — automatically picks up the brand gradient-square bullet (9×9). UI
 * lists (site nav, footer menu, contents nav, card lists, etc.) all
 * have their own classes, so :not([class]) leaves them alone.
 *
 * If you need the brand bullet on a classed <ul>, add the `.nu-bullet-list`
 * utility class (defined in modules.css) — it produces identical output.
 *
 * <ol> keeps the standard decimal/numeric rendering.
 * -------------------------------------------------------------------------- */

ul:not([class]) {
  list-style: none;
  padding-left: 0;
  margin: var(--nu-gap-sm) 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

ul:not([class]) li {
  position: relative;
  padding-left: 22px;
  line-height: var(--nu-lh-body);
  margin-bottom: 0;
  color: var(--nu-theme-text);
}

ul:not([class]) li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, var(--nu-gradient-green-start), var(--nu-gradient-green-end));
  flex-shrink: 0;
}

/* Nested lists inherit the brand bullet + indent once */
ul:not([class]) ul:not([class]) {
  margin-top: 8px;
  margin-left: 8px;
}

ol {
  padding-left: 20px;
}

ol li {
  margin-bottom: 10px;
}

hr {
  width: 33px;
  border: none;
  border-top: 2px solid var(--nu-green);
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--nu-font);
  font-weight: var(--nu-fw-bold);
  line-height: var(--nu-lh-tight);
  color: var(--nu-theme-heading);
}

h1 {
  font-size: var(--nu-fs-h1);
}

h2 {
  font-size: var(--nu-fs-h2);
}

h3 {
  font-size: var(--nu-fs-h3);
}

p {
  margin-bottom: 1em;
  color: var(--nu-theme-text);
}

li {
  color: var(--nu-theme-text);
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: var(--nu-fw-bold);
}

/* --------------------------------------------------------------------------
   5. Layout Utilities
   -------------------------------------------------------------------------- */

.nu-container {
  width: 100%;
  max-width: var(--nu-container);
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--nu-gutter);
  padding-left: var(--nu-gutter);
}

.nu-section {
  width: 100%;
  position: relative;
}

/* Section padding utility classes (applied via ACF).
 *
 * Standard rhythm:
 *   pad-top--md : 66px desktop, 33px mobile
 *   pad-top--lg : 99px desktop, 66px mobile
 *   pad-top--sm : 33px everywhere
 * Bottom padding is not mobile-remapped — sections still need to breathe
 * at the bottom of the viewport.
 */
.nu-pad-top--sm { padding-top: var(--nu-pad-sm); }
.nu-pad-top--md { padding-top: var(--nu-pad-md); }
.nu-pad-top--lg { padding-top: var(--nu-pad-lg); }

.nu-pad-bottom--sm { padding-bottom: var(--nu-pad-sm); }
.nu-pad-bottom--md { padding-bottom: var(--nu-pad-md); }
.nu-pad-bottom--lg { padding-bottom: var(--nu-pad-lg); }

@media (max-width: 767px) {
  .nu-pad-top--md { padding-top: var(--nu-pad-sm); }
  .nu-pad-top--lg { padding-top: var(--nu-pad-md); }

  /* Hero-specific mobile rule — the hero sits directly under the fixed
   * site header, so whichever padding_top the editor chose in the ACF
   * dropdown (md or lg), on mobile we always collapse it to --sm (33px).
   * Desktop & tablet still honour the editor's selection. */
  .nu-hero.nu-pad-top--md,
  .nu-hero.nu-pad-top--lg { padding-top: var(--nu-pad-sm); }
}

/* Section style variants */
.nu-style--plain {
  background-color: var(--nu-theme-bg);
}

.nu-style--bg-1 {
  background-color: var(--nu-theme-bg-var-1);
}

.nu-style--bg-2 {
  background-color: var(--nu-theme-bg-var-2);
}

/* Slant variants — bg split by a ~10° tilted line. The slant appears near
 * the bottom of the section. Hard colour stops keep the divide crisp. */
.nu-style--slant-1 {
  background-color: var(--nu-theme-bg-var-1);
  background-image: linear-gradient(
    170deg,
    var(--nu-theme-bg-var-1) 0%,
    var(--nu-theme-bg-var-1) 82%,
    var(--nu-theme-bg-var-2) 82%,
    var(--nu-theme-bg-var-2) 100%
  );
}

.nu-style--slant-2 {
  background-color: var(--nu-theme-bg-var-2);
  background-image: linear-gradient(
    170deg,
    var(--nu-theme-bg-var-2) 0%,
    var(--nu-theme-bg-var-2) 82%,
    var(--nu-theme-bg-var-1) 82%,
    var(--nu-theme-bg-var-1) 100%
  );
}

.nu-style--gradient {
  background-color: var(--nu-theme-bg);
  /* Default gradient — PHP randomises the positions via inline style */
  background-image:
    radial-gradient(ellipse at 60% 100%, rgba(121, 198, 140, 0.08) 0%, transparent 65%),
    radial-gradient(circle at 5% 50%, rgba(32, 182, 186, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 30%, rgba(17, 159, 107, 0.04) 0%, transparent 45%);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .nu-style--gradient {
    background-image:
      radial-gradient(ellipse at 60% 100%, rgba(121, 198, 140, 0.06) 0%, transparent 65%),
      radial-gradient(circle at 5% 50%, rgba(32, 182, 186, 0.04) 0%, transparent 55%),
      radial-gradient(ellipse at 90% 30%, rgba(17, 159, 107, 0.03) 0%, transparent 45%);
  }
}

[data-theme="light"] .nu-style--gradient {
  background-image:
    radial-gradient(ellipse at 60% 100%, rgba(121, 198, 140, 0.06) 0%, transparent 65%),
    radial-gradient(circle at 5% 50%, rgba(32, 182, 186, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 30%, rgba(17, 159, 107, 0.03) 0%, transparent 45%);
}

/* Section-level theme inversion — apply to any .nu-section to flip tokens */
:root:not([data-theme="light"]) .nu-style--invert {
  --nu-theme-bg: #FFFFFF;
  --nu-theme-text: #272724;
  --nu-theme-heading: #0F1820;
  --nu-theme-muted: #525353;
  --nu-theme-surface: #F7F7F7;
  --nu-theme-border: rgba(0, 0, 0, 0.08);
  --nu-theme-accent: #0C7B4E;
  --nu-theme-accent-hover: #0F1820;
  --nu-theme-accent-subtle: rgba(17, 159, 107, 0.08);
  --nu-theme-card-bg: #FFFFFF;
  --nu-theme-focus: rgba(12, 123, 78, 0.4);
  --nu-glow: 0 0 13px 0 rgba(17, 159, 107, 0.08);
  --nu-glow-hover: 0 0 13px 0 rgba(17, 159, 107, 0.16);
  background-color: var(--nu-theme-bg);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .nu-style--invert {
    --nu-theme-bg: #0F1820;
    --nu-theme-text: #FFFFFF;
    --nu-theme-heading: #FFFFFF;
    --nu-theme-muted: #C0C0C0;
    --nu-theme-surface: rgba(255, 255, 255, 0.04);
    --nu-theme-border: rgba(255, 255, 255, 0.1);
    --nu-theme-accent: #79C68C;
    --nu-theme-accent-hover: #20B6BA;
    --nu-theme-accent-subtle: rgba(121, 198, 140, 0.15);
    --nu-theme-card-bg: rgba(255, 255, 255, 0.03);
    --nu-theme-focus: rgba(121, 198, 140, 0.5);
    --nu-glow: 0 0 13px 0 rgba(183, 218, 151, 0.13);
    --nu-glow-hover: 0 0 13px 0 rgba(183, 218, 151, 0.23);
    background-color: var(--nu-theme-bg);
  }
}

[data-theme="light"] .nu-style--invert {
  --nu-theme-bg: #0F1820;
  --nu-theme-text: #FFFFFF;
  --nu-theme-heading: #FFFFFF;
  --nu-theme-muted: #C0C0C0;
  --nu-theme-surface: rgba(255, 255, 255, 0.04);
  --nu-theme-border: rgba(255, 255, 255, 0.1);
  --nu-theme-accent: #79C68C;
  --nu-theme-accent-hover: #20B6BA;
  --nu-theme-accent-subtle: rgba(121, 198, 140, 0.15);
  --nu-theme-card-bg: rgba(255, 255, 255, 0.03);
  --nu-theme-focus: rgba(121, 198, 140, 0.5);
  --nu-glow: 0 0 13px 0 rgba(183, 218, 151, 0.13);
  --nu-glow-hover: 0 0 13px 0 rgba(183, 218, 151, 0.23);
  background-color: var(--nu-theme-bg);
}

/* Theme-aware asset swap — generic version of the header-scoped rule.
 * Use on any pair of <img> where one is designed for dark bg, the other
 * for light. Default (dark mode): show --light (the white-text variant);
 * light mode: swap to --dark. Scoped to .nu-hero__cert-logo etc to avoid
 * clashing with the header logo's more specific rules. */
img.nu-logo--light { display: inline-block; }
img.nu-logo--dark { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) img.nu-logo--light { display: none; }
  :root:not([data-theme="dark"]) img.nu-logo--dark { display: inline-block; }
}

[data-theme="light"] img.nu-logo--light { display: none; }
[data-theme="light"] img.nu-logo--dark { display: inline-block; }

/* White-on-transparent asset that has no dark counterpart — invert via
 * filter in light mode so it reads against white. Works for pure white
 * assets; any coloured pixels will also invert (not ideal), so prefer
 * the dual-img pattern above for logos with brand colour. */
.nu-invert-on-light { transition: filter var(--nu-transition); }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .nu-invert-on-light {
    filter: brightness(0) opacity(0.75);
  }
}

[data-theme="light"] .nu-invert-on-light {
  filter: brightness(0) opacity(0.75);
}

/* Legacy bg classes — kept for backward compat, map to theme tokens */
.nu-bg--dark { background-color: var(--nu-theme-bg); }
.nu-bg--light { background-color: var(--nu-theme-surface); }
.nu-bg--white { background-color: var(--nu-theme-bg); }

/* --------------------------------------------------------------------------
   Chevron utility
   --------------------------------------------------------------------------
   The single canonical "navigate forward" affordance — used in dropdowns,
   service card rows, destination card CTAs, anywhere a directional arrow
   is needed. See docs/design/HIERARCHY-AUDIT-2026-06-03.md §9.

   Geometry rationale (BBox-centre pivot at 75% 75%): the four rotations
   all keep their visual centre at the same screen point, so rotating from
   --down to --up (or any pair) is a clean in-place flip with no drift.

   Rule: chevrons do NOT translate on hover. They can recolour. They can
   appear / disappear. They never move.
   -------------------------------------------------------------------------- */

.nu-chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform-origin: 75% 75%;
  transition: color var(--nu-transition);
}

.nu-chevron--right { transform: rotate(-45deg); }   /* › forward nav */
.nu-chevron--left  { transform: rotate(135deg); }   /* ‹ back */
.nu-chevron--down  { transform: rotate(45deg); }    /* v dropdown closed */
.nu-chevron--up    { transform: rotate(-135deg); }  /* ^ dropdown open */

/* Grid */
.nu-grid {
  display: grid;
  gap: var(--nu-gutter);
}

.nu-grid--2 { grid-template-columns: repeat(2, 1fr); }
.nu-grid--3 { grid-template-columns: repeat(3, 1fr); }
.nu-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .nu-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .nu-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .nu-grid--2,
  .nu-grid--3,
  .nu-grid--4 {
    grid-template-columns: 1fr;
  }
}

/* Flexbox helpers */
.nu-flex {
  display: flex;
  gap: var(--nu-gutter);
}

.nu-flex--center {
  align-items: center;
  justify-content: center;
}

.nu-flex--between {
  align-items: center;
  justify-content: space-between;
}

.nu-flex--wrap {
  flex-wrap: wrap;
}

/* Width constraints */
.nu-narrow {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.nu-medium {
  max-width: 1000px;
  margin-right: auto;
  margin-left: auto;
}

/* Visually hidden (accessible) */
.nu-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Two column list */
.nu-twocol {
  columns: 2;
}

@media (max-width: 767px) {
  .nu-twocol {
    columns: 1;
  }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.nu-btn {
  display: inline-block;
  font-family: var(--nu-font);
  font-weight: var(--nu-fw-bold);
  font-size: var(--nu-fs-body);
  padding: 14px 32px;
  background-color: transparent;
  color: var(--nu-theme-accent);
  border: 2px solid var(--nu-theme-accent);
  border-radius: var(--nu-radius);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color var(--nu-transition), color var(--nu-transition), border-color var(--nu-transition);
  min-height: 44px;
  line-height: var(--nu-lh-tight);
}

.nu-btn:hover {
  background-color: var(--nu-green);
  color: var(--nu-bg);
  text-decoration: none;
}

.nu-btn--filled {
  background-color: var(--nu-green);
  color: var(--nu-bg);
}

.nu-btn--filled:hover {
  background-color: var(--nu-blue);
  border-color: var(--nu-blue);
  color: var(--nu-white);
}

/* .nu-btn--outline removed 2026-06-06 — was an identical duplicate of the
   base .nu-btn rule. Templates do not reference it. Use .nu-btn for the
   outline pattern and .nu-btn--filled for filled.
   .nu-btn--dark removed 2026-06-03 — unused in production, off-brand. */

/* --------------------------------------------------------------------------
   6b. Primary CTA Link (sliding underline)
   -------------------------------------------------------------------------- */

.nu-cta-link {
  display: inline-block;
  font-family: var(--nu-font);
  font-weight: var(--nu-fw-regular);
  font-size: var(--nu-fs-body);
  color: var(--nu-theme-accent);
  text-decoration: none;
  padding-bottom: 2px;
  background-image: linear-gradient(45deg, var(--nu-gradient-green-end), var(--nu-gradient-green-start));
  background-position: 0 100%;
  background-size: 100% 2px;
  background-repeat: no-repeat;
  transition: color var(--nu-transition);
  line-height: var(--nu-lh-snug);
}

.nu-cta-link:hover {
  color: var(--nu-theme-accent-hover);
  text-decoration: none;
  animation: nu-link-hover 0.8s ease-in-out forwards;
}

/* --------------------------------------------------------------------------
   7. Green left-border accent box
   -------------------------------------------------------------------------- */

/* Per design hierarchy (2026-06-03): the 6px vertical gradient bar is
   reserved for the hero. .nu-accent-box now uses a 2px gradient TOP
   border instead — a horizontal variation in the same family. */
.nu-accent-box {
  position: relative;
  padding: 33px;
  background-color: var(--nu-theme-surface);
  box-shadow: var(--nu-glow);
  transition: box-shadow var(--nu-transition);
}

/* .nu-accent-box::before stripe deleted 2026-06-06 — side/edge gradient
 * accents are now reserved exclusively for the hero. Accent box relies
 * on surface tint + glow alone. */

.nu-accent-box:hover {
  box-shadow: var(--nu-glow-hover);
}

/* Box shadow utility */
.nu-box-shadow {
  box-shadow: var(--nu-glow);
  transition: box-shadow var(--nu-transition);
}

.nu-box-shadow:hover {
  box-shadow: var(--nu-glow-hover);
}

/* --------------------------------------------------------------------------
   Accessibility (WCAG 2.2 baseline)
   Skip-to-content link + focus-visible outlines. Focus outline colour uses
   the accent token so it flips light/dark cleanly.
   -------------------------------------------------------------------------- */

/* Skip-to-content link — hidden until focused. Keyboard users get a visible
 * anchor to jump past the header nav. WCAG 2.4.1 (Bypass Blocks). */
.nu-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 12px 20px;
  background: var(--nu-theme-bg);
  color: var(--nu-theme-accent);
  border: 2px solid var(--nu-theme-accent);
  font-weight: var(--nu-fw-bold);
  text-decoration: none;
  border-radius: 0;
}
.nu-skip-link:focus {
  left: 20px;
  top: 20px;
  outline: 3px solid var(--nu-theme-accent);
  outline-offset: 2px;
}

/* Consistent focus-visible outline across all interactive elements.
 * WCAG 2.4.7 (Focus Visible) + WCAG 2.4.11 (Focus Appearance). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--nu-theme-accent);
  outline-offset: 2px;
  border-radius: 0;
}

/* Main landmark shouldn't show a focus ring when programmatically focused
 * via the skip-link — keeps the visual clean. */
main:focus {
  outline: none;
}

/* Respect reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   CookieYes consent bar — 76% wide, centred along the bottom on desktop;
   full width on mobile. Set the CookieYes banner layout to "Banner / Bar"
   positioned "Bottom" in the CookieYes settings; this constrains its width.
   !important is needed to beat CookieYes's inline/dashboard styles.
   -------------------------------------------------------------------------- */
.cky-consent-container {
  width: 76% !important;
  max-width: 76% !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}
.cky-consent-container .cky-consent-bar {
  width: 100% !important;
  max-width: 100% !important;
}

/* Theme-aware colours: follow the site's auto light/dark theme instead of the
   default white banner. Uses the same --nu-theme-* tokens as the rest of the
   site, so it flips with OS preference and the manual theme toggle. */
.cky-consent-bar {
  background: var(--nu-theme-bg) !important;
  color: var(--nu-theme-text) !important;
  border: 1px solid var(--nu-theme-border) !important;
  box-shadow: var(--nu-glow) !important;
}
.cky-title { color: var(--nu-theme-heading) !important; }
.cky-notice-des,
.cky-notice-des * { color: var(--nu-theme-text) !important; }
.cky-notice-des a { color: var(--nu-theme-link) !important; }

/* Consent buttons mirror the site button system (.nu-btn / .nu-btn--filled):
   sharp corners, bold body text, 2px border, SOLID fills (no gradient pill —
   the brand gradient is reserved for underlines / accent bars, never button
   fills), sized to content rather than stretched full-width. */
.cky-btn,
.cky-btn-accept,
.cky-btn-reject,
.cky-btn-customize,
.cky-btn-preferences {
  font-family: var(--nu-font) !important;
  font-weight: var(--nu-fw-bold) !important;
  font-size: var(--nu-fs-body) !important;
  line-height: var(--nu-lh-tight) !important;
  padding: 14px 32px !important;
  min-height: 44px !important;
  border-radius: var(--nu-radius) !important;
  width: auto !important;
  flex: 0 0 auto !important;
  transition: background-color var(--nu-transition), color var(--nu-transition), border-color var(--nu-transition) !important;
}
/* Primary — matches .nu-btn--filled (solid green, dark text, hover to blue). */
.cky-btn-accept {
  background: var(--nu-green) !important;
  color: var(--nu-bg) !important;
  border: 2px solid var(--nu-theme-accent) !important;
}
.cky-btn-accept:hover {
  background: var(--nu-blue) !important;
  border-color: var(--nu-blue) !important;
  color: var(--nu-white) !important;
}
/* Secondary — matches .nu-btn (outline, hover fills green). */
.cky-btn-reject,
.cky-btn-customize,
.cky-btn-preferences {
  background: transparent !important;
  color: var(--nu-theme-accent) !important;
  border: 2px solid var(--nu-theme-accent) !important;
}
.cky-btn-reject:hover,
.cky-btn-customize:hover,
.cky-btn-preferences:hover {
  background: var(--nu-green) !important;
  border-color: var(--nu-theme-accent) !important;
  color: var(--nu-bg) !important;
}
/* Floating "revisit consent" cookie icon */
.cky-btn-revisit-wrapper { background: var(--nu-theme-accent) !important; }

/* Preferences modal (CKY modal) — same theme-aware treatment as the banner,
   so the white-on-white "Save My Preferences" / "Reject All" buttons become
   visible. */
.cky-preference-center {
  background: var(--nu-theme-bg) !important;
  color: var(--nu-theme-text) !important;
  border: 1px solid var(--nu-theme-border) !important;
}
.cky-preference-center .cky-preference-title { color: var(--nu-theme-heading) !important; }
.cky-preference-center .cky-preference-body-wrapper,
.cky-preference-center .cky-notice-des,
.cky-preference-center .cky-accordion-header-des,
.cky-preference-center .cky-accordion-btn,
.cky-preference-center .cky-accordion-header,
.cky-preference-center p,
.cky-preference-center span,
.cky-preference-center li { color: var(--nu-theme-text) !important; }
.cky-preference-center a { color: var(--nu-theme-link) !important; }
.cky-preference-center .cky-accordion,
.cky-preference-center .cky-footer-wrapper,
.cky-preference-center .cky-preference-header { border-color: var(--nu-theme-border) !important; }
.cky-preference-center .cky-always-active { color: var(--nu-theme-accent) !important; }
.cky-preference-header .cky-btn-close span { color: var(--nu-theme-text) !important; }
/* CookieYes fades the scroll area to white above the footer — fade to the
   theme bg instead so it does not read as a white band on the dark modal. */
.cky-preference-center .cky-footer-shadow {
  background: linear-gradient(rgba(0,0,0,0), var(--nu-theme-bg)) !important;
}

@media (max-width: 767px) {
  .cky-consent-container {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    transform: none !important;
  }
}
