/* ==================================================================
   Evify partner banner.

   Adtraction carries no display creatives for Evify — the programme
   exposes a single "Custom link" ad — so the unit is built here from
   the one official asset it does provide (the logo served from
   adtraction.com/image.htm?imgId=1785427535) and the site's own type.

   Markup comes from the [aff] shortcode, which already emits a tracked
   href with per-page epi attribution and rel="sponsored nofollow". Any
   .smedja-aff that wraps an image is treated as a banner rather than
   as a button.
================================================================== */
.wp-block-post-content a.smedja-aff:has(img) {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.6rem);
  width: 100%;
  box-sizing: border-box;
  /* WordPress constrains band children with a zero-specificity
     :where() rule, which the button rules' max-width:100% overrode —
     the banner spanned the whole 1440px band instead of the reading
     measure. Pin it to the prose width explicitly. */
  max-width: 42rem;
  margin: 2.2rem auto;
  padding: clamp(1rem, 3vw, 1.35rem) clamp(1.1rem, 3vw, 1.6rem);
  border: 1px solid transparent;
  border-radius: var(--et-r-lg, 12px);
  background:
    radial-gradient(120% 160% at 12% 0%, var(--lb-voltage-lift) 0%, transparent 62%),
    linear-gradient(168deg, var(--lb-voltage) 0%, var(--lb-voltage-deep) 100%);
  box-shadow: 0 10px 30px rgb(20 16 43 / 16%);
  color: #fff;
  font-family: var(--et-sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
/* The green edge marks it as commercial, the same signal the toplist
   and the buy buttons use. */
.wp-block-post-content a.smedja-aff:has(img)::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--lb-live);
}
.wp-block-post-content a.smedja-aff:has(img):hover,
.wp-block-post-content a.smedja-aff:has(img):focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgb(20 16 43 / 24%);
  color: #fff;
}

/* The logo sits on a white plate — it is supplied as dark artwork and
   would disappear straight onto the violet. */
.wp-block-post-content a.smedja-aff:has(img) img {
  width: auto;
  height: 34px;
  max-width: 150px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  box-shadow: 0 1px 0 rgb(255 255 255 / 30%);
}

/* The shortcode's trailing arrow becomes the affordance on the right. */
.wp-block-post-content a.smedja-aff:has(img) .smedja-aff__mark {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--lb-live);
  color: #06281C;
  font-weight: 700;
  transition: transform 140ms ease;
}
.wp-block-post-content a.smedja-aff:has(img):hover .smedja-aff__mark { transform: translateX(3px); }

@media (max-width: 34rem) {
  .wp-block-post-content a.smedja-aff:has(img) {
    grid-template-columns: auto 1fr;
    row-gap: 0.7rem;
    font-size: 0.9375rem;
  }
  .wp-block-post-content a.smedja-aff:has(img) .smedja-aff__mark { grid-column: 2; justify-self: end; }
}

/* The background shorthand has to beat the flat violet the button rules
   set, so it is repeated at the winning specificity. */
.wp-block-post-content a.smedja-aff:has(img) {
  background:
    radial-gradient(120% 160% at 12% 0%, var(--lb-voltage-lift) 0%, transparent 62%),
    linear-gradient(168deg, var(--lb-voltage) 0%, var(--lb-voltage-deep) 100%);
  background-color: var(--lb-voltage);
}
