/* HAC Website — Main Stylesheet */
/* Typography: Poppins throughout (light weight for body, bold for headings) */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600&display=swap');

/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #ed1c24;
  --red-dark: #b5121f;
  --white: #ffffff;
  --off-white: #f8f8f6;
  --light-gray: #f0f0ee;
  --mid-gray: #e0e0dd;
  --text-dark: #0d1b2a;
  --text-mid: #4a5568;
  --text-light: #8a9ab0;
  --surface-low: #f4f4f2;
  --dark-surface: #2a2e3a;
}

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }

body {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

/* ─── Typography ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

.display-xl { font-size: clamp(3rem, 8vw, 7rem); font-weight: 600; }
.display-lg { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 600; }
.display-md { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 500; }
.display-sm { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 500; }

.body-lg { font-size: 1.125rem; font-weight: 300; line-height: 1.75; }
.body-md { font-size: 1rem; font-weight: 300; line-height: 1.7; }
.body-sm { font-size: 0.875rem; font-weight: 300; line-height: 1.65; }

.label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ─── Layout ─────────────────────────────────────────────────────────── */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
}

/* ─── Navigation ────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--mid-gray);
}

/* ── Top utility bar ── */
.nav-utility {
  border-bottom: 1px solid var(--mid-gray);
}
.nav-utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  max-width: 1440px;
  margin: 0 auto;
  height: 2rem;
}
.nav-utility-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}
.nav-utility-links li a {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0 1rem;
  height: 2rem;
  line-height: 2rem;
  border-right: 1px solid var(--mid-gray);
  transition: color 150ms, background 150ms;
}
.nav-utility-links li:first-child a { padding-left: 0; border-left: none; }
.nav-utility-links li a:hover { color: var(--red); }
.nav-utility-disabled {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0 1rem;
  height: 2rem;
  line-height: 2rem;
  border-right: 1px solid var(--mid-gray);
  cursor: default;
  opacity: 0.45;
}

/* Offices dropdown */
.nav-offices {
  position: relative;
}
.nav-offices-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 150ms;
}
.nav-offices-btn:hover { color: var(--red); }
.nav-offices-btn svg { width: 8px; height: 8px; transition: transform 200ms; }
.nav-offices.open .nav-offices-btn svg { transform: rotate(180deg); }
.nav-offices-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--white);
  border: 1px solid var(--mid-gray);
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 200;
}
.nav-offices.open .nav-offices-dropdown { display: block; }
.nav-offices-dropdown a {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--mid-gray);
  transition: color 150ms, background 150ms;
}
.nav-offices-dropdown a:last-child { border-bottom: none; }
.nav-offices-dropdown a:hover { color: var(--red); background: var(--off-white); }

/* ── Main nav row ── */
.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  max-width: 1440px;
  margin: 0 auto;
  height: 3.75rem;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo span { color: var(--red); }
.nav-logo img { height: 2.5rem; width: auto; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  flex: 1;
}

/* Each top-level item is a positioned container */
.nav-links > li {
  position: relative;
  display: flex;
  align-items: center;
  height: 3.75rem; /* match nav-inner height so hover zone is full bar */
  gap: 0.3rem;
}

.nav-links a,
.nav-links > li > button.nav-drop-btn,
.nav-links > li > a.nav-drop-link {
  color: var(--text-mid);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 150ms;
  white-space: nowrap;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links > li > a.nav-drop-link:hover,
.nav-links > li > a.nav-drop-link.active,
.nav-links > li:hover > button.nav-drop-btn,
.nav-links > li > button.nav-drop-btn.active { color: var(--red); }

/* Chevron-only button sits flush next to the link */
.nav-drop-chevron {
  padding: 0;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  color: var(--text-mid);
  transition: color 150ms;
}

/* Chevron turns red when its sibling link is hovered/active */
.nav-links > li:hover > button.nav-drop-chevron,
.nav-links > li.drop-open > button.nav-drop-chevron,
.nav-links > li:has(> a.nav-drop-link.active) > button.nav-drop-chevron { color: var(--red); }

/* Chevron icon */
.nav-drop-btn svg, .nav-drop-chevron svg {
  width: 8px;
  height: 8px;
  transition: transform 220ms;
  flex-shrink: 0;
}
.nav-links > li.drop-open > button.nav-drop-chevron svg,
.nav-links > li:hover > button.nav-drop-chevron svg { transform: rotate(180deg); }

/* Dropdown panel */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--white);
  border-top: 2px solid var(--red);
  box-shadow: 0 8px 32px rgba(13,27,42,0.10);
  z-index: 150;
  padding: 0.5rem 0;
}

