/* Conficore navigation — sticky bar, mega menu, search, mobile drawer.
   Pairs with src/design-system/conficore-nav.jsx. */

.cf-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.cf-eyebrow {
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  color: var(--accent-text-on-light);
}

/* --- Sticky bar ---------------------------------------------------------- */
.cf-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow var(--dur-mid) var(--ease-out),
              background-color var(--dur-mid) var(--ease-out);
}
.cf-nav.is-scrolled {
  box-shadow: 0 6px 28px rgba(20, 24, 26, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.cf-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  max-width: var(--container-max);
  margin: 0 auto;
  transition: padding var(--dur-mid) var(--ease-out);
}
.cf-nav.is-scrolled .cf-nav__bar { padding-top: 10px; padding-bottom: 10px; }

.cf-nav__logo img { transition: height var(--dur-mid) var(--ease-out); }
.cf-nav.is-scrolled .cf-nav__logo img { height: 38px !important; }

/* --- Desktop links ------------------------------------------------------- */
.cf-nav__links { display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); }

.cf-nav__link {
  position: relative;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-900);
  text-decoration: none;
  padding: 8px 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
/* Underline grows from the left rather than fading in. */
.cf-nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 2px;
  height: 2px; width: 100%;
  background: var(--brand-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-out);
}
.cf-nav__link:hover::after,
.cf-nav__link.is-active::after { transform: scaleX(1); }

.cf-nav__trigger { display: inline-flex; align-items: center; gap: 6px; }
.cf-nav__chev { font-size: 10px; transition: transform var(--dur-fast) var(--ease-out); }
.cf-nav__trigger[aria-expanded="true"] .cf-nav__chev { transform: rotate(180deg); }

/* --- Actions ------------------------------------------------------------- */
.cf-nav__actions { display: flex; align-items: center; gap: 12px; }

.cf-nav__icon {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-900);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.cf-nav__icon:hover { background: var(--paper-50); border-color: var(--border-strong); }

.cf-nav__burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.cf-burger { display: block; width: 24px; height: 16px; position: relative; }
.cf-burger i {
  position: absolute; left: 0; height: 2px; width: 100%;
  background: var(--ink-900); border-radius: 2px;
  transition: transform var(--dur-mid) var(--ease-out), opacity var(--dur-fast) linear;
}
.cf-burger i:nth-child(1) { top: 0; }
.cf-burger i:nth-child(2) { top: 7px; }
.cf-burger i:nth-child(3) { top: 14px; }
.cf-burger.is-x i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cf-burger.is-x i:nth-child(2) { opacity: 0; }
.cf-burger.is-x i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Mega menu ----------------------------------------------------------- */
.cf-mega {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 24px 48px rgba(20, 24, 26, 0.12);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out);
}
.cf-mega.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.cf-mega__inner {
  display: grid;
  grid-template-columns: 0.8fr 2.4fr;
  gap: 56px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 64px) 52px;
}
.cf-mega__blurb {
  margin: 14px 0 20px;
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  font-size: var(--text-body-sm);
}
.cf-mega__all {
  font-weight: var(--weight-semibold);
  color: var(--ink-900);
  text-decoration: none;
  border-bottom: 2px solid var(--brand-yellow);
  padding-bottom: 2px;
}
.cf-mega__inner--narrow { grid-template-columns: 0.8fr 1.4fr; }

.cf-mega__cols {
  display: grid;
  gap: 32px;
  list-style: none; margin: 0; padding: 0;
}
.cf-mega__cols--4 { grid-template-columns: repeat(4, 1fr); }
.cf-mega__cols--3 { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
.cf-mega__cols--2 { grid-template-columns: repeat(2, 1fr); }

.cf-mega__grouptitle {
  color: var(--ink-900);
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-sm);
  margin-bottom: 12px;
}

/* Division tags on the Industries panel — the cross-sell signal. */
.cf-mega__tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none; margin: 0; padding: 0;
}
.cf-tag {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  color: var(--accent-text-on-light);
  background: rgba(228, 226, 58, 0.16);
  border: 1px solid rgba(228, 226, 58, 0.5);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.cf-mega__title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  color: var(--ink-900);
  text-decoration: none;
  margin-bottom: 8px;
}
.cf-mega__title:hover { color: var(--accent-text-on-light); }
.cf-mega__title--sm { font-size: var(--text-body-sm); font-weight: var(--weight-semibold); font-family: var(--font-body); }
.cf-mega__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 14px;
}
.cf-mega__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.cf-mega__list a {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), padding-left var(--dur-fast) var(--ease-out);
}
.cf-mega__list a:hover { color: var(--ink-900); padding-left: 5px; }

