/*******************************************************************************
 * shell_X.css controls the overall arrangement of the blocks on the page.
 *******************************************************************************
 *
 * Author: Thomas Shemanske
 *
 *******************************************************************************
 */

/* The overall structure is
  html
    head
    body.pretext
      header.ptx-masthead
      nav.ptx-navbar
      div.ptx-page
        div.sidebar
          nav.ptx-toc
        main.ptx-main
          div.ptx-content
          div.ptx-content-footer
      div.ptx-page-footer
*/

/*  Supplied by colors_bluegreen_grey.css  */
/*
:root{
  --bluegreen: hsl(192, 98%, 23%);
  --bodytitle: var(--bluegreen);
  --bodysubtitle: var(--bluegreen);
}
*/

/* over-ride some of the default style */

.pretext .ptx-page > .ptx-main {
  margin-left: unset;
}
.ptx-masthead .logo-link img {
  width: unset;
  height: unset;
  max-height: unset;
}
.ptx-masthead .logo-link {
  font-size: unset;
  text-align: unset;
  line-height: unset;
}
.pretext .ptx-masthead {
  position: unset;
  background: unset;
  min-height: unset;
  border: unset;
  position: unset;
  z-index: unset;
}

.ptx-content-footer .previous-button .name {
  margin-left: unset;
  padding-right: unset;
}
.pretext .ptx-content-footer .name {
  position: relative;
  bottom: 0;
}
.pretext .ptx-content-footer .button.previous-button, .pretext .ptx-content-footer .button.next-button {
  font-size: 0.8em;
  margin-top: 1.5em;
  padding: 0.4em;
}
.pretext .ptx-content-footer .top-button .icon, .pretext .ptx-content-footer .top-button .name {
  display: unset;
}
.pretext .ptx-content-footer .previous-button .icon {
  margin-left: unset;
  margin-right: unset;
}
.pretext .ptx-content-footer .button {
  text-align: unset;
/*
  color: unset;
  background-color: unset;
*/
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 35px;
  min-width: 85px;
}

/* Elements introduced in order of appearance */

/* .ptx-container  */
body.pretext {
/*
    position: relative;
*/
    max-width: 904px;  /* To match PreTeXt */
    margin: 0 auto 0 auto;  /* centered content */
    padding: 0;
    box-sizing: border-box;
}

/* .ptx-masthead-wrapper  */
.pretext .ptx-masthead {
    border: 2px solid #ddd;
    border-bottom: none;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    /*     overflow: hidden;*/  /* otherwise the rounded corners are not visible */
}
.pretext .ptx-masthead {
    position: relative;
    background: #fafafa;
    min-height: inherit;
    box-shadow: none;
}
.pretext .ptx-masthead {
    max-width: 904px;
    border-right: 1px solid #bababa;
}
@media only screen and (min-width: 600px) {
    /*   .ptx-masthead-wrapper {*/
    .ptx-masthead {
        z-index: 100;
    }
}
.ptx-masthead .searchbox {
   bottom: 2px;
   margin-right: -19px;
}

/* .ptx-main-wrapper  */
.ptx-page {
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1.0em;
  min-height: 100vh;

    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    grid-template-areas:
        "toc main-content"
        "toc content-footer";
}
.ptx-content {
  min-height: 50vh;
}

/* MH-toc dropdown Content (Hidden by Default) */
.ptx-sidebar {
    position: sticky;
    top: 34px;
    background-color: #f1f1f1;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    width: 240px;
    max-height: 100vh;
    height: 100vh;
    grid-area: toc;
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 1;
    grid-row-end: 3;

/*
    overflow-y: auto;
    overflow-x: hidden;
*/
    border: 2px solid var(--bluegreen);
    border-radius:5px;
    z-index: 1;
}

/* .ptx-main-content  */
.ptx-page > .ptx-main {
    grid-area: main-content;
    grid-column-start: 2;
    grid-column-end: 3;
    grid-row-start: 1;
    grid-row-end: 2;

    justify-self: start;
    max-width: 664px;
    width: 97vw;
    transition: 0s;
    padding: 0;
    margin: 0;
    z-index: 0;  /* Added so horizontal scrollbars in content don't bleed into TOC dropdown */
    //    overflow-y: auto;
    //    border: 2px solid green;
}

