/*
 * The Pizza Guys wordmark is much wider than the other client marks. Give its
 * native Image block enough room to have comparable visual weight, replacing
 * the legacy 80px / 68px first-logo cap. Target the asset rather than its order
 * so the same rule works in the page editor and when the logos are rearranged.
 */
.tt-client-logos figure.wp-block-image:has(img:is([src*="/pizza-guys"], [alt="Pizza Guys" i])) {
  width: 220px;
  max-width: 220px;
  flex-basis: 220px;
}

/* Phones use equal logo slots. The wider Pizza Guys wordmark must not consume
 * two slots or inherit its larger desktop width. An odd final mark is centred
 * without being enlarged; this also works when the editor reorders the logos. */
@media (max-width: 650px) {
  .tt-client-logos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 24px;
  }

  .tt-client-logos figure.wp-block-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 160px;
    min-height: 56px;
    margin: 0;
    justify-self: center;
  }

  .tt-client-logos figure.wp-block-image:has(img:is([src*="/pizza-guys"], [alt="Pizza Guys" i])) {
    width: 100%;
    max-width: 160px;
    flex-basis: auto;
  }

  .tt-client-logos figure.wp-block-image:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: min(160px, calc((100% - 24px) / 2));
  }

  .tt-client-logos figure.wp-block-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 52px;
    object-fit: contain;
  }
}
