// iframe for charts
.outputpane-iframe {
  flex: 0 0 auto;
  position: relative;
  background: white;
  $iframe-padding: 1.6rem;
  height: 100%;

  &.has-height-from-iframe:not(.height-0) {
    max-height: 50%;
    box-sizing: content-box;
    padding: $iframe-padding; // contribute to height
    // `height:` will be overridden in `style`
  }

  iframe {
    border: 0;
    position: absolute;
    top: $iframe-padding;
    left: $iframe-padding;
    // [adamhooper, 2021-01-20, Chrome 87 on Linux] right: and bottom: don't affect
    // width+height here. Use width: and height: instead.
    width: calc(100% - 2 * #{$iframe-padding});
    height: calc(100% - 2 * #{$iframe-padding});
  }

  button[name='embed'] {
    // Appear alongside the vega-embed@6 context button
    position: absolute;
    top: $iframe-padding;
    right: calc(#{$iframe-padding} + 48px);

    // BEGIN copy/paste from Vega's own stylesheet
    background: white;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    color: #1b1e23;
    border: 1px solid #aaa;
    border-radius: 999px;
    opacity: 0.2;
    transition: opacity 0.4s ease-in;
    outline: none;
    cursor: pointer;
    line-height: 0px;
    // END copy/paste

    // vega-embed@6 icon is 14*14, with 6px padding. Our SVG is optimized for
    // 16x16, so we set 5px padding.
    padding: 5px;
    font-size: 1.6rem;

    &:hover {
      opacity: 1;
    }
  }
}
