/**
 * cs-header.css
 *
 * CapeStart fixed frosted pill header + mega menu.
 * Ported from the `home` mockup and adapted to this theme.
 *
 * Integration notes:
 * - Root class is `.cs-header`, NOT `.site-header`. The theme's own fallback
 *   header already owns `.site-header` (opaque `--surface` background plus a
 *   `border-bottom`), and those two declarations would have leaked in and
 *   destroyed the transparent frosted look.
 * - Every selector below is scoped under `.cs-header`, so nothing in this file
 *   can affect Elementor output or the rest of the theme.
 * - All design tokens are namespaced `--cs-*`. The mockup shipped bare
 *   `--accent` and `--dark`, which collide with this theme's global tokens and
 *   would have re-coloured buttons and surfaces site-wide.
 * - The mockup's global reset, `body` flex-centering, `html { scroll-behavior }`
 *   and blanket `a`/`svg` rules were dropped: global.css already covers them,
 *   and the `body` rules in particular broke the theme layout.
 * - The scrolled state keys off `body.is-scrolled`, which the theme's own
 *   main.js already sets (rAF-throttled, 24px threshold). The mockup's separate
 *   un-throttled scroll listener was removed rather than duplicated.
 *
 * @package ElementorStarter
 */

/* Design tokens now live in cs-tokens.css, loaded as a dependency. */

/* ---------------------------------------------------------------------------
 * Header CTA. Scoped so it cannot touch the theme's own button components.
 * The mockup's grouped `.btn-grad/.btn-white/.btn-ghost/.btn-outline` rules are
 * omitted: the header uses only `.btn-dark.is-orange`, and `.btn-ghost` /
 * `.btn-outline` are real classes in this theme's buttons.css.
 * ------------------------------------------------------------------------- */

