// This file should only include screen-only
// styles for the viewer that do not persist when
// printing, but does not yet

:root {
  --bindery-ui-bg: #f4f4f4;
  --bindery-ui-accent: black;
  --bindery-ui-text: black;
}

@media screen {
  .root {
    transition: opacity 0.2s;
    opacity: 1;
    background: var(--bindery-ui-bg);
    z-index: 99;
    position: relative;
    min-height: 100vh;
  }

  .progress-bar {
    transform-origin: top left;
    transform: scaleY(0);
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    background: var(--bindery-ui-accent);
    transition: transform 0.2s;
    height: 2px;
    z-index: 99;
    .in-progress & {
      transform: scaleX(0);
    }
  }

  .zoom-content {
    padding: 10px;
    background: var(--bindery-ui-bg);
    margin: auto;
    .view-preview & {
      min-width: calc(20px + var(--bindery-spread-width));
    }
    .view-print & {
      min-width: calc(20px + var(--bindery-sheet-width));
    }
    > .page {
      margin: auto; // center pages not in a spread yet;
    }
  }

  .measure-area {
    position: fixed;
    padding: 50px 20px;
    z-index: 99;
    visibility: hidden;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .is-overflowing {
    border-bottom: 1px solid magenta;
  }

  .print-sheet {
    margin: 0 auto;
  }

  .error {
    font: 16px / 1.4 $system;
    padding: 15vh 15vw;
    z-index: 999;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(244, 244, 244, 0.7);

    &-title {
      font-size: 1.5em;
      margin-bottom: 16px;
    }
    &-text {
      margin-bottom: 16px;
      white-space: pre-line;
    }
    &-footer {
      opacity: 0.5;
      font-size: 0.66em;
      text-transform: uppercase;
      letter-spacing: 0.02em;
    }
  }

  .show-bleed .print-sheet {
    background: white;
    outline: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
    margin: 20px auto;
  }
}

@media screen {
  .page {
    background: white;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3);
    overflow: hidden;

    .show-bleed & {
      box-shadow: none;
      overflow: visible;
      &:after {
        content: '';
        outline: 1px dotted rgba(0, 255, 255, 0.7);
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        z-index: 99;
      }
    }
  }

  .placeholder-num {
    visibility: hidden !important;
  }
}

.print-sheet {
  width: var(--bindery-sheet-width);
  height: var(--bindery-sheet-height);
}

.page-bleed-clip {
  overflow: hidden;
}

.page-bleed-clip-left {
  padding-left: calc(var(--bindery-bleed) + 12pt);
}

.page-bleed-clip-right {
  padding-right: calc(var(--bindery-bleed) + 12pt);
}

.show-crop .print-sheet .page-bleed-clip,
.show-bleed-marks .print-sheet .page-bleed-clip {
  padding-top: calc(var(--bindery-bleed) + 12pt);
  padding-bottom: calc(var(--bindery-bleed) + 12pt);
}

.spread-wrapper {
  .print-sheet-spread & {
    margin-left: auto;
    margin-right: auto;
  }
}

.viewing {
  margin: 0;
}

.zoom-scaler {
  transform-origin: top left;
  transform-style: preserve-3d;
}

.print-sheet {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;

  transition: all 0.2s;
}

.print-sheet-left {
  justify-content: left;
}

.print-sheet-right {
  justify-content: right;
}

.spread-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  margin: auto;
}

.spread-centered {
  margin: 0 auto 32px;
}
