.viewer-layout {
  height: 100vh;
  display: grid;
  grid-template-rows: 48px auto;
  grid-template-columns: 1fr;
  user-select: none;

  .viewer-header {
    grid-column: 1 / span 1;
    grid-row: 1 / span 1;
  }

  .viewer-content {
    grid-column: 1 / span 1;
    grid-row: 2 / span 1;
  }
}

.fullscreen.viewer-layout.force-visible {
  grid-template-rows: 1fr;
  & .viewer-header {
    position: fixed;
    top: 0;
    transition: top 400ms ease 300ms;
    margin-bottom: 0;
    z-index: 2;
  }

  & .viewer-bottom {
    position: fixed;
    bottom: 0;
    transition: bottom 400ms ease 300ms;
    z-index: 2;
  }
}

.fullscreen.viewer-layout:not(.force-visible) {
  grid-template-rows: 1fr;
  & .viewer-header {
    width: 100%;
    position: fixed;
    top: -48px;
    left: 0;
    transition: top 400ms ease 300ms;
    z-index: 2;
    margin-bottom: 48px;
    &::after {
      content: " ";
      position: absolute;
      width: 100%;
      height: 1rem;
      left: 0;
      top: 48px;
    }
  }

  & .viewer-header:hover {
    top: 0;
    transition: top 200ms;
  }

  & .viewer-bottom {
    width: 100%;
    position: fixed;
    bottom: -48px;
    left: 0;
    transition: bottom 400ms ease 300ms;
    z-index: 2;
    &::after {
      content: " ";
      position: absolute;
      width: 100%;
      height: 1rem;
      left: 0;
      bottom: 0px;
    }
  }

  & .viewer-bottom:hover {
    bottom: 0px;
    transition: bottom 200ms;
  }

  & .viewer-content {
    grid-row: 1 / span 2;
  }
}

.viewer-overlay {
  position: absolute;
}

.viewer-overlay-background {
  position: absolute;
  top: 0;
  left: 0;

  &.visible {
    background-color: rgb(0, 0, 0, 0.2);
  }
}