/* --- Search -------------------------------------------------------------- */
.cf-search {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 18px 36px rgba(20, 24, 26, 0.1);
}
.cf-search__form {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 20px clamp(20px, 4vw, 64px);
  color: var(--text-muted);
}
.cf-search__input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: var(--text-body-lg);
  font-family: inherit;
  color: var(--ink-900);
  padding: 10px 0;
}
.cf-search__input:focus { outline: none; }
.cf-search__form:focus-within { box-shadow: inset 0 -2px 0 var(--brand-yellow); }
.cf-search__close {
  background: none; border: 0; cursor: pointer;
  font-size: 18px; color: var(--text-secondary); padding: 6px;
}

/* --- Mobile drawer ------------------------------------------------------- */
.cf-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-height-sm) 0 0;
  background: var(--surface-page);
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  z-index: 99;
}
.cf-drawer__link, .cf-drawer__acc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 0;
  font-size: 1.125rem;
  font-weight: var(--weight-medium);
  color: var(--ink-900);
  text-decoration: none;
  border: 0; border-bottom: 1px solid var(--border-subtle);
  background: none; cursor: pointer; font-family: inherit;
  text-align: left;
}
.cf-drawer__sub { list-style: none; margin: 0; padding: 4px 0 12px 16px; display: grid; gap: 4px; }
.cf-drawer__sub a {
  display: block; padding: 12px 0;
  color: var(--text-secondary); text-decoration: none;
  font-size: 1rem;
}
.cf-drawer__cta { margin-top: 28px; }
.cf-drawer__cta > * { width: 100%; }

/* --- Sticky mobile CTA pills --------------------------------------------- */
.cf-mcta {
  display: block;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-sm);
  text-decoration: none;
  text-align: center;
}
.cf-mcta--accent { background: var(--brand-yellow); color: var(--ink-900); }
.cf-mcta--ghost  { background: transparent; color: var(--ink-900); border: 1px solid var(--border-strong); }

/* --- Breakpoints --------------------------------------------------------- */
/* --- Footer links (Blog/Careers land here after the nav demotion) -------- */
.cf-footer__link {
  font-size: var(--text-body-sm);
  color: var(--slate-300);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.cf-footer__link:hover { color: var(--paper-0); text-decoration: underline; }
.cf-footer__link:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 3px; }

