/* ── Universal Toughjobs Header — mirrors index.html exactly ──────────── */

:root {
  --ink: #0A0F1C;
  --navy: #002768;
  --red: #C8262A;
  --red-on-dark: #E8484C;
  --white: #FFFFFF;
  --accent: #C8262A;
  --accent-ink: #FFFFFF;
  --container: 1240px;
  --tj-divider-depth: 14px;
  --tj-header-height: 120px;
}

/* Two text colors for unstyled page and section headings. */
main h1 .tj-heading-primary,
main h2 .tj-heading-primary {
  color: var(--navy, #002768) !important;
  -webkit-text-fill-color: currentColor !important;
}

main h1 .tj-heading-accent,
main h2 .tj-heading-accent {
  color: var(--red, #C8262A) !important;
  -webkit-text-fill-color: currentColor !important;
}

main h1 .tj-heading-primary-on-dark,
main h2 .tj-heading-primary-on-dark {
  color: #FFFFFF !important;
  -webkit-text-fill-color: currentColor !important;
}

main h1 .tj-heading-accent-on-dark,
main h2 .tj-heading-accent-on-dark {
  color: var(--red-on-dark, #E8484C) !important;
  -webkit-text-fill-color: currentColor !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

header {
  background: var(--ink);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: all 0.3s ease;
  width: 100%;
}

.nav-container {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--tj-header-height);
  width: 100%;
  padding: 0 clamp(18px, 3vw, 32px);
  max-width: 100%;
}

/* Existing gauntlet artwork, pressed into the ink rather than a second logo. */
header::before,
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  pointer-events: none;
  background: url('assets/hand-lightening-small.webp') center / contain no-repeat;
  filter: grayscale(1) brightness(.65) drop-shadow(1px 1px 0 rgba(255,255,255,.35)) drop-shadow(-1px -1px 0 #000);
  opacity: .075;
  z-index: -1;
}
header::before {
  width: clamp(150px, 18vw, 260px);
  height: 100%;
  top: 0;
  left: 40%;
}
.nav-dropdown-menu::before {
  --mega-gauntlet: url('assets/hand-lightening-small.webp');
  inset: 0;
  /* Half-size impressions, staggered rather than centered behind each column. */
  background-image:
    var(--mega-gauntlet), var(--mega-gauntlet), var(--mega-gauntlet),
    var(--mega-gauntlet), var(--mega-gauntlet), var(--mega-gauntlet),
    var(--mega-gauntlet), var(--mega-gauntlet), var(--mega-gauntlet);
  background-size: min(22%, 240px) auto;
  background-position:
    -3% -8%, 29% 5%, 62% -5%, 98% 13%,
    8% 52%, 45% 43%, 83% 60%, 23% 103%, 65% 94%;
  background-repeat: no-repeat;
  filter: grayscale(1) brightness(.85) drop-shadow(1px 1px 0 rgba(255,255,255,.5)) drop-shadow(-1px -1px 0 #000);
  opacity: .18;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--white);
  flex-shrink: 0;
}

.logo-link img {
  height: auto !important;
  width: clamp(230px, 20vw, 300px) !important;
  transition: all 0.3s ease;
  display: block;
  object-fit: contain;
  max-width: 100%;
}

.logo-text {
  display: flex;
  align-items: center;
  font-family: "Archivo Black", sans-serif;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo-text .tough, .logo-text .tight { color: var(--red); }
.logo-text .jobs, .logo-text .light { color: var(--white); }

.nav-links {
  display: flex;
  gap: clamp(10px, 0.85vw, 18px);
  flex-wrap: nowrap;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
}

.nav-link {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--red-on-dark);
  border-bottom-color: var(--red);
}

/* A larger initial shares the label's baseline without adding extra spacing. */
header .nav-initial,
.mobile-drawer .nav-initial {
  font-size: 1.25em;
  line-height: 0;
}

.nav-dropdown {
  position: static;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  background: var(--ink);
  color: var(--white);
  /* Open at the header; red corner brackets frame the three exposed edges. */
  border: 2px solid rgba(255,255,255,.24);
  border-top: 0;
  border-bottom-width: 4px;
  border-image: linear-gradient(
    to bottom,
    var(--red) 0 48px,
    rgba(255,255,255,.24) 48px calc(100% - 48px),
    var(--red) calc(100% - 48px) 100%
  ) 1;
  width: min(1560px, calc(100% - 48px));
  z-index: 999;
  padding: clamp(24px, 2.2vw, 36px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  margin-top: 0;
  max-height: calc(100vh - var(--tj-header-height) - 16px);
  max-height: calc(100dvh - var(--tj-header-height) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: inset 0 -1px rgba(255,255,255,.16), 0 28px 64px rgba(0,0,0,.48);
  scrollbar-width: thin;
  scrollbar-color: var(--red) var(--ink);
  isolation: isolate;
}

.nav-dropdown.is-open .nav-dropdown-menu {
  display: grid;
  animation: mega-deploy 300ms cubic-bezier(.16,1,.3,1) both;
}
.nav-dropdown.is-open .nav-dropdown-menu > div:not(.mega-heading):not(.mega-footer) {
  animation: mega-column-in 320ms cubic-bezier(.16,1,.3,1) both;
  animation-delay: var(--mega-delay, 0ms);
}
.nav-dropdown-menu > div:nth-child(3) { --mega-delay: 25ms; }
.nav-dropdown-menu > div:nth-child(4) { --mega-delay: 50ms; }
.nav-dropdown-menu > div:nth-child(5) { --mega-delay: 75ms; }
.nav-dropdown-menu > div:nth-child(6) { --mega-delay: 100ms; }
@keyframes mega-deploy {
  from { opacity: .65; clip-path: inset(0 0 12% 0); }
  to { opacity: 1; clip-path: inset(0); }
}
@keyframes mega-column-in {
  from { opacity: .5; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-chevron { transition: transform .18s ease; }
.nav-dropdown.is-open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown-menu.compact {
  width: 220px;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 16px 20px;
}
.nav-dropdown-menu.compact .nav-dropdown-item {
  padding: 8px 0;
  font-size: 12px;
}

.nav-dropdown-menu.services-menu {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(270px, 1.05fr);
}

.nav-dd-cat {
  font-family: "Archivo Black", "Archivo", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.22);
}

.nav-dd-list { display: flex; flex-direction: column; gap: 2px; }

/* One shared heading track keeps wrapped trade categories and their rule level. */
#tradesMegaMenu > div:not(.mega-heading):not(.mega-footer) {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 12px;
}
#tradesMegaMenu .nav-dd-cat {
  position: relative;
  min-width: 0;
  color: var(--red-on-dark);
  margin-bottom: 0;
  border-bottom: 0;
}
#tradesMegaMenu .nav-dd-cat::after {
  content: "";
  position: absolute;
  left: 0;
  right: -24px;
  bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,.22);
  pointer-events: none;
}
#tradesMegaMenu > div:nth-last-child(2) .nav-dd-cat::after { right: 0; }
#tradesMegaMenu .nav-dd-list { min-width: 0; }

.nav-dropdown-item {
  font-family: "Archivo Black", "Archivo", sans-serif;
  font-weight: 400;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
  display: block;
  padding: 11px 10px;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 2px;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible { color: var(--white); background: rgba(255,255,255,.09); }
.nav-dropdown-item[aria-current="page"] { background: rgba(255,255,255,.09); box-shadow: inset 0 -2px var(--red); }
.services-menu .nav-dropdown-item { display: flex; gap: 12px; }
.services-menu .nav-dropdown-item > span:last-child { min-width: 0; }
.mega-trade-symbols { position: absolute; overflow: hidden; pointer-events: none; }
.nav-dropdown-item.mega-trade-link { display: flex; align-items: center; gap: 10px; }
.mega-trade-link > span:last-child { min-width: 0; }
.nav-dropdown-item strong { display: block; font-size: 0.875rem; font-weight: 400; line-height: 1.35; }
.nav-dropdown-item small { display: block; font: 400 0.75rem/1.5 "Archivo", sans-serif; letter-spacing: 0; text-transform: none; color: rgba(255,255,255,.8); margin-top: 5px; }
.mega-icon { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; color: var(--red-on-dark); transition: color .15s ease; }
.mega-icon svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-dropdown-item:hover .mega-icon,
.nav-dropdown-item:focus-visible .mega-icon { color: var(--white); }
.mega-heading { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgba(255,255,255,.22); padding-bottom: 22px; }
.mega-heading > span { font: 400 clamp(17px, calc(1.6vw - 2px), 24px)/1.15 "Archivo Black", "Archivo", sans-serif; letter-spacing: -.025em; color: var(--white); }
.mega-heading p { margin: 0; font: 400 0.75rem/1.5 "Archivo", sans-serif; color: rgba(255,255,255,.8); }
.mega-secondary-heading { margin-top: 20px; }
.mega-featured { padding: 20px; background: var(--navy); border-radius: 2px; }
.mega-featured-intro { margin: -4px 0 12px; font: 400 0.75rem/1.5 "Archivo", sans-serif; color: rgba(255,255,255,.8); }
.mega-product { display: flex; align-items: center; gap: 12px; padding: 9px 4px; text-decoration: none; color: var(--white); border-bottom: 1px solid rgba(255,255,255,.2); border-radius: 2px; font-family: "Archivo", sans-serif; transition: background-color .15s ease; }
.mega-product:last-child { border-bottom: 0; }
.mega-product img { width: 46px; height: 46px; flex: 0 0 46px; object-fit: contain; }
.mega-product > span:last-child { margin-left: auto; color: var(--white); transition: transform .18s ease; }
.mega-product strong { display: block; font: 400 0.875rem/1.3 "Archivo Black", "Archivo", sans-serif; text-transform: uppercase; letter-spacing: -.015em; }
.mega-product small { display: block; font-size: 0.75rem; line-height: 1.4; color: rgba(255,255,255,.8); margin-top: 4px; }
.mega-product:hover, .mega-product:focus-visible { background: rgba(255,255,255,.1); }
.mega-product:hover > span:last-child { transform: translateX(3px); }
.mega-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.22); font: 400 0.75rem/1.5 "Archivo", sans-serif; color: rgba(255,255,255,.8); }
.mega-footer a { color: var(--white); font-weight: 800; text-decoration: underline; text-decoration-color: var(--red-on-dark); text-underline-offset: 5px; padding: 6px 0; }
.mega-footer > a { display: inline-flex; align-items: center; gap: 12px; }
.mega-footer a:hover { color: var(--red-on-dark); }
header .nav-dropdown-menu :focus-visible { outline: 2px solid var(--white); outline-offset: 2px; box-shadow: none; }
.nav-dropdown-menu ::selection { color: var(--white); background: var(--red); }
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown.is-open .nav-dropdown-menu,
  .nav-dropdown.is-open .nav-dropdown-menu > div:not(.mega-heading):not(.mega-footer) { animation: none; }
  .mega-product:hover > span:last-child { transform: none; }
}

.nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.nav-phone {
  color: var(--white);
  text-decoration: none;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  animation: phone-pulse 4s ease-in-out infinite;
}

@keyframes phone-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

header .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
  white-space: nowrap;
}

header .btn:hover { filter: brightness(0.92); }
header .btn:active { transform: translateY(1px); }

/* ── Hamburger + mobile drawer ─────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: transparent; border: 0; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--white); transition: transform .25s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; opacity: 0; visibility: hidden; transition: opacity .3s ease; }
.mobile-backdrop.open { opacity: 1; visibility: visible; }
.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px); background: var(--ink); z-index: 60;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.16,1,.3,1);
  overflow-y: auto; padding: 20px 24px 48px;
  display: flex; flex-direction: column; gap: 2px;
  box-sizing: border-box;
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer > a, .md-sub-toggle {
  color: var(--white); text-decoration: none;
  font-family: "Archivo Black", "Archivo", sans-serif; font-weight: 400; font-size: 1rem;
  letter-spacing: -.015em; text-transform: uppercase;
  padding: 15px 4px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.md-sub-toggle {
  /* Coral titles distinguish expandable groups from their white links. */
  color: var(--red-on-dark);
  width: 100%;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  text-align: left;
}
.mobile-drawer > a:hover, .md-sub-toggle:hover { color: var(--red-on-dark); }
.md-close { align-self: flex-end; width: 44px; height: 44px; background: transparent; border: 0; color: var(--white); font-size: 30px; line-height: 1; cursor: pointer; padding: 0; margin-bottom: 4px; }
.md-sub-toggle { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.md-sub-toggle .chev { transition: transform .25s ease; }
.md-sub.open .md-sub-toggle .chev { transform: rotate(180deg); }
.md-sub-list { display: none; flex-direction: column; padding-left: 12px; }
.md-sub.open .md-sub-list { display: flex; }
.md-sub-list a { color: var(--white); text-decoration: none; font-family: "Archivo", sans-serif; font-weight: 600; font-size: 0.8125rem; letter-spacing: .04em; text-transform: uppercase; padding: 11px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.md-sub-list a:hover,
.md-sub-list a:focus-visible { text-decoration: underline; text-decoration-color: var(--red-on-dark); text-underline-offset: 4px; }
.md-sub-list .mega-trade-link { display: flex; align-items: center; gap: 10px; }
.md-sub-list .mega-icon { flex-basis: 20px; width: 20px; height: 20px; }
.md-sub-list .mega-icon svg { width: 18px; height: 18px; }
.md-sub-list .mega-trade-link:hover .mega-icon,
.md-sub-list .mega-trade-link:focus-visible .mega-icon { color: var(--white); }
.md-phone { color: var(--accent) !important; font-size: 18px !important; }
.md-cta { background: var(--accent); color: var(--white) !important; text-align: center; margin-top: 16px; border: 0 !important; padding: 16px !important; }
.md-cta:hover { filter: brightness(.92); color: var(--white) !important; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--navy);
}

main,
footer,
.mobile-drawer {
  overflow-wrap: break-word;
}

main > section > *,
.nav-dropdown-menu > * {
  min-width: 0;
}

/* Reserve room for the larger initials at the desktop navigation threshold,
   including while the web font is loading or a fallback font is in use. */
@media (min-width: 1280px) and (max-width: 1399px) {
  .nav-container { padding-inline: 20px; }
  .nav-links { gap: 6px; }
  .nav-link { letter-spacing: .01em; }
}

@media (max-width: 1279px) {
  header .nav-links { display: none; }
  header .nav-dropdown-menu { display: none; }
  .nav-right .nav-phone, .nav-right .btn { display: none; }
  .nav-toggle { display: flex; }
}
@media (max-width: 640px) {
  :root { --tj-header-height: 84px; }
  .nav-container { padding: 0 18px; }
  .logo-link img { width: clamp(170px, 46vw, 210px) !important; }
}

/* ── Shared clipped section edges ─────────────────────────────────────── */
main > section {
  position: relative;
  box-shadow: none !important;
}

main > section:not(:last-of-type):not(.tj-clipped-edge),
.tj-clipped-edge {
  margin-bottom: calc(-1 * var(--tj-divider-depth));
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--tj-divider-depth)),
    64% calc(100% - var(--tj-divider-depth)),
    60% 100%,
    0 100%
  );
}

