/* Shared mobile / responsive behaviour for all CodeSpace pages */

/* .site-header stays position: sticky (styles.css). A `position: relative` here used to cancel
   that on every page except Home — removed 26 Aug 2026 so the menu sticks site-wide;
   impact.css sets it static on the Impact page only. */
.nav { position: relative; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #2E2E2E;
  align-items: center;
  justify-content: center;
  flex: none;
  z-index: 2;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Two-column splits that stack on tablet/phone */
.split-2,
.hero-split,
.story-split {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.story-split {
  grid-template-columns: 1.1fr .9fr;
  gap: 32px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.filter-bar > input[type="text"],
.filter-bar > input:not([type]),
.filter-bar .filter-search {
  flex: 1 1 auto;
  min-width: min(220px, 100%);
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logostrip > div {
  flex: 0 0 140px;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    background: #fff;
    border-bottom: 1px solid #E1E7ED;
    padding: 8px 16px 16px;
    box-shadow: 0 10px 30px rgba(18, 24, 46, .10);
    display: none !important;
    z-index: 60;
  }
  .nav-links.open { display: flex !important; }
  .nav-links a {
    width: 100%;
    padding: 14px 16px !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
  }

  body.nav-open { overflow: hidden; }

  .logo-mark { font-size: 18px !important; }
}

@media (max-width: 768px) {
  .split-2,
  .hero-split,
  .story-split,
  #hero-split {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .hero__inner,
  .hero .wrap {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  .hero__inner {
    padding-top: 36px !important;
    padding-bottom: 32px !important;
  }

  .section { padding: 56px 0; }
  .section--tight { padding: 40px 0; }

  .cta-row .btn,
  .cta-row > a.btn {
    width: 100%;
    justify-content: center;
  }

  /* Home page: keep testimonials scannable on phones */
  .masonry--home .quote:nth-child(n+4) {
    display: none;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar > input[type="text"],
  .filter-bar > input:not([type]),
  .filter-bar .filter-search,
  .filter-bar > select,
  .filter-bar > button {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .filter-bar > input[type="text"],
  .filter-bar > input:not([type]),
  .filter-bar .filter-search,
  .filter-bar > select {
    min-height: 44px !important;
    height: auto !important;
    font-size: 16px !important; /* avoids iOS input zoom */
    padding: 10px 14px !important;
    box-sizing: border-box;
    border-radius: 999px;
  }

  .logostrip > div {
    flex: 0 0 calc(50% - 12px) !important;
    max-width: calc(50% - 12px);
  }

  .footer-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  :root { --gut: 16px; }
  .card { padding: 20px; }
  .logostrip { gap: 20px 12px !important; }
  .logostrip > div {
    flex: 0 0 calc(50% - 6px) !important;
    max-width: calc(50% - 6px);
    height: 52px !important;
  }
}
