.afp-social-card__media {
  background:
    linear-gradient(135deg, rgba(14, 14, 14, 0.2), rgba(50, 90, 255, 0.25)),
    linear-gradient(45deg, #dfe6f8 0 25%, #c8d4ee 25% 50%, #e9edfd 50% 75%, #b7c4df 75%);
  background-size: cover;
}

.afp-homepage .afp-social-card__media img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  max-width: none;
}

.afp-homepage-social-wall {
  min-height: 931px;
  overflow: hidden;
}

.afp-homepage-social-wall__layout {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  gap: 27px;
  align-items: center;
}

.afp-homepage-social-wall__text {
  max-width: 312px;
}

.afp-homepage-social-wall__text h2 {
  color: #fff;
}

/* YOG-1070: scrollable viewport without visible scrollbars.
   Scroll chaining is handled in JS: at top/bottom the page takes over. */
.afp-homepage-social-wall__viewport {
  height: 931px;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.afp-homepage-social-wall__viewport::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.afp-homepage-social-wall__masonry {
  position: relative;
  min-height: 931px;
}

.afp-social-card {
  position: absolute;
  width: 312px;
  transition: transform 180ms ease;
}

.afp-social-card a {
  position: relative;
  display: block;
  min-height: var(--social-card-height);
  overflow: hidden;
  border-radius: 8px;
  background: #1f1f1f;
}

.afp-social-card__media {
  position: relative;
  display: flex;
  min-height: var(--social-card-height);
  align-items: flex-end;
  padding: 20px;
  color: #fff;
}

.afp-social-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Keep the photo clean: no veil on the upper part, only a light scrim
     at the bottom to anchor the account badge. */
  background: linear-gradient(180deg, rgba(14, 14, 14, 0) 55%, rgba(14, 14, 14, 0.45) 100%);
  pointer-events: none;
}

.afp-homepage .afp-social-card__media img {
  position: absolute;
  inset: 0;
}

.afp-social-card__media--empty {
  background:
    linear-gradient(180deg, rgba(14, 14, 14, 0), rgba(14, 14, 14, 0.72)),
    linear-gradient(135deg, #2d3644, #d56a3f);
}

.afp-social-card__account {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 40px;
  background: #fff;
  color: var(--afp-homepage-text);
  font-size: 0.75rem;
  font-weight: 600;
}

.afp-social-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  flex: 0 0 32px;
}

.afp-social-card__icon--youtube {
  background-image: url("../images/social-youtube.svg");
}

.afp-social-card__icon--instagram {
  background-image: url("../images/social-instagram.svg");
}

.afp-social-card__icon--x {
  background-image: url("../images/social-x.svg");
}

.afp-social-card__icon--facebook {
  background-image: url("../images/social-facebook.svg");
}

@media (max-width: 1023px) {
  .afp-homepage-social-wall {
    min-height: 0;
  }

  .afp-homepage-social-wall__layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .afp-homepage-social-wall__text {
    max-width: none;
  }

  .afp-homepage-social-wall__viewport {
    height: auto;
    overflow: visible;
  }

  .afp-homepage-social-wall__masonry {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--afp-homepage-gap);
    min-height: 0;
  }

  .afp-social-card {
    position: static;
    width: auto;
  }
}

@media (max-width: 767px) {
  .afp-homepage-social-wall__masonry {
    grid-template-columns: 1fr;
  }
}