.nav-links > li:hover .nav-dropdown,
.nav-links > li.drop-open .nav-dropdown { display: block; }

.nav-dropdown a {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  white-space: nowrap;
  transition: color 150ms, background 150ms;
  border: none;
}
.nav-dropdown a:hover { color: var(--red); background: var(--off-white); }

/* ── Nested sub-dropdown (ISO & Quality sub-items) ── */
.nav-dropdown-item {
  position: relative;
}
.nav-dropdown-item-row {
  display: flex;
  align-items: center;
  width: 100%;
}
/* Clickable title link */
.nav-dropdown-item > .nav-subdropdown-trigger-link {
  flex: 1;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.6rem 0.5rem 0.6rem 1.25rem;
  white-space: nowrap;
  transition: color 150ms, background 150ms;
  display: block;
}
.nav-dropdown-item > .nav-subdropdown-trigger-link:hover { color: var(--red); }
/* Chevron button to open sub-menu */
.nav-subdropdown-chevron {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0.6rem 1rem 0.6rem 0.25rem;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  transition: color 150ms;
}
.nav-subdropdown-chevron:hover { color: var(--red); }
.nav-subdropdown-chevron svg { width: 6px; height: 6px; flex-shrink: 0; transition: transform 220ms; }
.nav-dropdown-item:hover .nav-subdropdown-chevron svg { transform: rotate(90deg); }
.nav-subdropdown {
  display: none;
  position: absolute;
  top: -0.5rem;
  left: 100%;
  min-width: 210px;
  background: var(--white);
  border-top: 2px solid var(--red);
  box-shadow: 0 8px 32px rgba(13,27,42,0.10);
  z-index: 160;
  padding: 0.5rem 0;
}
.nav-dropdown-item:hover .nav-subdropdown { display: block; }
.nav-subdropdown a {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  white-space: nowrap;
  transition: color 150ms, background 150ms;
}
.nav-subdropdown a:hover { color: var(--red); background: var(--off-white); }
.nav-subdropdown .nav-subdropdown-browse {
  border-top: 1px solid var(--mid-gray);
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  color: var(--red);
  font-weight: 500;
}
.nav-subdropdown .nav-subdropdown-browse:hover { color: var(--red-dark); background: var(--off-white); }

/* Search / explore */
.nav-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0 1rem;
  height: 3.75rem; /* match nav-inner height — full bar is clickable */
  flex-shrink: 0;
  transition: color 150ms;
}
.nav-search:hover { color: var(--red); }
.nav-search svg { width: 1rem; height: 1rem; }

/* ── Search panel — inline expansion from right ── */
.nav-search-overlay { display: none; }

.nav-search-panel {
  position: absolute;
  top: 4px;
  right: 0;
  bottom: 0;
  /* animate width from 0 — no overflow:hidden so dropdown can escape */
  max-width: 0;
  width: var(--search-panel-width, 480px);
  display: flex;
  align-items: center;
  padding: 0;
  gap: 0.85rem;
  background: #fff;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;    /* clips the input row only */
  transition: max-width 220ms cubic-bezier(0.4,0,0.2,1),
              opacity 180ms ease,
              padding 220ms ease,
              border-color 220ms ease;
  z-index: 200;
}
.nav-search-panel.open {
  max-width: var(--search-panel-width, 480px);
  padding: 0 1.25rem;
  opacity: 1;
  pointer-events: all;
  background: #fff;
  border-color: #dde0e6;
  border-bottom-color: #ed1c24;
  overflow: visible;   /* allow dropdown to escape when open */
}

