.customiframe {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #F1F1F1;
}

/* WP responsive embeds size the wrapper via ::before; fill that box. */
.wp-block-embed__wrapper > .customiframe {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
}

.customiframe__fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 1.6rem;
  background-color: #F1F1F1;
  color: #000;
  font-size: 1.6rem;
  line-height: 2.1rem;
  text-align: center;
}

.customiframe__fallback[hidden] {
  display: none;
}

.customiframe__fallback-text {
  margin: 0;
  max-width: 36em;
}

.customiframe__fallback-button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.customiframe__fallback-button:hover,
.customiframe__fallback-button:focus {
  color: #9E0185;
}

.customiframe:not(.is-allowed) > iframe {
  visibility: hidden;
}

.customiframe.is-allowed {
  background-color: transparent;
}

/* Keep WP absolute iframe fill working inside our wrap. */
.wp-embed-responsive .wp-has-aspect-ratio .customiframe > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}