@media (max-width: 1080px) {
  .cf-mega__inner, .cf-mega__inner--narrow { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .cf-mega__cols--4, .cf-mega__cols--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .cf-footer__grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 900px) {
  .cf-nav__links { display: none; }
  .cf-nav__burger { display: block; }
  .cf-nav__cta { display: none; }   /* lives in the drawer + sticky mobile CTA */
  .cf-drawer { display: none; }
  .cf-drawer.is-open { display: block; }
  .cf-mega { display: none; }        /* drawer accordion replaces it */
  .cf-nav__bar { padding-top: 12px; padding-bottom: 12px; }
  .cf-nav__logo img { height: 40px !important; }
}

@media (max-width: 640px) {
  .cf-footer__grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 560px) {
  .cf-mega__cols--4, .cf-mega__cols--3, .cf-mega__cols--2 { grid-template-columns: 1fr; }
  .cf-search__input { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-nav__link::after,
  .cf-mega,
  .cf-burger i { transition: none !important; }
}

/* --- Industries Served chips (business pages) ---------------------------- */
.cf-industry-chip {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-page);
  color: var(--ink-900);
  text-decoration: none;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.cf-industry-chip:hover {
  border-color: var(--ink-900);
  background: var(--brand-yellow);
  transform: translateY(-2px);
}

/* --- Contact page -------------------------------------------------------- */
.cf-field:focus {
  outline: none;
  border-color: var(--ink-900);
  box-shadow: 0 0 0 3px rgba(228, 226, 58, 0.45);
}
.cf-field:focus-visible { outline: none; }

.cf-submit {
  padding: 15px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: var(--ink-900);
  font-family: inherit;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.cf-submit:hover:not(:disabled) { transform: translateY(-2px); background: var(--brand-yellow-dark); color: var(--paper-0); }
.cf-submit:disabled { opacity: 0.6; cursor: default; }

.cf-contact-link {
  color: var(--ink-900);
  text-decoration: none;
  border-bottom: 1px solid var(--brand-yellow);
  padding-bottom: 1px;
}
.cf-contact-link:hover { border-bottom-color: var(--ink-900); }

@media (max-width: 900px) {
  /* Form column stacks under the intro. */
  #quote > div { grid-template-columns: 1fr !important; gap: 36px !important; }
}
@media (max-width: 560px) {
  #quote form > div[style*="1fr 1fr"] { grid-template-columns: 1fr !important; }
  .cf-submit { width: 100%; }
}

/* --- Offices + map ------------------------------------------------------- */
.cf-office-solo {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--grid-gap);
  align-items: stretch;
}
.cf-map {
  width: 100%;
  min-height: 340px;
  height: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: block;
  /* Google's embed is a light map; soften it into the palette slightly. */
  filter: saturate(0.9);
}
.cf-directions {
  display: inline-block;
  margin-top: 20px;
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-sm);
  color: var(--ink-900);
  text-decoration: none;
  border-bottom: 2px solid var(--brand-yellow);
  padding-bottom: 2px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.cf-directions:hover { border-bottom-color: var(--ink-900); }

@media (max-width: 900px) {
  .cf-office-solo { grid-template-columns: 1fr; }
  .cf-map { min-height: 300px; }
}

/* --- Search page --------------------------------------------------------- */
.cf-searchpage__form { display: flex; gap: 12px; max-width: 680px; }
.cf-searchpage__form .cf-field { flex: 1; }
@media (max-width: 560px) {
  .cf-searchpage__form { flex-direction: column; }
}

/* --- Contact banner ------------------------------------------------------
   Light artwork with designed negative space on the right, so the text sits
   there in ink rather than white-on-dark like the other heroes. */
.cf-banner {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--paper-0);
}
.cf-banner__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Clears the collage on the left, solid enough on the right to guarantee
     contrast even where the crop shifts. */
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 24%,
    rgba(255,255,255,0.55) 42%,
    rgba(255,255,255,0.92) 56%,
    rgba(255,255,255,0.97) 100%);
}
.cf-banner__content {
  position: relative;
  z-index: 2;
  width: min(46%, 560px);
  padding: 64px clamp(20px, 4vw, 64px) 64px 0;
  margin-right: clamp(20px, 4vw, 64px);
}

@media (max-width: 900px) {
  /* The cover-crop loses the right-hand clean zone, so stack instead:
     artwork on top, copy underneath on a near-solid base. */
  .cf-banner {
    min-height: 0;
    display: block;
    padding-top: 46vw;          /* room for the artwork above the text */
  }
  .cf-banner__veil {
    background: linear-gradient(180deg,
      rgba(255,255,255,0) 30%,
      rgba(255,255,255,0.90) 52%,
      rgba(255,255,255,0.98) 64%,
      var(--paper-0) 100%);
  }
  .cf-banner__content {
    width: auto;
    margin-right: 0;
    padding: 0 20px 48px;
  }
}