.nav-search-panel-icon {
  color: #ed1c24;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.nav-search-panel-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 2;
}

.nav-search-panel input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #1a1d25;
  padding: 0.2rem 0;
  outline: none;
  direction: ltr;
  text-align: left;
}
.nav-search-panel input::placeholder { color: #9aa0ac; }

/* homepage transparent hero — white bg panel */
.nav-home:not(.nav-solid) .nav-search-panel.open {
  background: rgba(255,255,255,0.96);
}

/* clear (×) button */
.nav-search-input-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mid);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 120ms;
  display: none;
  align-items: center;
  opacity: 0.5;
}
.nav-search-input-clear.visible { display: flex; }
.nav-search-input-clear:hover { opacity: 1; }

/* divider */
.nav-search-divider {
  width: 1px;
  height: 1rem;
  background: var(--mid-gray);
  flex-shrink: 0;
  opacity: 0.5;
}

.nav-search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mid);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  padding: 0;
  flex-shrink: 0;
  transition: color 120ms;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.nav-search-close svg {
  width: 0.75rem;
  height: 0.75rem;
  stroke: currentColor;
}
.nav-search-close:hover { color: var(--red); }
.nav-home:not(.nav-solid) .nav-search-close { color: rgba(255,255,255,0.5); }
.nav-home:not(.nav-solid) .nav-search-close:hover { color: #fff; }
.nav-home:not(.nav-solid) .nav-search-divider { background: rgba(255,255,255,0.3); }

/* ── Search results panel — drops below the search panel ── */
.search-results {
  position: absolute;
  top: calc(100% + 2px); /* 2px gap below the red border */
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid #dde0e6;
  border-top: 2px solid #ed1c24;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  max-height: 70vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 9998;
}
.search-results.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* group header */
.search-result-group {
  border-bottom: 1px solid #f0f0f0;
}
.search-result-group:last-child { border-bottom: none; }

.search-result-group-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem 0.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.search-result-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.15;
}

/* category accent colors — all HAC red */
.search-result-cat--cert,
.search-result-cat--service,
.search-result-cat--industry,
.search-result-cat--insight,
.search-result-cat--media,
.search-result-cat--page     { color: #ed1c24; }

/* result rows */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  color: #2a2e3a;
  border-bottom: 1px solid #f5f5f5;
  transition: background 80ms, padding-left 80ms;
  cursor: pointer;
}
.search-result-group .search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.active {
  background: #fafafa;
  padding-left: 1.6rem;
}

/* left accent bar on hover */
.search-result-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ed1c24;
  opacity: 0;
  transition: opacity 80ms;
}
.search-result-item { position: relative; }
.search-result-item:hover::before,
.search-result-item.active::before { opacity: 1; }

.search-result-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  color: #2a2e3a;
  letter-spacing: 0.01em;
}
.search-result-title mark {
  background: none;
  color: #ed1c24;
  font-weight: 600;
}

.search-result-arrow {
  width: 0.8rem;
  height: 0.8rem;
  color: #ed1c24;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 80ms, transform 80ms;
}
.search-result-item:hover .search-result-arrow,
.search-result-item.active .search-result-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.search-results-empty {
  padding: 1.25rem;
  font-size: 0.8rem;
  color: #999;
  letter-spacing: 0.02em;
}

/* ── Desktop hamburger (3-line menu button) ── */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  padding: 6px 4px;
  flex-shrink: 0;
  order: -1; /* sits before logo */
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 300ms cubic-bezier(0.4,0,0.2,1),
              opacity 300ms cubic-bezier(0.4,0,0.2,1),
              width 300ms cubic-bezier(0.4,0,0.2,1);
  transform-origin: center;
}

/* Animate to X when drawer is open */
.nav-hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.is-open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Color in transparent homepage state */
.nav-home .nav-hamburger { color: var(--white); }
.nav-home.nav-solid .nav-hamburger,
.nav-home:hover .nav-hamburger { color: var(--text-dark); }

/* Non-homepage pages */
.nav:not(.nav-home) .nav-hamburger { color: var(--text-dark); }