.cs-header .btn-dark {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cs-ink-btn); color: #fff; border: 1px solid transparent;
  border-radius: var(--cs-r-pill); padding: 11px 22px;
  font-family: var(--cs-font-sans); font-size: 15px; font-weight: 600;
  line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform 0.35s var(--cs-ease), background 0.3s ease,
              color 0.3s ease, border-color 0.3s ease;
}
.cs-header .btn-dark svg {
  width: 15px; height: 15px; color: #fff;
  transition: transform 0.35s var(--cs-ease), color 0.3s ease;
}
.cs-header .btn-dark.is-orange { background: var(--cs-orange); }
.cs-header .btn-dark:hover,
.cs-header .btn-dark:focus-visible { background: var(--cs-orange); color: #fff; transform: translateY(-3px) scale(1.02); }
.cs-header .btn-dark.is-orange:hover,
.cs-header .btn-dark.is-orange:focus-visible { background: #f04d27; border-color: #f04d27; }
.cs-header .btn-dark:hover svg { transform: translateX(3px); }
.cs-header .btn-dark:active { transform: scale(0.97); }
.cs-header .btn-dark:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ===================================================================
   SITE HEADER — fixed, frosted pill nav; gathers into one pill on scroll
==================================================================== */
.cs-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 20px 0; transition: padding 0.25s ease;/*background:#fff;*/
}
.is-scrolled .cs-header {
  background:transparent;
}
body.is-scrolled .cs-header { padding: 12px 0; }
.cs-header .header-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 6px clamp(20px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-radius: var(--cs-r-pill); border: 1px solid transparent;
  transition: max-width 0.35s var(--cs-ease), padding 0.35s var(--cs-ease),
              background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
body.is-scrolled .cs-header .header-inner {
  max-width: 1040px; padding: 6px 10px 6px 22px; gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(226, 232, 240, 0.7);
  box-shadow: 0 18px 44px -22px rgba(15, 27, 45, 0.28);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}
.cs-header .brand { flex: 0 0 auto; display: flex; align-items: center; }
.cs-header .brand img { height: 30px; width: auto; display: block; transition: height 0.3s var(--cs-ease); }
body.is-scrolled .cs-header .brand img { height: 27px; }

.cs-header .main-nav { flex: 1; display: flex; justify-content: center; }
.cs-header .nav-pill {
  display: flex; align-items: center; gap: 4px; list-style: none;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--cs-r-pill); padding: 6px;
  box-shadow: 0 14px 34px -20px rgba(15, 27, 45, 0.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
body.is-scrolled .cs-header .nav-pill {
  background: none; border-color: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.cs-header .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-family: var(--cs-font-sans); font-size: 14px; font-weight: 500;
  padding: 10px 18px; border-radius: var(--cs-r-pill);
  color: var(--cs-slate); text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.cs-header .nav-link:hover, .cs-header .nav-link.is-open { color: var(--cs-blue); }
.cs-header .nav-link.is-active { color: var(--cs-blue); background: rgba(20, 139, 255, 0.10); font-weight: 600; }
.cs-header .nav-link .nav-caret { width: 12px; height: 12px; }
.cs-header .header-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.cs-header .header-actions .btn-dark { white-space: nowrap; }

.cs-header .nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 10px; border-radius: 12px;
}
.cs-header .nav-toggle span { width: 22px; height: 2px; background: var(--cs-ink); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
.cs-header .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cs-header .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cs-header .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1080px) { .nav-link { padding: 10px 13px; } }
@media (max-width: 940px) {
.cs-header .nav-toggle { display: flex; }
.cs-header .main-nav {
    position: fixed; inset: 0 0 0 auto; width: min(360px, 86vw);
    background: var(--cs-panel); box-shadow: -20px 0 60px -30px rgba(15,27,45,0.4);
    padding: 96px 20px 32px; overflow-y: auto; display: block;
    transform: translateX(102%); transition: transform 0.35s var(--cs-ease);
  }
.cs-header .main-nav.open { transform: translateX(0);        height: 100vh; }
.cs-header .nav-pill {
    flex-direction: column; align-items: stretch; gap: 2px;
    background: none; border: none; box-shadow: none; padding: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
.cs-header .nav-link { width: 100%; justify-content: space-between; padding: 14px 12px; font-size: 16px; }
.cs-header .header-actions .btn-dark { display: none; }
body.is-scrolled .cs-header .header-inner { max-width: 100%; }
}
/* ===================================================================
   MEGA MENU  (shared by the hero header + sticky header)
==================================================================== */
/* nav triggers */
.cs-header .nav-drop { display: inline-flex; align-items: center; gap: 5px; }
.cs-header .nav-caret { width: 13px; height: 13px; flex: none; opacity: 0.55; transition: transform 0.3s var(--cs-ease), opacity 0.25s ease; }
.cs-header .nav-drop.is-open .nav-caret { transform: rotate(180deg); opacity: 1; }
.cs-header a.header__link { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.cs-header .header__link.is-open { color: var(--cs-ink); }
.cs-header .header__link.is-open::after { transform: scaleX(1); }
.cs-header .nav-ext { width: 11px; height: 11px; flex: none; opacity: 0.5; transition: transform 0.25s var(--cs-ease), opacity 0.25s ease; }
.cs-header a:hover .nav-ext { opacity: 1; transform: translate(1px, -1px); }

/* sticky-header trigger variant (mirrors .sticky-nav a) */
.cs-header .sticky-nav .snav-link {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--cs-font-sans); font-size: 15px; font-weight: 500; color: var(--cs-slate);
  text-decoration: none; transition: color 0.25s ease;
}
.cs-header .sticky-nav .snav-link:hover, .cs-header .sticky-nav .snav-link.is-open { color: var(--cs-navy); }

/* dropdown positioner (10px top padding doubles as a hover bridge) */
.cs-header .mega {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 80;
  display: none; justify-content: center;
  padding: 10px clamp(16px, 3vw, 40px) 0;
}
.cs-header .mega.is-open { display: flex; }
.cs-header .mega__panel { display: none; width: 100%; justify-content: center; }
.cs-header .mega__panel.is-active { display: flex; }

/* the card — frosted white sheet, Epoch top hairline, big soft shadow */
.cs-header .mega__card {
  position: relative; overflow-x: hidden; overflow-y: auto;
  max-width: 100%; max-height: min(74vh, 540px);
  background: rgba(255, 255, 255, 1);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(226, 232, 240, 0.75);
  border-radius: 26px;
  box-shadow: 0 40px 90px -22px rgba(10, 27, 51, 0.28), 0 6px 24px -14px rgba(10, 27, 51, 0.14);
  animation: megaIn 0.38s var(--cs-ease) both;
}
.cs-header .mega__card::before {
  content: ""; position: absolute; top: 0; left: 10%; width: 80%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cs-blue), var(--cs-accent), transparent);
  opacity: 0.85; pointer-events: none;
}
@keyframes megaIn {
.cs-header from { opacity: 0; transform: translateY(-10px) scale(0.985); }
.cs-header to { opacity: 1; transform: translateY(0) scale(1); }
}
.cs-header .mega.is-closing .mega__panel.is-active .mega__card { animation: megaOut 0.16s ease both; }
@keyframes megaOut { to { opacity: 0; transform: translateY(-6px) scale(0.99); } }

/* rich items (Industry / Resources / Company) — icon tile + title + desc */
.cs-header .mrich { display: flex; align-items: flex-start; gap: 13px; padding: 12px 14px; border-radius: 16px; text-decoration: none; transition: background 0.25s ease; }
.cs-header .mrich:hover { background: rgba(20, 139, 255, 0.06); }
.cs-header .mrich__icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(20, 139, 255, 0.09); color: var(--cs-blue);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s var(--cs-ease);
}
.cs-header .mrich__icon svg { width: 19px; height: 19px; }
.cs-header .mrich:hover .mrich__icon { background: var(--cs-blue); color: #fff; transform: scale(1.06); }
.cs-header .mrich__title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--cs-ink); line-height: 1.3; }
.cs-header .mrich__arrow { display: none; }
.cs-header .mrich:hover .mrich__arrow { opacity: 0; }
.cs-header .mrich__desc { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--cs-muted); }

