/* Native WordPress menus preserve the approved header geometry. */
.header .primary-menu{display:flex;align-items:center;gap:25px;list-style:none;margin:0;padding:0}
.header .primary-menu>li{margin:0;padding:0;list-style:none}
.header .primary-menu>li>a{display:flex;align-items:center;min-height:44px;white-space:nowrap;color:var(--brand-soft)}
.header .primary-menu>li>a:is(:hover,:focus-visible){color:var(--brand-lime)}
.header .primary-menu>li>a[aria-current="page"],.header .primary-menu>li.current-page-ancestor>a{text-decoration:underline;text-underline-offset:6px;text-decoration-thickness:1px}
.header .primary-menu>.menu-item-contact{margin-left:10px}
.header .primary-menu>.menu-item-contact>.header-cta{display:inline-flex;padding:15px 18px;gap:13px;font-size:12px;color:var(--brand-ink)}
.header .primary-menu>.menu-item-contact>.header-cta:is(:hover,:focus-visible){color:var(--brand-ink)}
.wp-page{min-height:55vh}
.wp-page h1{font-size:clamp(36px,5vw,70px);letter-spacing:-.04em}
/* Shared, viewport-wide separators on every internal view, including archives. */
.ml-internal-page>.header{border-bottom:1px solid var(--brand-frame)}
.ml-internal-page>.footer{border-top:1px solid var(--brand-frame)}
/* Preserve the existing hover travel for links to sections, including on another page. */
a[href*="#"]:not([href$="#"]) svg:has(> use:is([href="#section-arrow"],[href="#internal-arrow"])){
 transition:transform .2s;
}
a[href^="#"]:hover svg:has(> use[href="#section-arrow"]){transform:translateY(2px)}
a[href*="#"]:hover svg:has(> use[href="#internal-arrow"]){transform:translate(2px,2px)}
@media(prefers-reduced-motion:reduce){
 a[href*="#"]:not([href$="#"]) svg:has(> use:is([href="#section-arrow"],[href="#internal-arrow"])){transition:none;transform:none}
}
/* Six text links and the native contact button share one responsive menu. */
@media(max-width:1440px){
 .header nav{display:none;position:absolute;top:100%;left:0;right:0;padding:24px;max-height:calc(100dvh - 100%);overflow-y:auto;background:var(--brand-panel);border-bottom:1px solid var(--brand-frame)}
 .header nav.open{display:block}
 .header .menu-toggle{display:flex;flex-direction:column;justify-content:center;gap:6px;flex-shrink:0;width:44px;height:44px;border:0;background:transparent;padding:10px;cursor:pointer}
 .header .menu-toggle span{display:block;height:2px;width:24px;background:var(--brand-soft)}
 .header .primary-menu{width:100%;flex-direction:column;align-items:stretch;gap:0}
 .header .primary-menu>li>a{padding:10px 0}
 .header .primary-menu>.menu-item-contact{margin:14px 0 0}
}

/* Reserve the shared header height for fragment links and keyboard focus. */
html {
  --ml-header-height: 108px;
  --ml-toolbar-offset: 0px;
  --ml-header-bottom: calc(var(--ml-header-height) + var(--ml-toolbar-offset));
  scroll-padding-top: calc(var(--ml-header-bottom) + 12px);
}
@media (max-width: 760px) {
  html { --ml-header-height: 88px; }
}
@media (min-width: 601px) {
  html:has(body.admin-bar) {
    --ml-toolbar-offset: var(--wp-admin--admin-bar--height, 32px);
  }
}
body > .header {
  position: sticky;
  top: var(--ml-toolbar-offset);
  height: var(--ml-header-height);
}
body > .header.is-stuck {
  border-bottom: 1px solid var(--brand-frame);
  border-bottom-color: color-mix(in srgb, var(--brand-frame) 75%, white);
}
@media (max-width: 1440px) {
  body.admin-bar .header nav {
    max-height: calc(100dvh - var(--ml-header-bottom));
  }
}

/* Keep the lettering in the shared logo readable beside the primary menu. */
body > .header .header-inner > .brand {
  width: clamp(215px, 23vw, 250px);
  max-width: calc(100% - 64px);
}

/* Share the tracks across section headings while retaining their individual stacking breakpoints. */
#main {
  --section-heading-columns: minmax(0, 7fr) minmax(0, 3fr);
}
.office-page #main {
  --section-heading-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 761px) {
  #main :is(.ws-section-heading:has(> p), .section-heading:has(> p), .ai-heading,
            .meta-audiences-heading, .person-elsewhere .person-section-heading) {
    display: grid;
    grid-template-columns: var(--section-heading-columns);
  }
  #main :is(.ws-section-heading, .section-heading, .meta-audiences-heading) > p {
    width: 100%;
    max-width: none;
  }
  .home .ai-intro { text-align: right; }
}

@media (min-width: 821px) {
  #main :is(.about-people-heading, .about-offices-heading, .about-team-intro) {
    display: grid;
    grid-template-columns: var(--section-heading-columns);
  }
  #main :is(.about-people-heading, .about-offices-heading, .about-team-intro) > p {
    width: 100%;
    max-width: none;
  }
}

@media (min-width: 651px) {
  #main .ai-signals-heading {
    display: grid;
    grid-template-columns: var(--section-heading-columns);
  }
}

@media (min-width: 701px) {
  #main :is(.pf-intro-grid, .pf-project-lead) { grid-template-columns: var(--section-heading-columns); }
  #main .pf-intro-grid > p { width: 100%; max-width: none; }
}

@media (min-width: 1051px) {
  #main .blog-heading:has(> p) {
    display: grid;
    grid-template-columns: var(--section-heading-columns);
  }
  #main .blog-heading > p { max-width: none; }
}

/* Give these longer subtitles a full row before the narrower tablet track wraps to four lines. */
@media (min-width: 761px) and (max-width: 900px) {
  #main .ws-section-heading.ws-heading-stack-tablet {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
  }
  #main .ws-section-heading.ws-heading-stack-tablet > p {
    text-align: start;
    justify-self: start;
  }
}