/* ── Slide-in nav drawer ── */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,0.45);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}
.nav-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--white);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 380ms cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.nav-drawer.open {
  transform: translateX(0);
}

/* Drawer header: logo + close */
.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--mid-gray);
  flex-shrink: 0;
}
.nav-drawer-header a { display: flex; align-items: center; text-decoration: none; }
.nav-drawer-header img {
  height: 2rem;
  width: auto;
}
.nav-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms;
}
.nav-drawer-close:hover { color: var(--red); }
.nav-drawer-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Drawer main links */
.nav-drawer-links {
  flex: 1;
  padding: 2rem 2rem 1rem;
  display: flex;
  flex-direction: column;
}

/* Each drawer item is a group: trigger row + collapsible sub-list */
.nav-drawer-item {
  border-bottom: 1px solid var(--mid-gray);
}
.nav-drawer-item:first-child { border-top: 1px solid var(--mid-gray); }

/* Plain link items (no children) */
.nav-drawer-item > a {
  font-size: 1.375rem;
  font-weight: 300;
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 150ms;
  letter-spacing: -0.01em;
}
.nav-drawer-item > a:hover { color: var(--red); }
.nav-drawer-item > a svg {
  width: 1rem;
  height: 1rem;
  opacity: 0.4;
  flex-shrink: 0;
}

/* Trigger button for items with children */
.nav-drawer-item > button.drawer-drop-btn {
  width: 100%;
  font-size: 1.375rem;
  font-weight: 300;
  color: var(--text-dark);
  background: none;
  border: none;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.01em;
  transition: color 150ms;
  text-align: left;
}
.nav-drawer-item > button.drawer-drop-btn:hover,
.nav-drawer-item.drop-open > button.drawer-drop-btn { color: var(--red); }

.drawer-drop-btn svg {
  width: 1rem;
  height: 1rem;
  opacity: 0.4;
  flex-shrink: 0;
  transition: transform 280ms cubic-bezier(0.4,0,0.2,1);
}
.nav-drawer-item.drop-open > .drawer-drop-btn svg { transform: rotate(90deg); opacity: 0.8; }

/* Sub-link list inside drawer */
.nav-drawer-sub {
  display: none;
  flex-direction: column;
  padding: 0 0 0.75rem 1rem;
  gap: 0;
}
.nav-drawer-item.drop-open > .nav-drawer-sub { display: flex; }

.nav-drawer-sub a {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.45rem 0;
  letter-spacing: 0.01em;
  transition: color 150ms;
  display: block;
}
.nav-drawer-sub a:hover { color: var(--red); }

/* ISO sub-dropdown inside drawer — accordion style */
.nav-drawer-sub .nav-dropdown-item {
  position: static;
  display: block;
}
/* Row: link + chevron side by side */
.nav-drawer-sub .nav-dropdown-item-row {
  display: flex;
  align-items: center;
}
.nav-drawer-sub .nav-subdropdown-trigger-link {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.45rem 0;
  transition: color 150ms;
  text-transform: none;
  letter-spacing: 0.01em;
  display: block;
}
.nav-drawer-sub .nav-subdropdown-trigger-link:hover { color: var(--red); }
.nav-drawer-sub .nav-subdropdown-chevron {
  padding: 0.45rem 0 0.45rem 0.5rem;
  color: var(--text-mid);
  transition: color 150ms, transform 220ms;
}
.nav-drawer-sub .nav-subdropdown-chevron svg { width: 7px; height: 7px; transition: transform 220ms; }
.nav-drawer-sub .nav-dropdown-item.sub-open .nav-subdropdown-chevron svg { transform: rotate(90deg); }
/* Sub-list hidden by default, shown when .sub-open */
.nav-drawer-sub .nav-subdropdown {
  display: none;
  position: static;
  box-shadow: none;
  border-top: none;
  border-left: 2px solid var(--mid-gray);
  padding: 0.25rem 0 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  width: 100%;
}
.nav-drawer-sub .nav-dropdown-item.sub-open .nav-subdropdown { display: block; }
.nav-drawer-sub .nav-subdropdown a {
  font-size: 0.8rem;
  font-weight: 300;
  padding: 0.35rem 0;
  border: none;
  background: none;
  color: var(--text-mid);
  text-transform: none;
  letter-spacing: 0.01em;
}
.nav-drawer-sub .nav-subdropdown a:hover { color: var(--red); background: none; }
.nav-drawer-sub .nav-subdropdown .nav-subdropdown-browse {
  color: var(--red);
  font-weight: 500;
}

