/* [pd_interactive] embeds - see includes/pd-interactive.php */

.pd-interactive {
  position: relative;
  margin: 0 0 1.5em;
}

.pd-interactive__frame {
  display: block;
  width: 100%;
  border: 0;
  background: #000;
}

/* Space reserved until the script measures the content */
.pd-interactive--auto .pd-interactive__frame {
  height: 80vh;
}

/* Break out of the content column. The script sets the exact offset and width
   (so it also works when the column is not centred, e.g. beside a sidebar);
   this is the fallback without it. */
.pd-interactive--full {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  z-index: 2;
}

/* Poster with launch button */
.pd-interactive__poster {
  position: relative;
  background: #000;
}

.pd-interactive__poster img {
  display: block;
  width: 100%;
  height: auto;
}

.pd-interactive__launch {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 14px 28px;
  border: 1px solid #fff;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.pd-interactive__launch:hover,
.pd-interactive__launch:focus-visible {
  background: #000;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.pd-interactive--poster:not(.is-launched) .pd-interactive__frame,
.pd-interactive--poster.is-launched .pd-interactive__poster {
  display: none;
}

/* Toolbar: "Full screen" button, above the embed */
.pd-interactive__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 10px;
}

/* Smaller than the theme's default button */
.pd-interactive__bar button {
  font-size: 12px;
  padding: 6px 12px;
}

.pd-interactive__title {
  display: none;
}

.pd-interactive__bar [hidden] {
  display: none !important;
}

/* Full screen: the wrapper covers the window, toolbar across the top.
   Also used inside the browser's real fullscreen when that is available. */
.pd-interactive.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100000; /* above the sticky site header and admin bar */
  display: flex;
  flex-direction: column;
  width: auto !important;
  max-width: none;
  margin: 0 !important;
  background: #000;
}

.pd-interactive.is-fullscreen .pd-interactive__bar {
  order: -1;
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  background: #000;
  border-bottom: 1px solid #333;
}

.pd-interactive.is-fullscreen .pd-interactive__title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pd-interactive.is-fullscreen .pd-interactive__frame {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0;
  border-radius: 0 !important;
}

html.pd-interactive-fs-open {
  overflow: hidden; /* stop the page scrolling behind */
}

.pd-interactive-error {
  padding: 8px 12px;
  border-left: 4px solid #d63638;
  background: #fcf0f1;
  color: #000;
}