@media only screen and (min-width: 500px) {
    .ptx-page > .ptx-main {
	margin: 0;
	max-width: 664px;
	width: min(100vw,664px);
	justify-self: center;
	/*      width: 570px; @ 810px */
    }

}
.ptx-page > .ptx-main > .ptx-content {
    margin-left: 2em;
}

/* Content footer wrapper playground */

.pretext .ptx-page .ptx-content-footer {
    display: grid;
    max-width: 100%;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
        "content-footer-prev content-footer-top content-footer-next";
    margin-left: 32px;
    margin-top: 30px;
}

.ptx-content-footer .previous-button {
    grid-area: content-footer-prev;

    justify-self: start;
    align-self: center;
    margin: 20px;
    padding: 5px;

    display: inline-block;
    height: 32px;
    color: var(--bodytitle);
    font-family: inherit;
    text-align: center;
    font-size: .8em;
    font-weight: 700;
    letter-spacing: .1rem;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #888;
    cursor: pointer;
    box-sizing: border-box;

}

.ptx-content-footer .previous-button:hover{
    background-color: #fafafa;
    color: #888;
}


.ptx-content-footer .previous-button .name{
    margin-left: 2px;
    padding-right: 5px;
}

.ptx-content-footer .previous-button .icon{
    padding-left: 5px;
}

.ptx-content-footer .top-button{
    grid-area: content-footer-top;
    justify-self: center;
    align-self: center;
    margin: 20px;
    padding: 5px;

    display: inline-block;
    height: 32px;
    color: var(--bodytitle);
    font-family: inherit;
    text-align: center;
    font-size: .8em;
    font-weight: 700;
    letter-spacing: .1rem;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #888;
    cursor: pointer;
    box-sizing: border-box;
}

.ptx-content-footer .top-button:hover{
    background-color: #fafafa;
    color: #888;
}

    color: #888;
}

.ptx-content-footer .top-button .name{
    margin-left: 2px;
    padding-right: 5px;

}

.ptx-content-footer .top-button .icon{
    padding-left: 5px;
}

.ptx-content-footer .next-button {
    grid-area: content-footer-next;
    justify-self: end;
    align-self: center;
    margin: 20px;
    padding: 5px;

    display: inline-block;
    height: 32px;
    color:  var(--bodytitle);
    font-family: inherit;
    text-align: center;
    font-size: .8em;
    font-weight: 700;
    letter-spacing: .1rem;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #888;
    cursor: pointer;
    box-sizing: border-box;


}

.ptx-content-footer .next-button:hover{
    background-color: #fafafa;
    color: #888;
}

.ptx-content-footer .next-button .name{
    margin-right: 2px;
    padding-left: 5px

}

.ptx-content-footer .next-button .icon{
    padding-right:5px;
}

.pretext .ptx-sidebar.visible {
  display: block;
}

@media only screen and (max-width: 800px) {

  .pretext .ptx-sidebar {
    display: none;
  }
/* copied from shell_default.css   Wher is ptx-navbar set in the CRC style */
.pretext .ptx-navbar {
    position: fixed;
    top: auto;
    bottom: 0;
    z-index: 1100;
   }
  .pretext .ptx-sidebar {
    display: none;
    position: fixed;
    top: 10px;
    z-index: 1000;
    background: white;
  }
}

.pretext .ptx-page-footer .feedback-link {
  cursor: pointer;
  text-align: center;
  color: #333333;
  background-color: #ededed;
  border: 1px solid #bababa;
  margin: 1.5em 0 0 0;
  padding: 0 1em 0 1em;
  height: 2em;
  display: flex;
  align-items: center;
}
.pretext .ptx-page-footer {
    background: #f4f4f4;
    margin-top: 2em;
    padding-top: 0;
    max-width: 900px;
    border-top: 2px solid var(--sectiontoctext);
    border-bottom: 2px solid var(--sectiontoctext);
  display: flex;
  flex-direction: row;
  justify-content: space-around;
    position: relative;
/*
    z-index: 100;
*/
}

.pretext .ptx-page-footer > a {
  margin: 1em 0;
}
.pretext .ptx-page-footer > a > .logo:first-child {
    height: 3em;
    width: unset;
    margin: 0;
}