.cs-header .mega__card--nav {
  display: flex; align-items: stretch; gap: clamp(16px, 2vw, 28px);
  width: min(1040px, 100%); padding: 22px;
}
.cs-header .mnav__main { flex: 1 1 auto; min-width: 0; }
.cs-header .mnav__label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
  color: #8a97ab; margin: 2px 0 8px; padding: 0 12px;
}
.cs-header .mnav__cols { columns: 2; column-gap: clamp(14px, 1.8vw, 26px); }
.cs-header .mnav__cols .mrich { break-inside: avoid; margin-bottom: 2px; }
.cs-header .mega__card--nav > .mfeat { flex: 0 0 250px; min-height: 0; }
@media (max-width: 1120px) {
.cs-header .mega__card--nav > .mfeat { display: none; }
}
@media (max-width: 1000px) {
.cs-header .mnav__cols { columns: 2; }
}

/* Solutions — the big one: 3 hairline-divided link columns + featured tile */
.cs-header .mega__card--solutions {
  display: grid; grid-template-columns: 1.1fr 1.1fr 1.15fr 250px;
  gap: clamp(18px, 2vw, 32px);
  width: min(1120px, 100%); padding: 28px clamp(20px, 2.4vw, 34px);
}
.cs-header .mega__card--solutions .mcol + .mcol { border-left: 1px solid rgba(226, 232, 240, 0.6); padding-left: clamp(16px, 1.8vw, 28px); }
.cs-header .mcol__label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
  color: #8a97ab; margin: 0 0 6px; padding: 0 10px;
}
.cs-header .mcol__list { list-style: none; display: flex; flex-direction: column; }
.cs-header .mcol--stack { display: flex; flex-direction: column; gap: 18px; }
.cs-header .mlink { display: block; padding: 8px 10px; border-radius: 12px; text-decoration: none; transition: background 0.22s ease; }
.cs-header .mlink:hover { background: rgba(20, 139, 255, 0.07); }
.cs-header .mlink__t { display: block; font-size: 13.5px; font-weight: 600; color: var(--cs-ink); line-height: 1.35; }
.cs-header .mlink__d { display: block; margin-top: 1px; font-size: 12px; line-height: 1.4; color: var(--cs-muted); }