/* Drawer utility links */
.nav-drawer-utility {
  padding: 1.5rem 2rem 2.5rem;
  border-top: 1px solid var(--mid-gray);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex-shrink: 0;
}
.nav-drawer-utility a {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 150ms;
}
.nav-drawer-utility a:hover { color: var(--red); }

/* Hide old mobile nav — drawer replaces it on all breakpoints */
.nav-mobile { display: none !important; }

@media (max-width: 900px) {
  .nav-utility { display: none; }
  .nav-links { display: none; }
  /* Keep search button visible on mobile — icon only, no text */
  .nav-search { display: flex; }
  .nav-search-label { display: none; }
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1rem 2.5rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms;
}
.btn-primary:hover { background: var(--red-dark); }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--text-dark);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1rem 2.5rem;
  border: 1.5px solid var(--text-dark);
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms;
}
.btn-outline:hover {
  background: var(--dark-surface);
  color: var(--white);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--red);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1.5px solid var(--red);
  padding-bottom: 2px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  transition: color 150ms;
}
.btn-ghost:hover { color: var(--red-dark); }

/* ─── Red accent bar ──────────────────────────────────────────────────── */
.red-bar {
  display: block;
  width: 3.5rem;
  height: 3px;
  background: var(--red);
  margin-bottom: 1.5rem;
}

/* ─── Section spacing ─────────────────────────────────────────────────── */
.section { padding: 6rem 0; }
.section-lg { padding: 8rem 0; }
.section-sm { padding: 3rem 0; }

/* ─── Footer ─────────────────────────────────────────────────────────── */
.footer {
  background: #f5f5f3;
  color: var(--text-dark);
  padding: 4rem 0 0;
}

/* Upper section: logo+nav on left, subscribe on right */
.footer-upper {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  padding-bottom: 3rem;
}

@media (max-width: 900px) {
  .footer-upper { grid-template-columns: 1fr; gap: 2.5rem; }
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-logo {
  display: block;
}

.footer-logo img {
  height: 3.5rem;
  width: auto;
  display: block;
}

/* Nav links in two columns */
.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 4rem;
}

@media (max-width: 600px) {
  .footer-nav { grid-template-columns: 1fr; }
}

.footer-nav a {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-dark);
  text-decoration: none;
  line-height: 2;
  transition: color 150ms;
}
.footer-nav a:hover { color: var(--red); }

/* Subscribe block */
.footer-subscribe {
  min-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .footer-subscribe { min-width: 0; }
}

.footer-subscribe h3 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  margin: 0;
}

.footer-subscribe p {
  font-size: 0.875rem;
  font-weight: 300;
  color: #4a5568;
  line-height: 1.5;
  margin: 0;
}

.footer-subscribe-form {
  display: flex;
  gap: 0;
  margin-top: 0.25rem;
}

.footer-subscribe-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 300;
  border: 1.5px solid #c8c8c4;
  border-right: none;
  background: var(--white);
  color: var(--text-dark);
  outline: none;
  transition: border-color 150ms;
}
.footer-subscribe-form input[type="email"]:focus { border-color: var(--text-dark); }
.footer-subscribe-form input[type="email"]::placeholder { color: #8a9ab0; }

.footer-subscribe-form button {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--red);
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: background 150ms;
  white-space: nowrap;
}
.footer-subscribe-form button:hover { background: var(--red-dark); }

/* Divider */
.footer-divider {
  height: 1px;
  background: #d4d4cf;
  margin: 0;
}

/* Bottom bar */
.footer-bottom {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Circular social icons */
.footer-social-icons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.footer-social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--dark-surface);
  color: var(--white);
  text-decoration: none;
  transition: background 150ms;
  flex-shrink: 0;
}
.footer-social-icons a:hover { background: var(--red); }

