/* CookieChimp owns the height; do not also reserve core embed space. */
.wp-embed-responsive .wp-block-embed.wp-has-aspect-ratio
  .wp-block-embed__wrapper:has(> [data-service][data-autoscale])::before,
.wp-embed-responsive .wp-block-embed.wp-has-aspect-ratio
  .wp-block-embed__wrapper:has(> [data-service][data-widget])::before {
  content: none;
  padding-top: 0;
}

/* Isolate Cover layering from CookieChimp's own positioned notice elements. */
.wp-block-cover:has(> .wp-block-cover__embed-background [data-service][data-autoscale]) {
  isolation: isolate;
}

/* Size against the Cover, not the viewport or CookieChimp's ratio spacer. */
.wp-block-cover > .wp-block-cover__embed-background:has([data-service][data-autoscale]) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  container-type: size;
  overflow: hidden;
  z-index: 0;
}

.wp-block-cover__embed-background .wp-block-embed__wrapper:has(> [data-service][data-autoscale]),
.wp-block-cover__embed-background [data-service][data-autoscale],
.wp-block-cover__embed-background [data-service][data-autoscale] > .cll {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  max-width: none;
  max-height: none;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* CookieChimp keeps the iframe inside .cll. Crop at the video's ratio instead
   of stretching it to the Cover ratio or using core's viewport-sized iframe.
   Important geometry overrides SDK inline sizing, without moving its DOM. */
.wp-block-cover > .wp-block-cover__embed-background [data-service][data-autoscale] > .cll > iframe {
  position: absolute !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  width: max(100cqw, calc(100cqh * var(--tu-cookie-chimp-cover-ratio, 1.7777777778))) !important;
  height: max(100cqh, calc(100cqw / var(--tu-cookie-chimp-cover-ratio, 1.7777777778))) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none;
}

/* Temporarily lift the interactive notice above the dimmer and Cover content.
   Once CookieChimp inserts an iframe, core's background stacking takes over.
   Withdrawal removes the iframe and makes the notice interactive again. */
.wp-block-cover > .wp-block-cover__embed-background:has([data-service][data-autoscale]):not(:has(iframe)) {
  z-index: 2 !important;
  pointer-events: auto !important;
}

/* Separate from c-l-b so CookieChimp cannot mistake navigation for consent. */
[data-service] .c-n-a .tu-cookie-chimp-source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .975em 1.1em;
  border: 1px solid #fff;
  border-radius: 0.3125em;
  background: transparent;
  color: #fff;
  font-size: .77em;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}

[data-service] .c-n-a .tu-cookie-chimp-source-button:hover {
  text-decoration: underline;
}

[data-service] .c-n-a .tu-cookie-chimp-source-button::after {
  content: '';
  flex: 0 0 1em;
  width: 1em;
  height: 1em;
  margin-inline-start: 0.5em;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

[data-service] .c-n-a .tu-cookie-chimp-source-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