/* --- About brand film banner --------------------------------------------- */
.cf-film { background: var(--surface-page); }
.cf-film__stage {
  position: relative;
  background: var(--ink-900);
  /* width:100% is load-bearing. With aspect-ratio and max-height together, once
     the height hits the cap the aspect ratio back-computes the WIDTH from it
     (799px -> 1421px) instead of filling the parent, leaving a wide band of
     dead space beside the film. Pinning the width keeps the box full-bleed and
     lets the letterbox fall inside it against the ink background. */
  width: 100%;
  /* Explicit height, NOT aspect-ratio + max-height.
     Those two disagree on a grid container: aspect-ratio sized the row track
     from the full width (1071px) while max-height clamped only the container
     (886px), so overflow:hidden quietly cropped 185px off the bottom of the
     film — taking the closing logo card's strapline with it.
     min(82vh, 56.25vw) is the same intent stated once: 16:9 of the width,
     capped so the banner can't swallow the viewport. */
  height: min(82vh, 56.25vw);
  /* Floor the height so the cover crop can't run away on short windows.
     Without it a 1920x600 window gives a 54% crop, which eats into the logo
     lockup. Capped by 56.25vw so this never exceeds the film's own 16:9
     height on narrow screens. */
  min-height: min(34vw, 56.25vw);
  /* Deliberately not grid. An auto row track sizes to the video's own 16:9
     height (1071px) no matter how tall the container is, so the picture
     overflowed and got clipped. Absolute positioning below pins the video to
     the stage box exactly. */
  overflow: hidden;
}
.cf-film__media {
  /* Sized by max-* rather than width/height 100%.
     Under place-items:center the grid item doesn't stretch, so height:100%
     failed to resolve and the video laid out at its own 16:9 height (1072px)
     inside an 886px stage — overflow:hidden then cropped the top and bottom,
     clipping the closing logo card's strapline. Letting the box shrink to fit
     both axes letterboxes it correctly with no crop. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* cover — the film fills the band edge to edge with no letterbox bars.
     That crops top and bottom, so the crop is aimed rather than centred:
     measured on the closing logo card, the lockup occupies 32.6%-80.6% of the
     frame height, leaving 32.6% of headroom above it and only 19.4% below.
     object-position 65% takes ~65% of the excess off the top, where there is
     room, and ~35% off the bottom, protecting the
     'Logistics | Manufacturing | Agriculture | Rural Real Estate' strapline
     even on wide, short viewports where the crop is largest. */
  object-fit: cover;
  object-position: center 65%;
  display: block;
}
.cf-film__replay {
  position: absolute;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(20, 24, 26, 0.7);
  color: #fff;
  font-family: inherit;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.cf-film__replay:hover { background: rgba(20, 24, 26, 0.9); }

.cf-film__title {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 64px) 0;
}

@media (max-width: 720px) {
  /* site.css pads every <section> by 20px on small screens, which left the
     film inset instead of edge to edge. The banner is full-bleed by design. */
  .cf-film { padding-left: 0 !important; padding-right: 0 !important; }
  .cf-film__stage { max-height: none; }
}

/* --- Still-image page banner --------------------------------------------- */
/* The four vertical banners are posters, not photographs: each one carries its
   own headline, an icon row, and a caption strip baked into the pixels. They
   cannot be cropped — Logistics keeps its service strip along the bottom edge,
   Real Estate keeps the logo and "Land That Holds Value." near the top. Any
   fixed-height crop clips one or the other.

   They are also 3:2, while a desktop window under the nav is nearer 2:1, so at
   full-bleed width the banner ran ~1280px tall and its own caption strip fell
   below the fold.

   The artwork is now authored at the right ratio, so nothing is cropped
   anywhere — not here, not at build time. The four banners ship at 1774x887
   (exactly 2:1) and this rule is simply full width, natural height.

   That is the whole point of re-cutting the source: an earlier set arrived at
   3:2, which on a ~2:1 window forced a choice between a banner taller than the
   screen, a crop that clipped baked-in type, or side fill. Blurred fill
   averaged to a taupe smear (rgb(113,109,104)) and no solid could match either,
   since edge luminance across the four ran 0.05 to 0.73. Supplying 2:1 artwork
   removed the problem rather than trading it around.

   Keep any replacement at 2:1. The lossless PNG masters are outside the build
   at originals/banners-v2-png/, and the superseded 3:2 set is at
   originals/banners-uncropped/. */
.cf-imgbanner { background: var(--surface-page); }
/* Kept as a plain block. It exists so the caption on pages that show one (blog)
   stays below the image rather than beside it. */
.cf-imgbanner__stage { display: block; }
.cf-imgbanner__media {
  display: block;
  width: 100%;
  height: auto;
}
.cf-imgbanner__title {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 64px) 0;
}
@media (max-width: 720px) {
  /* site.css pads every <section> on small screens; the banner is full-bleed. */
  .cf-imgbanner { padding-left: 0 !important; padding-right: 0 !important; }
  .cf-imgbanner__title { padding-left: 20px; padding-right: 20px; }
}