.footer-social-icons svg {
  width: 1rem;
  height: 1rem;
  fill: var(--white);
}

/* Legal links */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: center;
}

.footer-legal a {
  font-size: 0.8rem;
  font-weight: 400;
  color: #4a5568;
  text-decoration: none;
  transition: color 150ms;
}
.footer-legal a:hover { color: var(--text-dark); }

.footer-copyright {
  font-size: 0.8rem;
  font-weight: 300;
  color: #4a5568;
}

/* Legacy classes — kept for any internal references */
.footer-grid { display: none; }
.footer-desc { display: none; }
.footer-col-title { display: none; }
.footer-links { display: none; }
.footer-social { display: none; }

/* ─── Utility ─────────────────────────────────────────────────────────── */
.text-red { color: var(--red); }
.bg-red { background: var(--red); }
.bg-offwhite { background: var(--off-white); }
.bg-lightgray { background: var(--light-gray); }
.bg-dark { background: var(--dark-surface); color: var(--white); }

.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;
}

/* ─── Page Hero ───────────────────────────────────────────────────────── */
.page-hero {
  background: var(--off-white);
  padding: 7rem 0 5rem;
  overflow: hidden;
  position: relative;
}

.page-hero-eyebrow {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.5rem;
  display: block;
}

/* ─── Animations ────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fadeup { animation: fadeUp 0.7s ease forwards; }
.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.25s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.4s; opacity: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE OPTIMISATIONS — all breakpoints for phone usage
   Uses max-width: 768px for most phone targets, 480px for very small
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Global section spacing on phones ─────────────────────────────── */
@media (max-width: 768px) {
  .section    { padding: 3.5rem 0; }
  .section-lg { padding: 4.5rem 0; }
  .section-sm { padding: 2rem 0; }
  .page-hero  { padding: 4rem 0 3rem; }
}

/* ─── Navigation — McKinsey-style mobile layout ─────────────────────── */
/* hamburger | (centered logo) | search icon                            */
@media (max-width: 900px) {
  .nav-inner {
    padding: 0 1rem;
    position: relative; /* anchor for absolute logo */
  }
  /* Logo: absolute centre of the nav bar — !important overrides homepage inline style */
  .nav-inner .nav-logo {
    position: absolute !important;
    left: 50%;
    transform: translateX(-50%);
    height: 3.75rem; /* preserve height so logo-swap images align vertically */
  }
  /* Search: pushed to far right */
  .nav-search {
    margin-left: auto;
  }
}
@media (max-width: 480px) {
  .nav-inner { height: 3.25rem; }
  .nav-logo img { height: 2rem; }
}

/* ─── Drawer — full-width on small phones ──────────────────────────── */
@media (max-width: 480px) {
  .nav-drawer { width: 100vw; max-width: 100vw; }
}

/* ─── Buttons — full-width CTA blocks on phone ─────────────────────── */
@media (max-width: 480px) {
  .btn-primary,
  .btn-outline {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
  }
  /* Hero button row: stack vertically */
  .hero-btns  { flex-direction: column; align-items: stretch; }
}

/* ─── Homepage hero ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hero content: less padding-top so it fits below the fixed nav */
  .hero-content { padding-top: 6rem; padding-bottom: 3rem; }
  .hero h1 { max-width: 22ch; }
  .hero-sub { font-size: 1rem; max-width: 100%; }

  /* Stats strip: 2-col on phones */
  .hero-stats { grid-template-columns: repeat(2, 1fr); padding: 0 1.25rem; }
  .hero-stats > div { padding: 1.75rem 1rem 1.5rem; }
  .hero-stats > div:nth-child(2n) { border-right: none; }
  .hero-stats > div { border-bottom: 1px solid rgba(0,0,0,0.08); }
}
@media (max-width: 480px) {
  /* Stats strip: 1-col on very small phones */
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats > div { border-right: none; }
}

