:root{
  --purple:#7C3AED;
  --purple-600:#6D28D9;
  --nav:#0E2A47;
  --muted:#5B6B7B;
  --ring:rgba(124,58,237,.18);
  --ring-hover:rgba(124,58,237,.10);
  --white:#FFFFFF;
  --divider:rgba(14,42,71,0.08);
  --shadow:0 10px 30px rgba(14,42,71,.08);
}

/* Header base */
.header{
  position:fixed;
  top:0;left:0;right:0;
  z-index:50;
  height:88px;
  display:flex;
  align-items:center;
  background:transparent;
  transition:background .2s ease, box-shadow .2s ease, height .16s ease, border-color .2s ease;
  will-change:background, height, box-shadow;
}
.header.header--overlay{ background:transparent; }
.header.is-sticky{
  height:72px;
  background:var(--white);
  box-shadow:var(--shadow);
  border-bottom:1px solid rgba(14,42,71,0.06);
}

.header .container{
  max-width:1240px;
  margin:0 auto;
  padding:0 28px;
  display:grid;
  grid-template-columns:220px 1fr auto;
  gap:24px;
  align-items:center;
}

/* Brand */
.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:var(--nav);
  text-decoration:none;
  font-weight:700;
  font-size:20px;
  letter-spacing:.2px;
}
.brand img{ display:block; height:32px; width:auto; }

/* Primary menu */
.primary-menu{ display:flex; gap:36px; list-style:none; margin:0; padding:0; }
.primary-menu>li{ position:relative; }
.primary-menu>li>a,
.primary-menu>li>.menu-label{
  position:relative;
  display:inline-block;
  padding:0; /* visual spacing handled by gap */
  color:var(--nav);
  font-weight:600;
  font-size:18px;
  letter-spacing:.2px;
  text-decoration:none;
  cursor:pointer;
}
.primary-menu>li>a::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-6px;
  height:2px;
  background:var(--purple);
  transform:scaleX(0);
  transform-origin:left;
  transition:transform .2s ease;
}
.primary-menu>li.current-menu-item>a::after,
.primary-menu>li.current_page_item>a::after{ transform:scaleX(1); }

.primary-menu>li>a:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(124,58,237,.35);
  border-radius:6px;
}

/* Dropdown indicator for menu items with children */
.primary-menu>li.menu-item-has-children>a::before{
  content:"";
  display:inline-block;
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:5px solid var(--nav);
  margin-left:6px;
  margin-bottom:2px;
  vertical-align:middle;
  transition:transform .2s ease;
}
.primary-menu>li.menu-item-has-children:hover>a::before,
.primary-menu>li.menu-item-has-children:focus-within>a::before{
  transform:rotate(180deg);
}

/* Hide arrow for menu-label (Blog dropdown without arrow) */
.primary-menu>li.menu-item-has-children>.menu-label::before{
  display:none;
}

/* Submenu / Dropdown */
.primary-menu .sub-menu{
  position:absolute;
  top:calc(100% + 16px);
  left:-12px;
  min-width:220px;
  background:var(--white);
  border-radius:12px;
  box-shadow:0 10px 40px rgba(14,42,71,.12);
  padding:12px 0;
  list-style:none;
  margin:0;
  opacity:0;
  visibility:hidden;
  transform:translateY(-8px);
  transition:opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index:100;
}

.primary-menu>li:hover>.sub-menu,
.primary-menu>li:focus-within>.sub-menu{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.primary-menu .sub-menu .menu-item{
  margin:0;
}

.primary-menu .sub-menu a{
  display:block;
  padding:10px 20px;
  color:var(--nav);
  text-decoration:none;
  font-size:16px;
  font-weight:500;
  transition:background .15s ease, color .15s ease;
}

.primary-menu .sub-menu a:hover{
  background:rgba(124,58,237,.06);
  color:var(--purple);
}

.primary-menu .sub-menu a:focus-visible{
  outline:none;
  background:rgba(124,58,237,.1);
  color:var(--purple);
}

/* Right rail */
.header-rail{ display:flex; align-items:center; gap:16px; }
.call-us{ display:flex; align-items:center; gap:8px; white-space:nowrap; }
.call-us span{ color:var(--muted); font-size:16px; }
.call-us .phone{
  color:var(--purple);
  text-decoration:none;
  font-weight:600;
  font-size:16px;
}
.call-us .phone:hover{ color:var(--purple-600); }
.call-us .phone:focus-visible{ outline:none; box-shadow:0 0 0 3px rgba(124,58,237,.35); border-radius:8px; }

.search-btn{
  width:40px; height:40px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:999px;
  background:var(--white);
  border:1px solid var(--ring);
  color:var(--nav);
  transition:box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.header.header--overlay .search-btn{ background:transparent; }
.search-btn:hover{ box-shadow:0 0 0 6px var(--ring-hover); }
.search-btn:focus-visible{ outline:none; box-shadow:0 0 0 3px rgba(124,58,237,.35); }

.btn-cta{
  display:inline-flex; align-items:center; justify-content:center;
  padding:14px 22px;
  background:var(--purple);
  color:#fff;
  border-radius:999px;
  text-decoration:none;
  font-weight:600;
  font-size:16px;
  letter-spacing:.2px;
  transition:background .15s ease, box-shadow .15s ease;
}
.btn-cta:hover{ background:var(--purple-600); }
.btn-cta:focus-visible{ outline:none; box-shadow:0 0 0 3px rgba(124,58,237,.35); }

/* Divider utility (if needed) */
.divider-x{ width:1px; height:24px; background:var(--divider); }

/* Reduce header spacing slightly on smaller screens */
@media (max-width: 1023px){
  .header .container{ grid-template-columns:160px 1fr auto; gap:16px; }
  .primary-menu{ gap:22px; }
}

@media (max-width: 767px){
  .header{ height:72px; }
  .header .container{ grid-template-columns:1fr auto; }
  nav[aria-label="Main"]{ display:none; }
  .header-rail{ flex-wrap: wrap; gap: 12px; }
  .call-us{ display:none; }
}

/* Prevent overlap between fixed header and content when no hero overlay */
body:not(.has-hero) #content{ margin-top: 20px; }
@media (max-width: 767px){ body:not(.has-hero) #content{ margin-top: 16px; } }

/* WordPress admin bar adjustments */
html.admin-bar .header{ top:32px; }
@media (max-width: 782px){ html.admin-bar .header{ top:46px; } }
html.admin-bar body:not(.has-hero) #content{ margin-top: 20px; }
@media (max-width: 782px){ html.admin-bar body:not(.has-hero) #content{ margin-top: 16px; } }


