/* ============================================================
   WHY INFINITYIT: TECHNOLOGY PARTNERS, COMPACT
   ============================================================ */
.why-partners {
  position: relative;
  overflow: hidden;
  padding: clamp(2.25rem, 3.5vw, 3.25rem) 0;
  border-block: 1px solid var(--line);
  background:
    radial-gradient(
      circle at 8% 12%,
      color-mix(in srgb, var(--teal) 8%, transparent),
      transparent 27%
    ),
    var(--surface);
}

.why-partners-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(1.4rem, 2.5vw, 2rem);
}

.why-partners-heading .eyebrow {
  margin-bottom: .45rem;
}

.why-partners-heading h2 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.15rem, 3vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -.038em;
  text-wrap: balance;
}

.why-partners-heading h2 em {
  color: var(--teal);
  font-style: normal;
}

.why-partners-heading > p {
  max-width: 590px;
  margin: 0 0 .2rem auto;
  color: var(--muted);
  font-size: clamp(.96rem, 1.05vw, 1.06rem);
  line-height: 1.62;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

.partner-card {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 112px;
  padding: .75rem 1rem;
  overflow: hidden;
  border: 1px solid #d5e0e1;
  border-radius: 14px;
  background: #f6f8f8;
  color: #102427;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(9, 30, 32, .045);
}

a.partner-card {
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

a.partner-card:hover,
a.partner-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--teal) 45%, #d5e0e1);
  box-shadow: 0 12px 26px rgba(9, 30, 32, .09);
}

a.partner-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 24%, transparent);
  outline-offset: 3px;
}

.partner-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}

a.partner-card:hover::after,
a.partner-card:focus-visible::after {
  transform: scaleX(1);
}

.partner-logo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 72px;
  padding: .3rem .55rem;
}

.partner-logo img {
  display: block;
  width: auto;
  max-width: 86%;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  opacity: 1;
  filter: none;
}

/* Optical balancing for the current logo set. */
.partner-card:has(img[alt*='Microsoft' i]) .partner-logo img {
  max-height: 45px;
}

.partner-card:has(img[alt*='One NZ' i]) .partner-logo img,
.partner-card:has(img[alt*='one.nz' i]) .partner-logo img {
  max-height: 47px;
}

.partner-card:has(img[alt*='Epson' i]) .partner-logo img {
  max-height: 41px;
}

.partner-card:has(img[alt*='HP' i]) .partner-logo img {
  max-height: 56px;
}

/* Keep partner names available to assistive technology. */
.partner-name {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.why-partners-note {
  max-width: 700px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.5;
  text-align: center;
}

[data-theme='dark'] .why-partners {
  border-color: #294044;
  background:
    radial-gradient(
      circle at 8% 12%,
      rgba(26, 166, 173, .08),
      transparent 27%
    ),
    linear-gradient(180deg, #142326 0%, #132124 100%);
}

[data-theme='dark'] .partner-card {
  border-color: #34484b;
  background: #f6f8f8;
  color: #102427;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}

[data-theme='dark'] .partner-logo img {
  opacity: 1;
  filter: none;
}

@media (max-width: 1100px) {
  .partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 950px) {
  .why-partners-heading {
    grid-template-columns: 1fr;
    gap: .75rem;
    align-items: start;
  }

  .why-partners-heading h2 {
    max-width: 16ch;
  }

  .why-partners-heading > p {
    max-width: 680px;
    margin-left: 0;
  }
}

@media (max-width: 700px) {
  .why-partners {
    padding: 2.25rem 0 2.5rem;
  }

  .why-partners-heading {
    margin-bottom: 1.25rem;
  }

  .why-partners-heading h2 {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
  }

  .partner-card {
    min-height: 96px;
    padding: .6rem;
    border-radius: 12px;
  }

  .partner-logo {
    height: 62px;
    padding: .25rem;
  }

  .partner-logo img {
    max-width: 90%;
    max-height: 42px;
  }

  .partner-card:has(img[alt*='HP' i]) .partner-logo img {
    max-height: 49px;
  }

  .why-partners-note {
    margin-top: .85rem;
    font-size: .72rem;
  }
}

@media (max-width: 420px) {
  .partner-grid {
    grid-template-columns: 1fr;
  }

  .partner-card {
    min-height: 92px;
  }
}

/* ============================================================
   Why InfinityIT-only content, consolidated out of site-refinements.css/
   site-components.css/site-overrides.css, which used to load this on
   every page of the site.
   ============================================================ */
.why-photo,
.why-card {
  border-radius: var(--radius-lg);
}

.why-card {
  border-radius: var(--radius-md);
}

.why-proof {
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--teal) 3%, var(--surface));
}

.why-proof .proof-grid.trust-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: min(1320px, calc(100% - 40px));
  margin-inline: auto;
}

