/* Import all components */
@import 'themes/default/globals/site.variables';
@import 'themes/pxt/globals/site.variables';

/* Reference import */
@import (reference) "semantic.less";

/*******************************
         Side docs
*******************************/

/* Side Docs layout */
#sidedocs {
  top: 0;
  z-index: @sidedocZIndex;
  visibility: hidden;
  opacity: 0;
  right: 0;
  width: 0;
}

code.hljs {
    background: none;
}

#sidedocsbar {
  position: absolute;
  right: 1rem;
}

#sidedocsframe {
  width: 0;
  height: 0;
  border:none;
  background: white;
}

/* Side docs toggle button */
#sidedocstoggle {
  right: 0;
  left: auto;
}

.sideDocs #sidedocs {
    position: fixed;
    visibility: visible;
    opacity: 1;
    width: @sideBarWidth;
    top: calc(@mainMenuHeight + 1rem);
    height: ~"calc(100% - @{mainMenuHeight} - @{editorToolsCollapsedHeight} - 2rem)";
}

.sideDocs #sidedocsframe-wrapper {
    position: relative;
    -webkit-overflow-scrolling: touch;
    overflow: auto;
    width: @sideBarWidth;
    height: 100%;
    -webkit-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.41);
    -moz-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.41);
    box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.41);
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    z-index: @sidedocZIndex;

    &:has(aside:focus-visible) {
        outline: @editorFocusBorderSize solid  var(--pxt-focus-border);
    }
}

.sideDocs #sidedocsframe {
  position:absolute;
  top:0px;
  width:100%;
  height:100%;
}

.sideDocs #sidedocstoggle {
   right: @sideBarWidth;
   transition: right 0.5s, opacity 0.5s linear;
}

.sideDocs #sidedocsbar {
    top: 1rem;
    z-index: @sidedocZIndex+1;
}

#sidedocsbar .ui.link .icon {
  cursor: pointer;
  font-size: @h3;
}

/* Sidedocs in Monaco editor */
.sideDocs.editorlang-text {
    #sidedocs {
        width: 50%!important;
        min-width: 18rem;
    }

    #sidedocsframe, #sidedocsframe-wrapper {
        width: 100%!important;
    }

    #sidedocstoggle {
        right: calc(~'50% - 0.5rem')!important;
    }

    @media only screen and (max-width: 36rem) {
        #sidedocstoggle {
            right: 17rem!important;
        }
    }
}

/* Large Monitor */
@media only screen and (min-width: @largeMonitorBreakpoint) {
    .sideDocs #sidedocs, .sideDocs #sidedocsframe, .sideDocs #sidedocsframe-wrapper {
        width: @sideBarWidthLarge !important;
    }
    .sideDocs #sidedocstoggle {
        right: @sideBarWidthLarge !important;
    }
}

/* Small Monitor */
@media only screen and (min-width: @computerBreakpoint) and (max-width: @largestSmallMonitor) {

}

/* Tablet */
@media only screen and (min-width: @tabletBreakpoint) and (max-width: @largestTabletScreen) {

}

/* Mobile */
@media only screen and (max-width: @largestMobileScreen) {

}

/* >= Small Monitor (Small Monitor + Large Monitor + Wide Monitor) */
@media only screen and (min-width: @computerBreakpoint) {
}

/* <= Small Monitor (Mobile + Tablet + Small Monitor) */
@media only screen and (max-width: @largestSmallMonitor) {

}

/* <= Tablet (Mobile + Tablet) */
@media only screen and (max-width: @largestTabletScreen) {
    .sideDocs #sidedocs {
        top: calc(@mobileMenuHeight + 1rem);
        height: ~"calc(100% - @{mobileMenuHeight} - @{editorToolsHeight} - 2rem)";
    }
    .sideDocs.collapsedEditorTools #sidedocs, .sideDocs.hideEditorFloats #sidedocs {
        height: ~"calc(100% - @{mobileMenuHeight} - @{editorToolsCollapsedHeight} - 2rem)";
    }
}

/* Mobile */
@media only screen and (max-width: @largestMobileScreen) {
    .sideDocs #sidedocs, .sideDocs #sidedocsframe, .sideDocs #sidedocsframe-wrapper {
        width: @sideBarWidthSmall !important;
    }
    .sideDocs #sidedocstoggle {
        right: @sideBarWidthSmall !important;
    }
}

@media only screen and (max-height: @tallEditorBreakpoint) and (min-width: @largestMobileScreen) {
    .sideDocs #sidedocs {
        top: calc(@thinMenuHeight + 1rem);
    }
}