/* RVBD:
      Optimize text rendering. 
      Add box-shadow to layout_div which stretches 100% of viewport.
      Add height to layout_wide and layout_narrow to tighten up whitespace below toolbar in wide layouts.
*/
body {
    text-rendering: optimizeLegibility;
    overflow: hidden;
}

.layout_wide {
    box-shadow: 0 6px 5px -4px rgba(0, 0, 0, 0.25);
    height: 110px;
}

.layout_narrow {
    box-shadow: 0 6px 5px -4px rgba(0, 0, 0, 0.25);
    height: 130px;
}

/* RVBD:
      Assign width of 100% to first table to fill available space.
      Align all objects in the first row to middle vertically.
      Align objects in first column to the left horizontally.
      Assign width 75% to second column to force logo image to scale down on browser resize.
      Assing width of 100% to first column of first table in narrow layout (and hide second column). This creates space to center logo img.
*/
#layout_div > table:first-child {
    width: 100%;
}

#layout_div > table:first-child tr {
    height: 60px;
}

#layout_div > table:first-child td:first-child {
    text-align: left;
}

.layout_wide > table:first-child td:nth-child(2) {
    width: 71.5vw;
    padding-left: 60px;
    text-align: right;
    white-space: nowrap;
}

.layout_narrow > table:first-child td:first-child {
    width: 100%;
    text-align: center;
}

/* RVBD:
      Show title and document version elements in first table in wide layouts. Inline-block with no-break to keep on same line.
      Hide document title and document version elements in wide layouts.
      Hide document title and document version elements in first table (company info table) for narrow layouts.
      Show document title and document version elements in center column in toolbar table for narrow layouts.
*/
.layout_wide table:first-child .rvbd-document-title,
.layout_wide table:first-child .rvbd-document-version {
    display: inline-block;
}

.layout_wide .ww_skin_toolbar .rvbd-cluster-center .rvbd-document-title,
.layout_wide .ww_skin_toolbar .rvbd-cluster-center .rvbd-document-version {
    display: none;
}  

.layout_narrow > table:first-child .rvbd-document-title,
.layout_narrow > table:first-child .rvbd-document-version {
    display: none;
}

.layout_narrow .ww_skin_toolbar .rvbd-cluster-center .rvbd-document-title,
.layout_narrow .ww_skin_toolbar .rvbd-cluster-center .rvbd-document-version {
    display: block;
    white-space: normal;
}

/* RVBD: Lower the container_div and remove horizontal browser scrollbars. Tables in content pages  will still have scrollbars when needed */
div#container_div {
    top: 134px !important;
    left: 0px !important;
    overflow-y: auto;
    overflow-x: hidden;
}

/* RVBD: 
      Remove horizontal scrollbar from panel_frame.
      Add drop shadow to panel_frame and move left. Need div#* format to nullify ePub CSS.
      Remove box-shadow from panel if Search is displayed in wide layout, and from panel in any narrow layout. 
      Add title to panel_frame contents, depending on whether it is toc or search or index.
*/
div#panel_frame {
    overflow-x: hidden;
}

div#layout_div.layout_wide div#presentation_div.panel_sidebar div#panel_frame {    
    left: 0px;
    box-shadow: 6px -1px 5px -4px rgba(0, 0, 0, 0.25);
}

.layout_narrow div#panel_frame,
.layout_wide .panel_overlay div#panel_frame {
    box-shadow: none;
}

.layout_narrow .panel_sidebar .ww_skin_toc_container::before {
    content: "Contents";
    display: block;
    position: static;
    margin-top: -2px;
    margin-left: 4px;
    margin-bottom: 14px;
    font-family: "MuseoSans-100", "OpenSans-Light", Arial, sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.19;
    color: #545b5b;
}

/* RVBD: Add more whitespace to left of page content div for narrow layouts */

div#layout_div.layout_narrow div#page_div {
    left: 0px;
}

/* RVBD: Nullify ePub OOTB styles and add RVBD styles */
.ww_skin_page_back_to_top {
    cursor: pointer;
    background-color: unset;
    padding: unset;
    display: block;
    float: right;
    -moz-border-radius: unset;
    -webkit-border-radius: unset;
    border-radius: unset;
}

.ww_skin_page_back_to_top:hover {
    background-color: unset;
}

.ww_skin_page_back_to_top > a:link, .ww_skin_page_back_to_top > a:visited {
    text-decoration: none;
}

.ww_skin_page_back_to_top > a:link:hover, .ww_skin_page_back_to_top > a:visited:hover {
    text-decoration: none;
    color: unset;
}

div.back_to_top {
    visibility: hidden;
    opacity: unset;
    -webkit-transition: opacity 1s ease;
    -moz-transition: opacity 1s ease;
    -o-transition: opacity 1s ease;
    -ms-transition: opacity 1s ease;
    transition: opacity 1s ease;
    background-color: unset;
    float: none;
    position: fixed;
    padding: unset;
    right: 54px;
    bottom: 28px;
}

div#layout_div.layout_wide div.back_to_top {
    right: 54px;
    bottom: 28px;
}

div#layout_div.layout_narrow div.back_to_top {
    right: 19px;
    bottom: 28px;
}

div#layout_div.layout_narrow.layout_tall div.back_to_top {
    right: 36px;
    bottom: 28px;
}

div.back_to_top.back_to_top_show {
    visibility: visible;
    opacity: unset;
}

div.back_to_top > a {
    display: inline-block;
    border-left: unset;
    border-right: unset;
    border-bottom: unset;
    margin: unset;
    width: unset;
    height: unset;
}

/* RVBD: Add footer styles */
.rvbd-footer {
    display: block;
    position: relative;
    width: 100%;
    background-color: green;
}

/*
   RVBD: 
      Add @media query to remove title and version from header for small screens.
      Add @media query to remove borders from Search and Contents panels and repositon elements therein when in small screens.
      Thank you sassmeister.com!.
*/
@media (max-width: 600px) {
  .layout_narrow .ww_skin_toolbar .rvbd-cluster-center .rvbd-document-title,   
  .layout_narrow .ww_skin_toolbar .rvbd-cluster-center .rvbd-document-version {
     display: none;
  }
}

@media (max-width: 500px) {
  div#panel_content {
    border: none;
    margin-left: unset;
    margin-right: unset;
    }
  .layout_narrow .panel_sidebar .ww_skin_toc_container {
        margin-left: 3px;
        margin-right: 12px;
    }
  .layout_narrow .panel_sidebar .ww_skin_toc_container::before {
    margin-left: 16px;
    }
  .ww_skin_search_background {
    margin-left: 12px;
    }
}