.why-proof .trust-metric {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 148px;
  padding: 1.25rem .8rem;
  border: 0;
  text-align: center;
  color: inherit;
  transition: background .2s;
}

.why-proof a.trust-metric:hover {
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

.why-proof .trust-metric:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 26%;
  right: 0;
  bottom: 26%;
  width: 1px;
  background: var(--line);
}

.why-proof .trust-metric strong {
  display: block;
  color: var(--teal);
  font-size: clamp(1.85rem, 2.8vw, 2.75rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.035em;
}

.why-proof .trust-metric span {
  display: block;
  margin-top: .55rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.3;
}

.why-proof .trust-metric small {
  display: block;
  margin-top: .18rem;
  color: var(--teal);
  font-size: .72rem;
  font-weight: 850;
}

@media (max-width: 1050px) {
  .why-proof .proof-grid.trust-metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .why-proof .trust-metric:nth-child(3n)::after {
    display: none;
  }

  .why-proof .trust-metric:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 600px) {
  .why-proof .proof-grid.trust-metric-grid {
    grid-template-columns: 1fr 1fr;
    width: min(100% - 28px, 560px);
  }

  .why-proof .trust-metric {
    min-height: 105px;
  }

  .why-proof .trust-metric:nth-child(3n)::after {
    display: block;
  }

  .why-proof .trust-metric:nth-child(even)::after {
    display: none;
  }

  .why-proof .trust-metric:nth-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- Mobile hero media correction (also duplicated in
   features/case-studies.css, since case-studies.php reuses this same
   .why-hero/.why-photo markup but loads a different CSS bundle) ---------- */
@media (max-width: 950px) {
  .why-hero .why-hero-grid { grid-template-columns: 1fr !important; gap: 1.6rem !important; align-items: start !important; }
  .why-hero .why-photo { display: grid !important; grid-template-rows: auto auto !important; width: 100% !important; min-width: 0 !important; margin: 0 !important; overflow: hidden !important; border: 1px solid var(--line) !important; border-radius: 22px !important; background: var(--surface) !important; box-shadow: var(--shadow) !important; }
  .why-hero .why-photo > img { display: block !important; width: 100% !important; height: clamp(240px, 58vw, 360px) !important; min-height: 0 !important; max-height: none !important; object-fit: cover !important; object-position: center !important; transform: none !important; }
  .why-hero .why-photo:hover > img { transform: none !important; }
  .why-hero .why-photo > figcaption { position: static !important; inset: auto !important; display: block !important; width: 100% !important; max-width: none !important; margin: 0 !important; padding: .9rem 1rem !important; border-radius: 0 !important; background: var(--surface) !important; color: var(--text) !important; backdrop-filter: none !important; }
  .why-hero .why-photo > figcaption b { display: block !important; color: var(--text) !important; overflow-wrap: anywhere; }
  .why-hero .why-photo > figcaption span { display: block !important; color: var(--muted) !important; overflow-wrap: anywhere; }
}

@media (max-width: 600px) {
  .why-hero .why-photo > img { height: clamp(220px, 68vw, 310px) !important; }
}
