/* ==========================================================================
   Client wall
   Scoped under .client-wall / .client-grid / .client-tile so nothing here
   can leak into the rest of the Bootstrap 3 theme.
   ========================================================================== */

.client-wall {
  --cw-surface: var(--ims-surface, #f4f6f8);
  --cw-tile: var(--ims-paper, #ffffff);
  --cw-rule: var(--ims-rule, #dde4ea);
  --cw-ink: var(--ims-ink, #16232e);
  --cw-muted: var(--ims-ink-soft, #6a7b88);
  --cw-brand: var(--ims-brand, #1c94dc);

  padding: 90px 0 80px;
  background: var(--cw-surface);
  border-top: 1px solid var(--cw-rule);
}

/* ---- Heading ------------------------------------------------------------ */

.client-wall__head {
  max-width: 640px;
  margin: 0 0 44px;
}

.client-wall__eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cw-brand);
}

.client-wall__title {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--cw-ink);
}

.client-wall__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--cw-muted);
}

/* ---- The grid -----------------------------------------------------------
   Hairlines are the 1px gaps showing the rule colour through — it reads like
   a survey drawing rather than a row of floating cards.
   ------------------------------------------------------------------------ */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  list-style: none;
  background: var(--cw-rule);
}

.client-grid__cell {
  margin: 0;
}

.client-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  min-height: 168px;
  padding: 24px 18px;
  text-align: center;
  text-decoration: none;
  background: var(--cw-tile);
  transition: background 180ms ease, transform 180ms ease;
}

a.client-tile:hover,
a.client-tile:focus {
  text-decoration: none;
}

/* ---- Mark: real logo or monogram fallback ------------------------------- */

/* The mark stacks the monogram and the logo in the same box. The logo sits
   on top; if it fails to load the browser removes it and the monogram is
   revealed. */
.client-tile__mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
}

.client-tile__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 54px;
  max-width: 100%;
  /* Covers the monogram underneath while the logo is present */
  background: var(--cw-tile);
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.55;
  transition: filter 200ms ease, opacity 200ms ease;
}

.client-tile__monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cw-muted);
  border: 1px solid var(--cw-rule);
  transition: color 200ms ease, border-color 200ms ease;
}

/* ---- Name + sector ------------------------------------------------------ */

.client-tile__meta {
  display: block;
}

.client-tile__name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cw-ink);
}

.client-tile__sector {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--cw-muted);
}

/* ---- Hover reveal (pointer devices only) --------------------------------
   On touch there is no hover, so the sector line simply stays visible.
   ------------------------------------------------------------------------ */

@media (hover: hover) and (pointer: fine) {
  .client-tile__sector {
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 200ms ease, transform 200ms ease;
  }

  .client-tile:hover .client-tile__sector,
  .client-tile:focus-visible .client-tile__sector {
    opacity: 1;
    transform: none;
  }
}

.client-tile:hover .client-tile__logo,
.client-tile:focus-visible .client-tile__logo {
  filter: grayscale(0);
  opacity: 1;
}

.client-tile:hover .client-tile__monogram,
.client-tile:focus-visible .client-tile__monogram {
  color: var(--cw-brand);
  border-color: var(--cw-brand);
}

.client-tile:focus-visible {
  outline: 2px solid var(--cw-brand);
  outline-offset: -2px;
}

/* ---- Footer line -------------------------------------------------------- */

.client-wall__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 0;
  font-size: 14px;
  color: var(--cw-muted);
}

.client-wall__count {
  font-weight: 700;
  color: var(--cw-ink);
}

.client-wall__cta {
  font-weight: 600;
  color: var(--cw-brand);
}

.client-wall__cta:hover,
.client-wall__cta:focus {
  color: var(--cw-ink);
  text-decoration: none;
}

/* ---- Small screens ------------------------------------------------------ */

@media (max-width: 767px) {
  .client-wall {
    padding: 60px 0 52px;
  }

  .client-wall__title {
    font-size: 26px;
  }

  .client-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .client-tile {
    min-height: 140px;
    padding: 20px 12px;
  }

  .client-tile__mark,
  .client-tile__logo {
    height: 42px;
    max-height: 42px;
  }

  .client-tile__monogram {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .client-tile,
  .client-tile__logo,
  .client-tile__monogram,
  .client-tile__sector {
    transition: none;
  }
}