.accreditation-logos {
  padding: 60px 0;
}

/* Title, button and grid share one flex row so the button can move below the
   logos on mobile without being duplicated in the markup. */
.accreditation-logos .acc-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.accreditation-logos .acc-title {
  order: 1;
  flex: 1 1 auto;
  margin: 0 20px 0 0;
  font-size: 34px;
  font-weight: 500;
  color: #1a1a1a;
}

/* Appearance and hover come from the theme's .view-more; only placement is set here. */
.accreditation-logos .acc-link {
  order: 2;
  margin-left: auto;
  white-space: nowrap;
}

.accreditation-logos .acc-grid {
  order: 3;
  flex: 0 0 100%;
  width: 100%;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

/* Every cell draws its own four sides and pulls back a pixel, so shared edges
   collapse into one line and a part-filled last row leaves no border hanging. */
.accreditation-logos .logo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 30px 20px;
  background: #fff;
  border: 1px solid #e3e3e3;
  margin: -1px 0 0 -1px;
}

.accreditation-logos .logo-cell img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}

.accreditation-logos .logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease-in-out;
}

.accreditation-logos .logo-link:hover {
  opacity: 0.65;
}

@media (max-width: 1199.98px) {
  .accreditation-logos .acc-title {
    font-size: 28px;
  }
}

@media (max-width: 991.98px) {
  .accreditation-logos .acc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767.98px) {
  .accreditation-logos {
    padding: 40px 0;
  }
  .accreditation-logos .acc-title {
    flex: 0 0 100%;
    margin: 0;
    font-size: 24px;
  }
  .accreditation-logos .acc-grid {
    order: 2;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 22px;
  }
  /* Below the logos on mobile. */
  .accreditation-logos .acc-link {
    order: 3;
    flex: 0 0 100%;
    margin: 24px 0 0;
    display: flex;
    justify-content: center;
  }
  /* A floor, not a fixed height - a tall logo still grows its cell. */
  .accreditation-logos .logo-cell {
    min-height: 100px;
    padding: 22px 14px;
  }
}
