/* Final authoritative desktop header + interior leader consistency fix. */
@media (min-width: 901px) {
  :root { --jmf-final-header-h: 82px; }

  html { scroll-padding-top: var(--jmf-final-header-h) !important; }
  html body { padding-top: var(--jmf-final-header-h) !important; }

  html body .jmf-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--jmf-final-header-h) !important;
    min-height: var(--jmf-final-header-h) !important;
    margin: 0 !important;
    padding: 0 28px !important;
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(7,31,67,.10) !important;
    box-shadow: 0 2px 10px rgba(7,31,67,.05) !important;
    overflow: visible !important;
    z-index: 100000 !important;
    box-sizing: border-box !important;
  }

  /* Logo and red rule are exactly the same width. */
  html body .jmf-logo-link {
    position: absolute !important;
    left: 28px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 270px !important;
    height: 64px !important;
    margin: 0 !important;
    padding: 0 0 7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    border: 0 !important;
    box-sizing: border-box !important;
  }
  html body .jmf-logo-link::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 2px !important;
    background: #d61f35 !important;
  }
  html body .jmf-header .jmf-logo {
    display: block !important;
    width: 270px !important;
    height: auto !important;
    max-width: 270px !important;
    max-height: 54px !important;
    object-fit: contain !important;
    object-position: left center !important;
    margin: 0 !important;
  }

  /* Navigation remains centered to the viewport, not the remaining space. */
  html body .jmf-nav {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    transform: translateX(-50%) !important;
    width: max-content !important;
    height: var(--jmf-final-header-h) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: clamp(22px, 2.4vw, 42px) !important;
    overflow: visible !important;
  }
  html body .jmf-nav-item { height: 100% !important; display: flex !important; align-items: stretch !important; }
  html body .jmf-nav-link {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    line-height: 1 !important;
  }
  html body .jmf-dropdown-menu { top: calc(var(--jmf-final-header-h) - 1px) !important; }

  /* Quote button is fully inside and vertically centered in the visible header. */
  html body .jmf-header-actions {
    position: absolute !important;
    right: 28px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }
  html body .jmf-quote {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    padding: 12px 22px !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
  }

  /* Remove every historical offset. The first leader touches the header. */
  html body > main,
  html body.interior-page > main,
  html body > main[style] {
    position: relative !important;
    top: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
  }
  html body.interior-page > main > :first-child,
  html body.interior-page > main > section:first-child,
  html body.interior-page > main > div:first-child,
  html body.interior-page .page-hero,
  html body.interior-page .products-hero,
  html body.interior-page .leadership-hero,
  html body.interior-page .contact-matched-hero,
  html body.interior-page .jmf-matched-interior-hero {
    top: auto !important;
    margin-top: 0 !important;
    border-top: 0 !important;
    transform: none !important;
  }

  /* Identical leader geometry on every interior page. */
  html body.interior-page > main > section:first-child {
    min-height: 360px !important;
    height: 360px !important;
    padding: 58px max(24px, calc((100vw - 1160px)/2)) 48px !important;
    display: flex !important;
    align-items: center !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  html body.interior-page > main > section:first-child > .container {
    width: 100% !important;
    max-width: 1160px !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  /* Use real project photography, not screenshots of the pages. */
  body.page-about > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.72)), url('lab.webp') !important;
  }
  body.page-leadership > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.70)), url('jmf-v118-home-hero-mosley-smaller-no-embedded-ticker.webp') !important;
    background-position: center 30% !important;
  }
  body.page-locations > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.72)), url('company-flag-ink.png') !important;
    background-position: center 42% !important;
  }
  body.page-products > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.68)), url('ink-dispensing-bottles-photo.jpg') !important;
    background-position: center 45% !important;
  }
  body.page-technology > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.67)), url('lab.webp') !important;
  }
  body.page-frymeasure > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.68)), url('fryspectro-photo.jpg') !important;
    background-position: center 48% !important;
  }
  body.page-training > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.68)), url('lab.webp') !important;
  }
  body.page-news > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.70)), url('announcement-ownership-letter.png') !important;
    background-position: center 34% !important;
  }
  body.page-contact > main > section:first-child {
    background-image: linear-gradient(90deg, rgba(3,28,60,.94), rgba(3,28,60,.72)), url('company-flag-ink.png') !important;
    background-position: center 42% !important;
  }
}

@media (min-width:901px) and (max-width:1320px) {
  html body .jmf-logo-link { left: 18px !important; width: 228px !important; }
  html body .jmf-header .jmf-logo { width: 228px !important; max-width: 228px !important; }
  html body .jmf-header-actions { right: 18px !important; }
  html body .jmf-nav { gap: 22px !important; }
  html body .jmf-nav-link { font-size: 14px !important; }
  html body .jmf-quote { padding: 11px 16px !important; font-size: 13px !important; }
}
