/**
 * Force homepage header (and footer) styles on all blog pages.
 * apcotex-blog-theme.css uses body.blog-template / body.single header
 * rules that shrink gap/font and diverge from assets/css/style.css.
 */

body.aptx-site-chrome {
  --color: #232323;
  --font: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", "Ubuntu", sans-serif;
  font-family: var(--font);
}

/* Site chrome header only */
body.aptx-site-chrome .wrapper > header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 99999 !important;
  background: #fff !important;
  box-shadow: 0 0 20px 1px rgba(51, 51, 51, 0.2) !important;
  transition: all 0.25s;
  padding: 0 !important;
}

/* Match homepage header .max (style.css) — undo blog-template padding overrides.
   Do NOT force display:flex on .max.block — that overrides site .block{display:none}
   on mobile and shows desktop + hamburger stacked (blog-only bug). */
body.aptx-site-chrome.blog-template .wrapper > header .max,
body.aptx-site-chrome.archive .wrapper > header .max,
body.aptx-site-chrome.search .wrapper > header .max,
body.aptx-site-chrome.single .wrapper > header .max,
body.aptx-site-chrome.aptx-insight-page .wrapper > header .max,
body.aptx-site-chrome .wrapper > header .max {
  gap: 20px !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-width: 0;
  max-width: 1600px;
  padding-left: calc(20px + 4vw) !important;
  padding-right: calc(20px + 4vw) !important;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Desktop only: show mega-menu row as flex (same as homepage style.css) */
@media (min-width: 1025px) {
  body.aptx-site-chrome .wrapper > header > .max.block {
    display: flex !important;
  }
  body.aptx-site-chrome .wrapper > header > .mobile-menu.none {
    display: none !important;
  }
}

/* Tablet/mobile: match homepage — hide desktop nav, show hamburger bar */
@media (max-width: 1024px) {
  body.aptx-site-chrome .wrapper > header > .max.block {
    display: none !important;
  }
  body.aptx-site-chrome .wrapper > header > .mobile-menu.none {
    display: block !important;
  }
  body.aptx-site-chrome .wrapper > header > .mobile-menu .max {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }
}

/* Match homepage nav gap 20px (not blog theme 10px / clamp) */
body.aptx-site-chrome.blog-template .wrapper > header > .max > ul,
body.aptx-site-chrome.archive .wrapper > header > .max > ul,
body.aptx-site-chrome.search .wrapper > header > .max > ul,
body.aptx-site-chrome.single .wrapper > header > .max > ul,
body.aptx-site-chrome.aptx-insight-page .wrapper > header > .max > ul,
body.aptx-site-chrome .wrapper > header > .max > ul {
  display: flex !important;
  gap: 20px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  min-width: 0;
  margin: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Match homepage link type — Source Sans Pro, site color, 30px pad */
body.aptx-site-chrome.blog-template .wrapper > header > .max > ul > li > a,
body.aptx-site-chrome.archive .wrapper > header > .max > ul > li > a,
body.aptx-site-chrome.search .wrapper > header > .max > ul > li > a,
body.aptx-site-chrome.single .wrapper > header > .max > ul > li > a,
body.aptx-site-chrome.aptx-insight-page .wrapper > header > .max > ul > li > a,
body.aptx-site-chrome .wrapper > header > .max > ul > li > a {
  color: var(--color) !important;
  font-family: var(--font) !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  position: relative !important;
  display: inline-block !important;
  padding: 30px 0 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

body.aptx-site-chrome .wrapper > header > .max > ul > li > a:after {
  content: "" !important;
  width: 0 !important;
  height: 2px !important;
  opacity: 1 !important;
  background: #C82127 !important;
  bottom: 0 !important;
  left: 0 !important;
  display: block !important;
  position: absolute !important;
  transition: all 0.2s !important;
  border: 0 !important;
}

body.aptx-site-chrome .wrapper > header > .max > ul > li > a:before {
  content: "" !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  border-bottom: solid 6px #C82127 !important;
  border-left: solid 6px transparent !important;
  border-right: solid 6px transparent !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 auto !important;
  display: block !important;
  position: absolute !important;
  transition: all 0.2s !important;
  background: transparent !important;
}

body.aptx-site-chrome .wrapper > header > .max > ul > li > a:hover:before {
  opacity: 1 !important;
}

body.aptx-site-chrome .wrapper > header > .max > ul > li > a:hover:after {
  width: 100% !important;
}

body.aptx-site-chrome .wrapper > header .header-logo {
  width: 200px !important;
  font-size: 0 !important;
  flex-shrink: 0;
}

body.aptx-site-chrome .wrapper > header .header-logo img {
  padding-bottom: 6px !important;
  width: auto !important;
  max-width: 100%;
  height: auto !important;
  border-radius: 0 !important;
}

/* Never treat article/card headers as the site nav */
body.aptx-site-chrome header.entry-header,
body.aptx-site-chrome .entry-header {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  z-index: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: none !important;
}

body.aptx-site-chrome .entry-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  position: static !important;
  padding: 0 !important;
}

body.aptx-site-chrome .entry-header ul a,
body.aptx-site-chrome .entry-header a {
  padding: 0 !important;
  text-transform: none !important;
  font-size: inherit !important;
}

body.aptx-site-chrome .entry-header ul a:before,
body.aptx-site-chrome .entry-header ul a:after {
  display: none !important;
  content: none !important;
}

/* Homepage footer chrome */
body.aptx-site-chrome .wrapper > footer {
  position: relative;
  z-index: 1;
  font-family: var(--font);
}

body.aptx-site-chrome .wrapper > footer,
body.aptx-site-chrome .wrapper > footer a,
body.aptx-site-chrome .wrapper > footer h4,
body.aptx-site-chrome .wrapper > footer h5,
body.aptx-site-chrome .wrapper > footer p,
body.aptx-site-chrome .wrapper > footer li {
  font-family: var(--font) !important;
}

/* Loader must not stick over the page if JS is slow */
body.aptx-site-chrome #loader.fade-out,
body.aptx-site-chrome #loader.is-done {
  display: none !important;
  pointer-events: none !important;
}

/* Room for fixed site header above blog hero / insight */
body.aptx-site-chrome .hero-common {
  margin-top: 71px;
}
body.aptx-site-chrome.aptx-insight-page .aptx-insight-hero {
  margin-top: 71px;
}
