.partner-wrapper {
  --partner-accent: #6ed1ed;

  position: relative;
  isolation: isolate;
  flex-shrink: 0;
  width: 338px;
  height: 430px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  color: var(--color-white);
  background-color: var(--color-brand-blue);
  border-radius: 25px;
  transition: background-color 220ms ease, color 220ms ease;
}

/* Print texture stays at the edges, away from logo details. */
.partner-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, currentColor 1px, transparent 1.2px);
  background-size: 6px 6px;
  mask-image: linear-gradient(90deg, #000000, transparent 18%, transparent 82%, #000000);
  opacity: 0.16;
}

.partner-logo-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: transparent;
  border-radius: 16px;
  overflow: hidden;
}

.partner-logo-wrapper img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: contain;
  filter: url('partner-duotone.svg#duotone');
  transform: translate(-50%, -50%);
}

.partner-text-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
}

.partner-name {
  text-align: center;
  text-transform: capitalize;
}

.partner-country {
  color: var(--partner-accent);
  transition: color 220ms ease;
}

.partner-name a,
.partner-name a:hover,
.partner-name a:focus-visible {
  color: inherit;
}

/* Stretch the Drupal-rendered website link, retaining one native focus target. */
.partner-name a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.partner-wrapper--linked:focus-within {
  background-color: #747d87;
  box-shadow: inset 0 0 0 2px var(--color-white);
}

.partner-wrapper--linked:focus-within img {
  filter: none;
}

.partner-wrapper--linked:focus-within::before {
  opacity: 0;
}

.partner-wrapper--linked:focus-within .partner-country {
  color: var(--color-white);
}

@media (hover: hover) {
  .partner-wrapper--linked:hover {
    background-color: #747d87;
  }

  .partner-wrapper--linked:hover img {
    filter: none;
  }

  .partner-wrapper--linked:hover::before {
    opacity: 0;
  }

  .partner-wrapper--linked:hover .partner-country {
    color: var(--color-white);
  }
}

@media screen and (width <= 1024px) {
  .partner-wrapper {
    width: 280px;
    height: 380px;
    padding: 20px;
  }
}

@media screen and (width <= 480px) {
  .partner-wrapper {
    width: 200px;
    height: 340px;
    padding: 16px;
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .partner-wrapper,
  .partner-country {
    transition: none;
  }
}
