
.smartlink-ad {
  position: relative;
  background: #211a1d;
}

.smartlink-ad a {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: inherit;
}

.smartlink-ad img {
  display: block;
  width: 100%;
  height: auto;
}

.smartlink-ad--header,
.smartlink-ad--footer {
  width: 100%;
  height: var(--smartlink-ad-header-height);
}

.smartlink-ad--header a,
.smartlink-ad--header img,
.smartlink-ad--footer a,
.smartlink-ad--footer img {
  height: 100%;
}

.smartlink-ad--header img,
.smartlink-ad--footer img {
  object-fit: cover;
  object-position: center 20%;
}

.smartlink-ad--footer {
  margin-top: 20px;
}

.smartlink-ad--left,
.smartlink-ad--right {
  position: fixed;
  /* Above home navigation (30), below dialogs (40+) and the menu (90). */
  z-index: 35;
  bottom: calc(80px + env(safe-area-inset-bottom));
  width: clamp(128px, 36vw, 176px);
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgb(0 0 0 / 30%);
  will-change: transform;
}

.smartlink-ad--left {
  left: max(8px, env(safe-area-inset-left));
}

.smartlink-ad--right {
  right: max(8px, env(safe-area-inset-right));
}

.smartlink-ad__close {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
}

.smartlink-ad a:focus-visible,
.smartlink-ad__close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (min-width: 760px) {
  .smartlink-ad--left,
  .smartlink-ad--right {
    bottom: 50%;
    width: clamp(200px, 20vw, 240px);
    transform: translateY(50%);
  }

  .smartlink-ad--left {
    left: max(16px, calc(50% - 444px));
  }

  .smartlink-ad--right {
    right: max(16px, calc(50% - 444px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .smartlink-ad--left,
  .smartlink-ad--right {
    will-change: auto;
  }
}

.smartlink-ad--header { width: min(100%, 480px); height: clamp(110px, 32vw, 200px); margin: 0 auto; }
.smartlink-ad__close { cursor: pointer; }