/* ─── Client marquee pill — smaller on phone ────────────────────────── */
@media (max-width: 768px) {
  .client-pill { height: 6rem; padding: 0 2rem; }
  .client-pill img { height: 4.5rem; max-width: 12rem; }
}

/* ─── Services section (homepage) ───────────────────────────────────── */
@media (max-width: 768px) {
  .services-grid { grid-template-columns: 1fr; }
  .service-card { padding: 2.5rem 2rem; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); }
  .service-card:last-child { border-bottom: none; }
  /* Disable the lift effect on touch */
  .service-card:hover { transform: none; }
}

/* ─── Featured grid (homepage) ──────────────────────────────────────── */
@media (max-width: 768px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-body { padding: 2rem 1.75rem; }
  .featured-img { min-height: 220px; }
}

/* ─── About CTA strip (homepage) ────────────────────────────────────── */
@media (max-width: 768px) {
  .about-strip { padding: 4rem 0; }
  .about-strip-inner { grid-template-columns: 1fr; gap: 2rem; }
}

/* ─── Video-hero pages (cap, industries, leadership, careers, wwa) ──── */
/* All share: height: 32vw; max-height: 360px; min-height: 220px        */
/* On phone the title sits at bottom: 3rem — this clips on small screens */
@media (max-width: 600px) {
  /* Push content down less aggressively and ensure it's readable */
  .cap-hero-content,
  .ind-hero-content,
  .ldr-header-content,
  .clients-header-content,
  .pmv-header-content,
  .careers-hero-content,
  .wwa-hero-content,
  .about-hero-content {
    bottom: 1.25rem;
  }
  /* Pause button: move up, smaller */
  .cap-hero-pause,
  .ind-hero-pause,
  .ldr-header-pause,
  .clients-header-pause,
  .pmv-header-pause,
  .careers-hero-pause,
  .wwa-hero-pause,
  .about-hero-pause {
    bottom: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }
}

/* ─── Capabilities page ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cap-block { padding: 4rem 0; }
  /* cap-block-grid already goes 1-col at 900px — just reduce gap */
  .cap-img-wrap { margin-bottom: 2rem; }
  /* Stat badge — reposition so it doesn't clip off the image */
  .cap-stat-badge { bottom: -1rem; right: 1rem; padding: 1rem 1.25rem; }
  .cap-stat-badge-num { font-size: 1.75rem; }
}

/* ─── Industries page ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ind-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .ind-grid { grid-template-columns: 1fr; }
  .ind-grid-item { padding: 2rem 1.5rem; }
  /* Disable hover gradient on touch devices for performance */
  .ind-grid-item:hover::before { opacity: 0; }
  .ind-grid-item:hover h3 { color: inherit; }
}

/* ─── Insights page ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Featured article hero body: less padding */
  .ins-real-hero-body { padding: 1.75rem 1.5rem; }
  /* Article cards grid — already 1-col at 640, just check padding */
  .ins-real-featured { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ─── Mobile search button — bigger icon, desktop inline panel hidden ── */
@media (max-width: 900px) {
  .nav-search {
    padding: 0 0.75rem;
    height: 3.75rem;
    justify-content: center;
  }
  .nav-search svg {
    width: 1.375rem;
    height: 1.375rem;
  }
  /* Desktop inline panel hidden on mobile — replaced by JS overlay */
  .nav-search-panel { display: none !important; }
}

/* ─── Mobile search overlay ──────────────────────────────────────────── */
#mobile-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  flex-direction: column;
  background: rgba(13,27,42,0.45);
}
#mobile-search-overlay.open { display: flex; }

#mobile-search-box {
  background: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  height: 4rem;
  border-bottom: 2px solid var(--red);
  flex-shrink: 0;
}
#mobile-search-box svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--red);
  flex-shrink: 0;
}
#mobile-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-dark);
  background: transparent;
}
#mobile-search-input::placeholder { color: #9aa0ac; }
#mobile-search-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
#mobile-search-close svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
}

#mobile-search-results {
  background: #fff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
