/* Sponsored placement cards. Homepage shortcuts share the home-directory grid;
   each top promotion occupies one cell and counts toward the ten-entry limit. */

.direct-grid > .ml-ad-top {
  grid-column: auto;
}

.ml-ad-logo {
  box-sizing: border-box;
  object-fit: contain;
  background: #fff;
}

.direct-grid > .ml-ad-top .ml-ad-logo {
  width: 40px;
  height: 40px;
  justify-self: center;
}

.direct-grid > .ml-ad-top .site-card-name {
  align-self: center;
}

.direct-grid > .ml-ad-top .site-card-name,
.direct-grid > .ml-ad-top .ml-ad-summary,
.ml-ad-card .site-card-name {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.direct-grid > .ml-ad-top .ml-ad-summary {
  display: none;
}

.ml-ad-top:focus-visible,
.ml-ad-card:focus-visible,
.context-links a.ml-ad-hub:focus-visible {
  outline: 2px solid var(--accent-dark, #9c1f4b);
  outline-offset: 2px;
}

.ml-ad-card .ml-ad-logo {
  width: 72px;
  height: 44px;
  padding: 3px;
  flex: 0 0 auto;
}

.ml-ad-card .site-card-desc {
  -webkit-line-clamp: unset;
  max-height: 140px;
}

body.hide-card-desc .ml-ad-card .site-card-desc {
  max-height: 0;
  margin-top: -4px;
  opacity: 0;
  visibility: hidden;
}

.context-links a.ml-ad-hub {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  min-width: 0;
}

.context-links a.ml-ad-hub .ml-ad-logo {
  width: 96px;
  height: 56px;
  padding: 4px;
  border: 1px solid #e6e9f0;
  border-radius: 8px;
}

.context-links a.ml-ad-hub h3,
.context-links a.ml-ad-hub p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.context-links a.ml-ad-hub h3 {
  margin: 0;
  color: #17212b;
  font-size: 16px;
  line-height: 1.35;
}

.context-links a.ml-ad-hub p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted, #667085);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .direct-grid > .ml-ad-top .ml-ad-logo {
    width: 30px;
    height: 30px;
  }

  .ml-ad-card .ml-ad-logo {
    width: 64px;
    height: 40px;
  }

  .ml-ad-card,
  .ml-ad-card .site-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .context-links a.ml-ad-hub {
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 8px;
  }

  .context-links a.ml-ad-hub .ml-ad-logo {
    width: 72px;
    height: 42px;
  }
}
