/**
 * Brand Logos block (atsko/brand-logos).
 *
 * Full-bleed strip of brand marks. Logos render grayscale and return to colour
 * on hover / keyboard focus. Grew out of the About "Brand logos" row
 * (Figma Company • Desktop, 32:762).
 *
 * @package Atsko
 */

.brand-logos {
  padding: 7.5rem max(2rem, calc((100% - var(--atsko-container)) / 2));
  background: var(--atsko-white);
  box-sizing: border-box;
}

.brand-logos.alignfull {
  width: 100%;
  max-width: none;
}

/*
 * Break out of a constrained wrapper. Skipped inside .page-main__content, which
 * is already full width — 100vw counts the scrollbar and would overflow there.
 */
.container .brand-logos.alignfull,
.entry-content:not(.page-main__content) .brand-logos.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.brand-logos__row,
.brand-logos__names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.brand-logos__row {
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--atsko-gray-400);
}

.brand-logos__names {
  justify-content: center;
  gap: 0.5rem 3rem;
  padding: 0.5rem 0 0;
}

.brand-logos__row:only-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.brand-logos__logo,
.brand-logos__name {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.brand-logos__logo {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 4rem;
}

.brand-logos__name {
  flex: 0 0 auto;
}

.brand-logos__link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.brand-logos img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.75;
  transition:
    filter 0.2s ease,
    opacity 0.2s ease;
}

.brand-logos__logo img {
  max-height: 2.5rem;
}

.brand-logos__name img {
  width: 7.25rem;
  max-height: none;
}

/*
 * Colour returns on hover and keyboard focus. Coarse pointers skip :hover so a
 * first tap follows the link instead of sticking the hover state.
 */
@media (hover: hover) {
  .brand-logos__logo:hover img,
  .brand-logos__name:hover img,
  .brand-logos__link:focus-visible img {
    filter: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logos img {
    transition: none;
  }
}

@media (max-width: 900px) {
  .brand-logos {
    padding: 4rem 1.5rem;
  }

  .brand-logos__row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 2rem;
  }
}
