/* Header dropdowns and phone menu */
html { --nx-bg: #FFFFFF; --nx-text: #121315; --nx-muted: #666B71; --nx-line: #E4E6E9; --nx-hover: #F2F3F5; }
html.ch-theme-dark { --nx-bg: #101113; --nx-text: #F3F4F5; --nx-muted: #9BA0A7; --nx-line: rgba(255, 255, 255, 0.11); --nx-hover: #1B1D21; }

/* the panel spans the screen; its top padding keeps the pointer "inside" while moving down */
html body header.header div.nx-panel[id$="-mega-menu"] { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; margin: 0 !important; padding: var(--nx-top, 76px) 0 0 !important; border: 0; background: transparent !important; box-shadow: none !important; overflow: visible !important; cursor: default; }
html body header.header .megaMenu:focus-within > div.nx-panel { display: block !important; }
html body header.header .megaMenu.nx-shut > div.nx-panel { display: none !important; }
.nx { max-height: calc(100vh - var(--nx-top, 76px)); overflow-y: auto; border-top: 1px solid var(--nx-line); border-bottom: 1px solid var(--nx-line); background: var(--nx-bg); box-shadow: 0 40px 60px -30px rgba(0, 0, 0, 0.4); animation: nx-in 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes nx-in { from { opacity: 0; translate: 0 -10px; } }
.nx-inner { display: grid; gap: clamp(18px, 2.4vw, 36px); width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 34px; text-align: left; }
.nx-services { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(180px, 1.15fr); }
.nx-industries { grid-template-columns: minmax(0, 1fr) 260px; }

html body header.header .nx .nx-col p:not(#f1) { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--nx-line); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--nx-muted) !important; }
html body header.header .nx a:not(#f1):not(#f2) { position: relative; z-index: auto !important; text-decoration: none; color: var(--nx-text) !important; -webkit-text-fill-color: currentColor; }
html body header.header .nx .nx-col a { display: block; margin: 0 -10px; padding: 7px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 1.3; transition: background-color 0.15s, padding 0.2s; }
html body header.header .nx .nx-col a:is(:hover, :focus-visible) { padding-left: 16px; background: var(--nx-hover); }
html body header.header .nx :is(.nx-col a, .nx-grid a)[aria-current="page"]:not(#f1):not(#f2) { color: #E2501A !important; font-weight: 800; }

.nx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 16px; align-content: start; }
html body header.header .nx .nx-grid a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; font-size: 14.5px; font-weight: 700; transition: background-color 0.15s; }
html body header.header .nx .nx-grid a:is(:hover, :focus-visible) { background: var(--nx-hover); }
html body header.header .nx .nx-grid img { width: 62px; height: 46px; flex: 0 0 auto; border-radius: 8px; object-fit: cover; transition: scale 0.3s; }
.nx-grid a:hover img { scale: 1.08; }

html body header.header .nx a.nx-feature { display: flex; flex-direction: column; justify-content: flex-end; min-height: 230px; padding: 20px; border-radius: 16px; background: linear-gradient(transparent 20%, rgba(6, 7, 8, 0.92)), var(--img) center / cover; overflow: hidden; }
html body header.header .nx a.nx-feature:not(#f1) :is(strong, small, i), html body header.header .nx a.nx-feature:not(#f1):not(#f2) { color: #FFFFFF !important; -webkit-text-fill-color: #FFFFFF; }
.nx-feature strong { font-family: "Cabinet Grotesk", sans-serif; font-size: 22px; font-weight: 800; }
.nx-feature small { margin-top: 2px; font-size: 13px; }
.nx-feature i { position: absolute; top: 14px; right: 14px; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #C2410C; font-style: normal; transition: rotate 0.3s; }
.nx-feature:hover i { rotate: -45deg; }

/* while a dropdown is open the header takes the menu's colours, so its titles stay readable */
html body header.header:has(.megaMenu:hover, .megaMenu:focus-within) { background: var(--nx-bg) !important; }
html body header.header:has(.megaMenu:hover, .megaMenu:focus-within) nav a.menu_links:not(#f1):not(#f2):not(#f3):not(#f4) { color: var(--nx-text) !important; -webkit-text-fill-color: currentColor; }
html:not(.ch-theme-dark) body header.header:has(.megaMenu:hover, .megaMenu:focus-within) a[href="/"] img[src*="createhopes-logo"] { content: url("/images/createhopes-logo-dark.png") !important; }

/* ---------- phone menu ---------- */
html body #ch-mobile-menu { background: var(--nx-bg) !important; color: var(--nx-text); }
html body #ch-mobile-menu nav { display: block; padding: 4px 20px 90px; text-align: left; }
html body #ch-mobile-menu nav > a, html body #ch-mobile-menu nav summary { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--nx-line); font-family: "Cabinet Grotesk", sans-serif !important; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--nx-text) !important; text-decoration: none; list-style: none; cursor: pointer; }
html body #ch-mobile-menu summary::-webkit-details-marker { display: none; }
html body #ch-mobile-menu summary::after { content: '+'; font-size: 28px; font-weight: 400; color: #E2501A; transition: rotate 0.25s; }
html body #ch-mobile-menu details[open] > summary::after { rotate: 45deg; }
html body #ch-mobile-menu details > div { padding: 8px 0 16px; border-bottom: 1px solid var(--nx-line); }
html body #ch-mobile-menu details > div p { margin: 18px 0 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--nx-muted) !important; }
html body #ch-mobile-menu details a { display: block; margin: 0; padding: 10px 0; font-size: 16px; font-weight: 500; color: var(--nx-text) !important; text-decoration: none; }
html body #ch-mobile-menu .nx-m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
html body #ch-mobile-menu .nx-m-grid a { padding: 0; font-size: 14px; font-weight: 700; }
html body #ch-mobile-menu .nx-m-grid img { display: block; width: 100%; aspect-ratio: 3 / 2; margin-bottom: 6px; border-radius: 10px; object-fit: cover; }
html body #ch-mobile-menu a[aria-current="page"] { color: #E2501A !important; }
html body #ch-mobile-menu .ch-mm-close { color: var(--nx-text) !important; }

@media (max-width: 1200px) {
    .nx-services { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .nx-services .nx-feature { display: none !important; }
    .nx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .nx { animation: none; } }

/* the older dropdown rules are keyed on two ids, so these name both panels */
html body #___gatsby header.header #services-mega-menu,
html body #___gatsby header.header #industries-mega-menu { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; max-width: none !important; margin: 0 !important; padding: var(--nx-top, 76px) 0 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; transform: none !important; }
html body #___gatsby header.header #services-mega-menu::before,
html body #___gatsby header.header #industries-mega-menu::before { content: none; }
html body #___gatsby header.header #services-mega-menu > div.nx:not(#f1),
html body #___gatsby header.header #industries-mega-menu > div.nx:not(#f1) { display: block !important; }
html body #___gatsby header.header .megaMenu:is(.nx-shut, :not(:hover):not(:focus-within):not(.is-open)) > #services-mega-menu,
html body #___gatsby header.header .megaMenu:is(.nx-shut, :not(:hover):not(:focus-within):not(.is-open)) > #industries-mega-menu { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

/* an industry without a picture keeps its place */
.nx-grid .nx-blank { width: 62px; height: 46px; flex: 0 0 auto; border-radius: 8px; background: var(--nx-hover); }