main > section:nth-of-type(1) { z-index: 20; }
main > section:nth-of-type(2) { z-index: 19; }
main > section:nth-of-type(3) { z-index: 18; }
main > section:nth-of-type(4) { z-index: 17; }
main > section:nth-of-type(5) { z-index: 16; }
main > section:nth-of-type(6) { z-index: 15; }
main > section:nth-of-type(7) { z-index: 14; }
main > section:nth-of-type(8) { z-index: 13; }
main > section:nth-of-type(9) { z-index: 12; }
main > section:nth-of-type(10) { z-index: 11; }
main > section:nth-of-type(11) { z-index: 10; }
main > section:nth-of-type(12) { z-index: 9; }
main > section:nth-of-type(13) { z-index: 8; }
main > section:nth-of-type(14) { z-index: 7; }
main > section:nth-of-type(15) { z-index: 6; }

@media (max-width: 820px) {
  :root {
    --tj-divider-depth: 10px;
  }

  [style*="background-attachment:fixed"],
  [style*="background-attachment: fixed"],
  .bg-fixed {
    background-attachment: scroll !important;
  }

  main > section:not(:last-of-type):not(.tj-clipped-edge),
  .tj-clipped-edge {
    clip-path: polygon(
      0 0,
      100% 0,
      100% calc(100% - var(--tj-divider-depth)),
      68% calc(100% - var(--tj-divider-depth)),
      58% 100%,
      0 100%
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  header::before,
  .nav-dropdown-menu::before { display: none; }

  .nav-dropdown-menu {
    border-image: none;
    border-color: CanvasText;
  }

  :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline-color: CanvasText;
    box-shadow: none;
  }

  header .btn,
  .md-cta {
    border: 1px solid ButtonText;
  }
}

/* Shared page-footer utility classes (moved off inline styles site-wide) */
.tj-footer {
  background: var(--ink);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.tj-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px;
}
.tj-footer-p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
}
.tj-footer-tel {
  color: inherit;
  text-decoration: underline;
}

/* Shared primer-page "related resources" nav box */
.tj-primer-nav {
  margin-top: 56px;
  padding: 28px;
  border: 1px solid rgba(10, 15, 28, 0.18);
  background: #fff;
}
.tj-primer-nav h2 {
  font-family: "Archivo Black", sans-serif;
  text-transform: uppercase;
  font-size: 24px;
  margin: 0 0 14px;
}
.tj-primer-nav p {
  margin: 0 0 16px;
  line-height: 1.65;
}
.tj-primer-lead {
  color: #e8f0ff;
}