/* reuse existing search-result-* styles */
#mobile-search-results .search-result-group { border-bottom: 1px solid #f0f0f0; }
#mobile-search-results .search-result-group:last-child { border-bottom: none; }
#mobile-search-results .search-results-empty {
  padding: 2rem 1.25rem;
  font-size: 0.9rem;
  color: #999;
  text-align: center;
}

/* ─── Insight article pages ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sticky header in articles */
  .art-sticky { padding: 0.75rem 1.25rem; flex-wrap: wrap; gap: 0.75rem; }
}

/* ─── About pages (about.html + sub-pages) ──────────────────────────── */
@media (max-width: 768px) {
  /* Who We Are — story badge clips off image on small screens */
  .story-img-badge { bottom: 0; right: 0; }
  /* About.html founding badge */
  .founding-badge { bottom: 0; right: 0; }
  /* Leader card padding reduction */
  .leader-card { padding: 2.5rem 1.75rem; }
}

/* ─── Certifications index ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .cert-page-header { padding: 3.5rem 0 2.5rem; }
  .cert-popular { padding: 2.5rem 0; }
}

/* ─── Certification detail pages (cert-detail.css patterns) ─────────── */
@media (max-width: 768px) {
  .cert-cta { padding: 3.5rem 0; }
  .cert-track-record { padding: 2.5rem 0; }
  /* Stats row: wrap tighter */
  .cert-stat { min-width: 110px; padding: 1.25rem 1rem; }
  .cert-stat-industries { min-width: 100%; }
  .cert-stat-divider { display: none; }
}

/* ─── Contact page ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Contact layout already goes 1-col at 900px */
  .contact-bottom { padding: 3rem 0; }
}
@media (max-width: 600px) {
  /* contact-info and contact-form-panel already reduce padding at 600px */
  /* Make form submit button full-width */
  .form-submit { width: 100%; }
}

/* ─── Careers page ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .open-application { padding: 3rem 0 2.5rem; }
  /* Why-grid already 1-col at 768px */
  .why-item-body { padding: 1.5rem 1.5rem 2rem; }
}

/* ─── Media Center page ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Filter chips: allow horizontal scroll on small phones */
  .mc-chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem; }
  .mc-chip  { flex-shrink: 0; }
  /* Browse bar: stack on very small */
  .mc-browse-bar { flex-direction: column; align-items: flex-start; }
}

/* ─── Public Register page ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .register-controls-inner { padding: 0.75rem 1.25rem; }
  .register-search-wrap { min-width: 0; width: 100%; }
}
@media (max-width: 480px) {
  .register-header-inner { padding: 0 1.25rem; }
}

/* ─── Footer ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer { padding: 3rem 0 0; }
  .footer-upper { gap: 2rem; padding-bottom: 2rem; }
  .footer-logo img { height: 2.75rem; }
  .footer-subscribe { min-width: 0; }
  /* Subscribe form: stack on very small phones */
}
@media (max-width: 480px) {
  .footer-subscribe-form { flex-direction: column; }
  .footer-subscribe-form input[type="email"] {
    border-right: 1.5px solid #c8c8c4;
    border-bottom: none;
  }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
}

/* ─── ISO cards grid (capabilities page + cert index) ───────────────── */
@media (max-width: 480px) {
  .iso-cards-grid { grid-template-columns: 1fr; }
  .iso-card { padding: 1.5rem 1.5rem 1.75rem; }
}

/* ─── Media Center article / post pages ────────────────────────────── */
@media (max-width: 640px) {
  .post-back,
  .post-header,
  .post-hero,
  .post-body,
  .post-next { padding-left: 1.25rem; padding-right: 1.25rem; }
  .post-body { font-size: 1rem; }
}

/* ─── Clients page — logo cells: reduce padding on phones ───────────── */
@media (max-width: 480px) {
  .logo-cell { padding: 2rem 1.25rem; }
  .logo-cell img { max-height: 80px; }
  .logos-section { padding: 3.5rem 0; }
}

/* ─── Prevent horizontal overflow globally ──────────────────────────── */
@media (max-width: 768px) {
  body { overflow-x: hidden; }
  /* Marquee must not overflow viewport */
  .clients-marquee-wrap { max-width: 100vw; }
}
