/* EDT shared ad behavior: empty Adcash slots must not reserve page space.
   Loaded banners retain their existing size, styling and responsive scaling.
   The shared edt-responsive-ads.js marks an ad filled only when a creative exists. */
.edt-ad-728:not(.edt-ad-filled),
.edt-modern-page .edt-ad-728:not(.edt-ad-filled),
.edt-home .edt-leaderboard-promo.edt-ad-728:not(.edt-ad-filled),
.edt-directory-ad-wrap.edt-ad-728:not(.edt-ad-filled) {
  height: 0 !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border: 0 !important;
}
/* Mobile-only placements have no fixed size, but their margins can still
   create a visible gap when an ad blocker prevents a creative from loading. */
.edt-leaderboard-promo-mobile:not(.edt-ad-filled),
body .edt-leaderboard-promo-mobile:not(.edt-ad-filled),
.edt-modern-page .edt-modern-mobile-ad:not(.edt-ad-filled) {
  height: 0 !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* A rendered mobile creative must also stay inside the narrow password-tool
   content column (the ad service can return an oversized image). */
@media (max-width: 500px) {
  .edt-leaderboard-promo-mobile { overflow: hidden; }
  .edt-leaderboard-promo-mobile img { max-width: min(100%, calc(100vw - 72px)) !important; height: auto; }
}

/* Password-tool ads: center actual Adcash creatives and round their visible
   edges, not just their otherwise transparent full-width slot.  Adcash can
   insert an iframe, image, link, or wrapper element depending on the campaign. */
.edt-leaderboard-promo.edt-ad-728 {
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}
.edt-leaderboard-promo.edt-ad-728 .edt-ad-canvas {
  border-radius: 18px;
  overflow: hidden;
}
/* A creative can be smaller than the canvas or render through an iframe.
   Clip it to the same 18px curve as the slot, on both screen sizes. */
.edt-leaderboard-promo.edt-ad-728 .edt-ad-canvas > :is(a, iframe, img, div, ins) {
  border-radius: 18px !important;
  overflow: hidden !important;
}

@media (max-width: 500px) {
  /* The second (728px) ad uses the same compact spacing as the mobile-only ad. */
  .edt-leaderboard-promo.edt-ad-728.edt-ad-filled {
    margin-top: 14px !important;
    margin-bottom: 14px !important;
  }
  body .edt-leaderboard-promo-mobile.edt-ad-filled {
    display: flex;
    justify-content: center !important;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    margin: 14px auto !important;
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: visible;
  }

  /* Rounded clipping must be on the creative itself: a 320px banner inside
     a 380px slot otherwise keeps square corners and appears left-aligned. */
  body .edt-leaderboard-promo-mobile.edt-ad-filled > :is(a, iframe, img, div, span, ins),
  body .edt-leaderboard-promo-mobile.edt-ad-filled > :is(a, div, span, ins) > :is(a, iframe, img, div) {
    box-sizing: border-box;
    display: block;
    flex-shrink: 1;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  body .edt-leaderboard-promo-mobile.edt-ad-filled a,
  body .edt-leaderboard-promo-mobile.edt-ad-filled iframe,
  body .edt-leaderboard-promo-mobile.edt-ad-filled img {
    max-width: 100% !important;
    border-radius: 18px !important;
  }
}
