/* Production responsive audit patch
   Final layer: fixes mobile hamburger, tablet/mobile navigation, search overlay, footer stacking and common overflow conflicts. */

html, body { max-width: 100%; overflow-x: hidden; }
* { box-sizing: border-box; }
img, video, iframe, object, embed { max-width: 100%; height: auto; }

.header { z-index: 100000; }
.header .pagewrap { position: relative; }
.hamburger_menu { cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; appearance: none; }
.hamburger_menu:focus-visible,
.searchicon:focus-visible,
.close_search:focus-visible,
.main_nav a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.active_search { z-index: 100020; }
.active_search .pagewrap { position: relative; }
.search_results { max-height: calc(100vh - 120px); overflow-y: auto; }

@media screen and (min-width: 1131px) {
  body.menu-open { overflow: auto; }
  .hamburger_menu { display: none !important; }
  .header .nav_container {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    z-index: auto !important;
  }
  .header .main_nav { display: block !important; }
}

@media screen and (max-width: 1130px) {
  body.menu-open { overflow: hidden; }

  .header,
  body.home .header.fixed,
  body.home .header.smaller,
  body:not(.home) .header {
    height: 86px !important;
    min-height: 86px !important;
  }

  .header .pagewrap,
  body.home .header .pagewrap,
  body:not(.home) .header .pagewrap {
    width: auto !important;
    max-width: calc(100% - 34px) !important;
    height: 86px !important;
    min-height: 86px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .header .logo_small,
  .header .logo_large,
  body.home .header .logo_small,
  body.home .header .logo_large,
  body:not(.home) .header .logo_small,
  body:not(.home) .header .logo_large {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 22px !important;
    width: 128px !important;
    max-width: 128px !important;
    z-index: 100006 !important;
  }

  .header .logo_small img,
  .header .logo_large img,
  .header img.logo {
    width: 128px !important;
    max-width: 128px !important;
    height: auto !important;
  }

  .header .hamburger_menu,
  body.home .header .hamburger_menu,
  body:not(.home) .header .hamburger_menu {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    right: 0 !important;
    top: 19px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 34px !important;
    line-height: 1 !important;
    color: #13357a !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    z-index: 100030 !important;
  }

  body.home .header:not(.smaller):not(.white) .hamburger_menu { color: #fff !important; }
  body.menu-open .header .hamburger_menu { color: #fff !important; position: fixed !important; right: 17px !important; top: 19px !important; }

  .header .searchbox,
  body.home .header .searchbox,
  body:not(.home) .header .searchbox {
    position: absolute !important;
    top: 24px !important;
    right: 60px !important;
    width: 220px !important;
    max-width: calc(100% - 220px) !important;
    z-index: 100002 !important;
  }

  .header .searchinput { width: 175px !important; max-width: 100% !important; }

  .header .nav_container,
  body.home .header .nav_container,
  body:not(.home) .header .nav_container,
  html body.home .header.smaller .nav_container,
  html body.front-page .header.smaller .nav_container {
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateX(100%) !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 96px 28px 40px !important;
    background: #13357a !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transition: transform .28s ease, opacity .2s ease, visibility .2s ease !important;
    z-index: 100020 !important;
  }

  .header .nav_container.on,
  body.home .header .nav_container.on,
  body:not(.home) .header .nav_container.on,
  html body.home .header.smaller .nav_container.on,
  html body.front-page .header.smaller .nav_container.on {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
  }

  .header .nav_container .main_nav,
  .header .nav_container .main_nav > li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
  }

  .header .nav_container .main_nav > li > a,
  .header.white .nav_container .main_nav > li > a {
    display: block !important;
    color: #fff !important;
    font-size: 20px !important;
    line-height: 1.35 !important;
    padding: 13px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.16) !important;
    white-space: normal !important;
  }

  .header .nav_container .sub-menu,
  .header .nav_container .sub_nav {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 6px 0 8px 16px !important;
    margin: 0 !important;
    background: rgba(255,255,255,.08) !important;
    box-shadow: none !important;
  }

  .header .nav_container .sub-menu li,
  .header .nav_container .sub_nav li { display: block !important; float: none !important; width: 100% !important; }

  .header .nav_container .sub-menu a,
  .header .nav_container .sub_nav a,
  .header.white .nav_container .sub-menu a,
  .header.white .nav_container .sub_nav a {
    display: block !important;
    color: #fff !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    padding: 9px 0 !important;
    white-space: normal !important;
  }
}

@media screen and (max-width: 900px) {
  .header .searchbox,
  body.home .header .searchbox,
  body:not(.home) .header .searchbox { display: none !important; }

  .active_search .pagewrap { width: auto !important; max-width: calc(100% - 34px) !important; }
  .active_search input.real_search_input { width: calc(100% - 90px) !important; }
}

@media screen and (max-width: 560px) {
  .header,
  body.home .header.fixed,
  body.home .header.smaller,
  body:not(.home) .header { height: 78px !important; min-height: 78px !important; }

  .header .pagewrap,
  body.home .header .pagewrap,
  body:not(.home) .header .pagewrap { height: 78px !important; min-height: 78px !important; max-width: calc(100% - 28px) !important; }

  .header .logo_small,
  .header .logo_large,
  body.home .header .logo_small,
  body.home .header .logo_large,
  body:not(.home) .header .logo_small,
  body:not(.home) .header .logo_large { top: 21px !important; width: 116px !important; max-width: 116px !important; }

  .header .logo_small img,
  .header .logo_large img,
  .header img.logo { width: 116px !important; max-width: 116px !important; }

  .header .hamburger_menu,
  body.home .header .hamburger_menu,
  body:not(.home) .header .hamburger_menu { top: 15px !important; }
  body.menu-open .header .hamburger_menu { right: 14px !important; top: 15px !important; }
  .header .nav_container { padding: 86px 22px 34px !important; }
}

/* Footer production stacking */
@media screen and (max-width: 1180px) {
  footer.mccann-footer-exact .footer_body { padding-left: 0 !important; padding-right: 0 !important; }
  footer.mccann-footer-exact .footer_exact_wrap {
    width: auto !important;
    max-width: calc(100% - 48px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media screen and (max-width: 900px) {
  footer.mccann-footer-exact .footer_exact_wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 28px 38px !important;
    max-width: calc(100% - 34px) !important;
  }
  footer.mccann-footer-exact .footer_brand_col,
  footer.mccann-footer-exact .footer_nav_col,
  footer.mccann-footer-exact .footer_address_col,
  footer.mccann-footer-exact .footer_socials,
  footer.mccann-footer-exact .footer_credit {
    position: static !important;
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: start !important;
    align-self: start !important;
    width: auto !important;
    min-width: 0 !important;
    text-align: left !important;
  }
}

@media screen and (max-width: 560px) {
  footer.mccann-footer-exact .footer_exact_wrap {
    grid-template-columns: 1fr !important;
    max-width: calc(100% - 28px) !important;
    gap: 20px !important;
  }
}

/* v2 mobile footer and home intro hardening
   Fixes footer clipping/overlap on small screens and removes ugly justified text gaps. */
@media screen and (max-width: 700px) {
  html, body {
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  html body .pagewrap,
  html body .narrowwrap {
    max-width: calc(100vw - 32px) !important;
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  html body.home section:not(.banner):not(.blueimgbg),
  html body.front-page section:not(.banner):not(.blueimgbg) {
    padding-top: 34px !important;
    padding-bottom: 38px !important;
    overflow: visible !important;
  }

  html body.home .narrowwrap,
  html body.front-page .narrowwrap {
    float: none !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body.home .narrowwrap h1,
  html body.front-page .narrowwrap h1 {
    font-size: 30px !important;
    line-height: 1.12 !important;
    margin: 0 0 14px !important;
    text-align: left !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }

  html body.home .narrowwrap p,
  html body.front-page .narrowwrap p,
  html body.home .narrowwrap p.intro,
  html body.front-page .narrowwrap p.intro {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    font-size: 17px !important;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    text-align: left !important;
    text-align-last: left !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }

  html body.home .narrowwrap p.intro,
  html body.front-page .narrowwrap p.intro {
    font-size: 21px !important;
    line-height: 1.35 !important;
  }

  html body.home .narrowwrap .btn,
  html body.front-page .narrowwrap .btn {
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 18px 0 0 !important;
  }

  html body footer.mccann-footer-exact,
  html body .mccann-footer-exact,
  html body .mccann-footer-exact .footer_body {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    clear: both !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html body .mccann-footer-exact .footer_body {
    padding: 28px 0 26px !important;
  }

  html body footer.mccann-footer-exact .footer_exact_wrap,
  html body .mccann-footer-exact .footer_exact_wrap,
  html body:not(.home) footer.mccann-footer-exact .pagewrap,
  html body.home footer.mccann-footer-exact .pagewrap,
  html body.front-page footer.mccann-footer-exact .pagewrap {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    width: auto !important;
    max-width: calc(100vw - 40px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  html body .mccann-footer-exact .footer_exact_col,
  html body .mccann-footer-exact .footer_brand_col,
  html body .mccann-footer-exact .footer_nav_col,
  html body .mccann-footer-exact .footer_address_col,
  html body .mccann-footer-exact .footer_socials,
  html body .mccann-footer-exact .footer_credit {
    display: block !important;
    float: none !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 0 18px 0 !important;
    padding: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    text-align: left !important;
    white-space: normal !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  html body .mccann-footer-exact .footer_logo_link,
  html body .mccann-footer-exact .footer_logo {
    width: 150px !important;
    max-width: 150px !important;
  }

  html body .mccann-footer-exact .footnav,
  html body .mccann-footer-exact .footnav li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  html body .mccann-footer-exact .footnav a,
  html body .mccann-footer-exact .footer_exact_col,
  html body .mccann-footer-exact .footer_address_col {
    font-size: 15px !important;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    overflow-wrap: break-word !important;
  }

  html body .mccann-footer-exact .footer_socials {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    align-items: center !important;
  }

  html body .mccann-footer-exact .footer_credit,
  html body .mccann-footer-exact .footer_legal_links {
    font-size: 12px !important;
    line-height: 1.35 !important;
    margin-bottom: 0 !important;
  }
}

/* v3 header separation and conflict-prevention layer
   Home and internal headers now have explicit classes from PHP. Keep the designs separate,
   but force mobile behaviour to use one safe menu system so inherited desktop rules cannot collide. */
.mccann-site-header.mccann-home-header { --mccann-header-mobile-logo: 116px; }
.mccann-site-header.mccann-inner-header { --mccann-header-mobile-logo: 116px; }

body.mccann-front-template .mccann-site-header.mccann-inner-header,
body.mccann-internal-template .mccann-site-header.mccann-home-header {
  display: none !important;
}

@media screen and (max-width: 1130px) {
  html body .mccann-site-header.mccann-home-header,
  html body .mccann-site-header.mccann-inner-header {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 86px !important;
    min-height: 86px !important;
    overflow: visible !important;
  }

  html body.mccann-front-template .mccann-site-header.mccann-home-header:not(.white):not(.smaller) {
    background: transparent !important;
  }

  html body.mccann-front-template .mccann-site-header.mccann-home-header.white,
  html body.mccann-front-template .mccann-site-header.mccann-home-header.smaller,
  html body.mccann-internal-template .mccann-site-header.mccann-inner-header {
    background: #fff !important;
  }

  html body .mccann-site-header > .pagewrap {
    position: relative !important;
    height: 86px !important;
    min-height: 86px !important;
    max-width: calc(100% - 34px) !important;
    width: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  html body .mccann-site-header .logo_small,
  html body .mccann-site-header .logo_large {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 22px !important;
    width: var(--mccann-header-mobile-logo) !important;
    max-width: var(--mccann-header-mobile-logo) !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 100006 !important;
  }

  html body .mccann-site-header .logo_small img,
  html body .mccann-site-header .logo_large img,
  html body .mccann-site-header img.logo {
    display: block !important;
    width: var(--mccann-header-mobile-logo) !important;
    max-width: var(--mccann-header-mobile-logo) !important;
    height: auto !important;
  }

  html body .mccann-site-header .hamburger_menu {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    right: 0 !important;
    top: 19px !important;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    color: #13357a !important;
    z-index: 100030 !important;
  }

  html body.mccann-front-template .mccann-site-header.mccann-home-header:not(.white):not(.smaller) .hamburger_menu {
    color: #fff !important;
  }

  html body.menu-open .mccann-site-header .hamburger_menu {
    position: fixed !important;
    color: #fff !important;
  }

  html body .mccann-site-header .nav_container {
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(100%) !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 96px 28px 40px !important;
    background: #13357a !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 100020 !important;
  }

  html body .mccann-site-header .nav_container.on {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
  }

  html body .mccann-site-header .nav_container .main_nav,
  html body .mccann-site-header .nav_container .main_nav > li,
  html body .mccann-site-header .nav_container .sub-menu,
  html body .mccann-site-header .nav_container .sub_nav {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media screen and (max-width: 700px) {
  html body.mccann-front-template .home-intro-section,
  html body.mccann-front-template .home-intro-section .home-intro-pagewrap,
  html body.mccann-front-template .home-intro-section .home-intro-wrap {
    float: none !important;
    clear: both !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    overflow: visible !important;
    max-width: calc(100vw - 32px) !important;
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  html body.mccann-front-template .home-intro-section {
    padding-top: 34px !important;
    padding-bottom: 38px !important;
  }

  html body.mccann-front-template .home-intro-section p,
  html body.mccann-front-template .home-intro-section p.intro {
    text-align: left !important;
    text-align-last: left !important;
    word-spacing: 0 !important;
    letter-spacing: 0 !important;
    overflow-wrap: break-word !important;
  }
}

@media screen and (max-width: 560px) {
  html body .mccann-site-header.mccann-home-header,
  html body .mccann-site-header.mccann-inner-header,
  html body .mccann-site-header > .pagewrap {
    height: 78px !important;
    min-height: 78px !important;
  }

  html body .mccann-site-header .logo_small,
  html body .mccann-site-header .logo_large {
    top: 21px !important;
  }

  html body .mccann-site-header .hamburger_menu {
    top: 15px !important;
  }

  html body.menu-open .mccann-site-header .hamburger_menu {
    right: 14px !important;
    top: 15px !important;
  }
}

/* v4 prevention layer
   Home header is no longer sticky/fixed. It stays visually separate from the internal header,
   but it does not shrink or remain stuck on scroll. Sector cards are temporarily non-clickable. */
html body.mccann-front-template .mccann-site-header,
html body.home .mccann-site-header,
html body.mccann-front-template .mccann-site-header.fixed,
html body.home .mccann-site-header.fixed,
html body.mccann-front-template .mccann-site-header.smaller,
html body.home .mccann-site-header.smaller {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  width: 100% !important;
  height: 174px !important;
  min-height: 174px !important;
  background: transparent !important;
  border-bottom: 0 !important;
  transform: none !important;
}

html body.mccann-front-template .mccann-site-header.smaller .pagewrap,
html body.home .mccann-site-header.smaller .pagewrap {
  height: 174px !important;
  min-height: 174px !important;
}

html body.mccann-front-template .mccann-site-header.smaller .logo_large,
html body.home .mccann-site-header.smaller .logo_large {
  display: block !important;
}

html body.mccann-front-template .mccann-site-header.smaller .logo_small,
html body.home .mccann-site-header.smaller .logo_small {
  display: none !important;
}

html body.mccann-front-template .mccann-site-header.smaller .main_nav li a,
html body.home .mccann-site-header.smaller .main_nav li a,
html body.mccann-front-template .mccann-site-header.smaller .searchbox,
html body.home .mccann-site-header.smaller .searchbox {
  color: #fff !important;
}

html body.mccann-front-template .mccann-site-header.smaller .searchbox,
html body.home .mccann-site-header.smaller .searchbox {
  top: 82px !important;
}

@media screen and (max-width: 1130px) {
  html body.mccann-front-template .mccann-site-header,
  html body.home .mccann-site-header,
  html body.mccann-front-template .mccann-site-header.fixed,
  html body.home .mccann-site-header.fixed,
  html body.mccann-front-template .mccann-site-header.smaller,
  html body.home .mccann-site-header.smaller {
    position: absolute !important;
    height: 86px !important;
    min-height: 86px !important;
  }

  html body.mccann-front-template.menu-open .mccann-site-header,
  html body.home.menu-open .mccann-site-header {
    position: static !important;
  }
}

/* Temporary sector-page protection: keep filters usable, but stop project/card clicks until the detail pages have enough content. */
html body.page-template-page-sectors .sectors-landing .sector-gridbox,
html body.post-type-archive-mccann_sector .sectors-landing .sector-gridbox {
  pointer-events: none !important;
  cursor: default !important;
}

html body.page-template-page-sectors .sectors-landing .sector-filter-nav,
html body.page-template-page-sectors .sectors-landing .sector-filter-nav *,
html body.post-type-archive-mccann_sector .sectors-landing .sector-filter-nav,
html body.post-type-archive-mccann_sector .sectors-landing .sector-filter-nav * {
  pointer-events: auto !important;
  cursor: pointer !important;
}
