/* First-party bottom advertisement; no changes to existing page/header/hero styles. */
:root {
  --cw-bottom-ad-ratio: 0.13046875;
  --cw-bottom-ad-width: min(960px, calc(100vw - 16px), 122.634731vw);
  --cw-bottom-ad-image-height: calc(var(--cw-bottom-ad-width) * var(--cw-bottom-ad-ratio));
  --cw-bottom-ad-safe: env(safe-area-inset-bottom, 0px);
  --cw-bottom-ad-height: calc(var(--cw-bottom-ad-image-height) + 23px + var(--cw-bottom-ad-safe));
}

/* Limit the banner on short/landscape screens without cropping or stretching it. */
@supports (width: min(1px, 1vh)) {
  :root {
    --cw-bottom-ad-width: min(960px, calc(100vw - 16px), 122.634731vh);
  }
}
@supports (height: 1svh) {
  :root {
    --cw-bottom-ad-width: min(960px, calc(100vw - 16px), 122.634731svh);
  }
}

html {
  scroll-padding-bottom: calc(var(--cw-bottom-ad-height) + 12px);
}

#cw-sticky-bottom-ad-space {
  display: block;
  box-sizing: border-box;
  height: var(--cw-bottom-ad-height);
  min-height: var(--cw-bottom-ad-height);
  width: 100%;
  flex: 0 0 var(--cw-bottom-ad-height);
  pointer-events: none;
}

#cw-sticky-bottom-ad {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--cw-bottom-ad-height);
  margin: 0;
  padding: 6px 8px calc(6px + var(--cw-bottom-ad-safe));
  background: #06121b;
  box-shadow: 0 -1px 0 rgba(200, 225, 232, 0.18);
  pointer-events: none;
}

#cw-sticky-bottom-ad .cw-bottom-ad-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: var(--cw-bottom-ad-width);
  height: auto;
  margin: 0;
  padding: 0;
}

#cw-sticky-bottom-ad .cw-bottom-ad-label {
  display: block;
  height: 8px;
  margin: 0;
  padding: 0;
  color: #c3cdd4;
  font: 500 8px/8px Arial, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#cw-sticky-bottom-ad .cw-bottom-ad-image {
  display: block;
  width: var(--cw-bottom-ad-width);
  max-width: 100%;
  height: var(--cw-bottom-ad-image-height);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
}

#cw-sticky-bottom-ad .cw-bottom-ad-link {
  display: block;
  width: var(--cw-bottom-ad-width);
  max-width: 100%;
  height: var(--cw-bottom-ad-image-height);
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 0;
  text-decoration: none;
  pointer-events: auto;
}

#cw-sticky-bottom-ad .cw-bottom-ad-link:focus-visible {
  outline: 2px solid #dafa56;
  outline-offset: 3px;
}

@media print {
  #cw-sticky-bottom-ad,
  #cw-sticky-bottom-ad-space {
    display: none !important;
  }
  html {
    scroll-padding-bottom: 0;
  }
}
