.Pen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  overflow: hidden;
  background: white;

  &.is-resizing {
    cursor: grabbing;

    .Pen-handle {
      cursor: grabbing;
    }
  }
}

.Pen-variants {
  position: relative;
  z-index: 99;
  margin: 0 $handle-size;
  display: flex;
  overflow-x: auto;
  flex: 0 0 auto;

  > a.Pen-variant-link {
    text-decoration: none;
    display: inline-block;
    padding: 0.75rem;
    border-top: 1px solid transparent;
    border-right: 1px solid transparent;
    border-left: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    flex-shrink: 0;

    &.active {
      background-color: $color-background;
      border-color: $color-frame-border;
      color: #000000;
    }
  }
}

.Pen-header {
  display: flex;
  flex: 0 0 auto;
  max-height: 3rem;
  padding: 0.75rem;
  align-items: center;

  .Status {
    @include margin-inline(start, auto);
    @include padding-inline(start, 0.5rem);
  }

  @include mq($until: navCollapse) {
    margin: 0;
    border-bottom: 1px solid $color-frame-border;
    padding: 0.75rem;

    .Status .Status-label {
      position: relative;
      height: 0;
      width: 0;
      overflow: hidden;
      background-color: #ffffff !important;
      border-radius: 100%;
      border-style: solid;
      border-width: 0.125rem;
      padding: 0.25rem;
      color: transparent !important;
    }
  }
}

.Pen-title {
  @include font(subHeading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.Pen-previewLink {
  @include link-default($color-heading, none);

  svg {
    fill: $color-link;
    opacity: 0.75;
  }

  &:hover svg {
    opacity: 1;
  }
}

.Pen-preview {
  flex: 0 0 auto;
  height: 50%;
  max-height: calc(100% - 3.75rem);
  margin: 0 $handle-size;
  top: -1px;

  @include mq($until: navCollapse) {
    flex: 1 1 auto;
    height: auto !important;
    max-height: 100%;
    margin: 0;
  }

  &.loading {
    .Preview-wrapper {
      &::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background-color: #ffffff;
        background-image: url('../img/loader.svg');
        background-repeat: no-repeat;
        background-position: 50%;
      }
    }
  }
}

.Pen-handle {
  @include dragHandle;
  flex: 0 0 auto;
  height: $handle-size;
  margin: 0 $handle-size;
  background: transparent url('../img/icon-drag--horizontal.svg') no-repeat 50%
    50%;
  background-size: 16px 3px;
  cursor: ns-resize;

  @include mq($until: navCollapse) {
    display: none;
  }
}

.Pen-handle--browser {
  display: block;
  pointer-events: all;
  visibility: visible;
}

.Pen-info {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  margin: $handle-size;
  margin-top: 0;
  border: 1px solid $color-frame-border;

  @include mq($until: navCollapse) {
    display: none;
  }

  &.loading {
    .Browser {
      &::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background-color: #ffffff;
        background-image: url('../img/loader.svg');
        background-repeat: no-repeat;
        background-position: 50%;
      }
    }
  }
}