/* featured tile — navy, grid texture + glow (echoes the footer) */
.cs-header .mfeat {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 250px; padding: 22px 20px; border-radius: 18px;
  background: var(--cs-navy); text-decoration: none;
  transition: transform 0.35s var(--cs-ease), box-shadow 0.35s ease;
}
.cs-header .mfeat::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(130% 90% at 85% 0%, rgba(20, 139, 255, 0.38), transparent 62%),
    linear-gradient(rgba(97, 214, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 214, 255, 0.06) 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
}
.cs-header .mfeat::after {
  content: ""; position: absolute; top: 0; left: 12%; width: 76%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cs-blue), var(--cs-accent), transparent);
  box-shadow: 0 0 14px rgba(97, 214, 255, 0.5);
}
.cs-header .mfeat:hover { transform: translateY(-3px); box-shadow: 0 20px 44px -18px rgba(4, 30, 80, 0.55); }
.cs-header .mfeat__eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cs-orange-light); }
.cs-header .mfeat__title { margin-top: 8px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; color: #fff; }
.cs-header .mfeat__desc { margin-top: 7px; font-size: 12.5px; line-height: 1.5; color: #9fb2cc; }
.cs-header .mfeat__cta { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--cs-accent); }
.cs-header .mfeat__cta svg { width: 14px; height: 14px; transition: transform 0.3s var(--cs-ease); }
.cs-header .mfeat:hover .mfeat__cta svg { transform: translateX(4px); }

@media (max-width: 1180px) {
.cs-header .mega__card--solutions { grid-template-columns: 1fr 1fr 1.05fr; }
.cs-header .mfeat { display: none; }
}
@media (max-width: 1000px) {
.cs-header .mega__card--solutions { grid-template-columns: 1fr 1fr; }
.cs-header .mega__card--solutions .mcol + .mcol { border-left: none; padding-left: 0; }
.cs-header .mega__card--industry { grid-template-columns: repeat(2, minmax(0, 240px)); }
}
/*
 * Hide the desktop mega menu in drawer mode.
 *
 * This was 900px in the mockup while the drawer starts at 940px, leaving a 40px
 * band where the off-canvas drawer was active and the mega could still open on
 * top of it. Both are 940px now, matching MOBILE_QUERY in cs-header.js.
 */
@media (max-width: 940px) { .cs-header .mega { display: none !important; } }

/* ---------------------------------------------------------------------------
 * Mobile submenu accordions
 *
 * The mockup shipped no mobile submenus: below the drawer breakpoint the four
 * dropdown triggers were tappable, animated their caret, and opened nothing.
 * cs-header.js now builds a `.nav-sub` list per trigger from the same mega
 * panels, carrying item names only — no icons, no description lines, no
 * featured-tile styling.
 *
 * These lists exist in the DOM at every width, so they are hidden outright
 * outside drawer mode and only revealed when their trigger is expanded.
 * ------------------------------------------------------------------------- */

.cs-header .nav-sub { display: none; }

@media (max-width: 940px) {
  .cs-header .nav-sub {
    display: block;
    margin: 2px 0 6px;
    padding: 2px 0 6px 12px;
    border-left: 2px solid var(--cs-slate-200);
  }

  /* `hidden` is set by the script; without this, `display:block` would win. */
  .cs-header .nav-sub[hidden] { display: none; }

  .cs-header .nav-sub__link {
    display: block;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--cs-muted);
    border-radius: 10px;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .cs-header .nav-sub__link:hover,
  .cs-header .nav-sub__link:focus-visible {
    color: var(--cs-blue);
    background: rgba(20, 139, 255, 0.08);
  }

  /* The caret already rotates via `.is-open`, which the script sets. */
  .cs-header .nav-drop[aria-expanded="true"] { color: var(--cs-blue); }
}

/* ---------------------------------------------------------------------------
 * Theme / WordPress integration
 * ------------------------------------------------------------------------- */

/* Local resets, scoped — replaces the mockup's global `a` and `svg` rules. */
/*
 * Set the typeface on the root so descendants inherit it.
 *
 * The mockup's `body` was Poppins, so elements that never declared a
 * font-family — the wordmark link, the footer's blurb, its link columns and the
 * office addresses — simply inherited it. In this theme `body` is `--font-body`
 * (Inter), so those same elements silently fell back to Inter while the ones
 * that *did* declare Poppins kept it. The result was one component rendering in
 * two typefaces. Declaring it here restores the mockup's inheritance.
 */
.cs-header { font-family: var(--cs-font-sans); }

/*
 * Re-establish the mockup's base text metrics.
 *
 * This theme's body is fluid (`--font-size-base` clamps 16→18px) with a 1.65
 * line-height. The mockup was a flat 16px / 1.5. Every text element in this
 * component sets its own px font-size, so the inherited values only surface
 * through inline strut boxes — and there they were measurably wrong: at 1440px
 * the 18px strut made each footer list row 3px taller than designed, on top of
 * the 1.65 line-height adding another ~2px. Pinning both restores the intended
 * rhythm. Scoped, so the theme's fluid type is untouched everywhere else.
 */
.cs-header { font-size: 16px; line-height: 1.5; }

.cs-header a { color: inherit; text-decoration: none; }
.cs-header svg { display: block; }
.cs-header ul { margin: 0; padding: 0; list-style: none; }
/*
 * The theme's typography.css sets `li { margin-bottom: var(--space-2) }`. In the
 * nav pill, which is a centred flex row, that 8px counted toward each item's
 * flex box and pushed the links 4px above centre. The mockup had a global reset
 * so this never showed up there.
 */
.cs-header li { margin: 0; }
.cs-header button { font-family: inherit; }

/* Drawer scroll lock. Set by cs-header.js as a class rather than an inline
 * style, so it cannot fight Elementor popups, which also manage body scroll. */
body.cs-nav-open { overflow: hidden; }

/*
 * `.cs-header` is fixed, so page content needs to clear it. Exposed as a token
 * so a child theme can retune it without copying this file.
 */
:root { --cs-header-offset: 92px; }

/*
 * Sibling selectors, deliberately: body_class() runs before header.php decides
 * whether this header or an Elementor Theme Builder header is rendering, so a
 * body class cannot be set in time. `.cs-header` and the content wrapper are
 * siblings directly under <body>, so `~` makes the offset self-conditional with
 * no PHP at all — no header, no offset.
 */
.cs-header ~ .site-main,
.cs-header ~ .elementor {
  padding-top: var(--cs-header-offset);
}

/* The admin bar is also fixed at top:0 and would sit on top of the header. */
body.admin-bar .cs-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .cs-header { top: 46px; }
}

/* The theme hides `.site-header` when printing; do the same for this one. */
@media print {
  .cs-header { display: none !important; }
  .cs-header ~ .site-main,
  .cs-header ~ .elementor { padding-top: 0; }
}

/* Respect reduced-motion for the header's own transitions. */
@media (prefers-reduced-motion: reduce) {
  .cs-header,
  .cs-header *,
  .cs-header *::before,
  .cs-header *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
