/*
 * Basic HTML output styling
 */

body {
  font-family: 'Raleway', sans-serif;
  background-color: #f8f8ff;
  color: #222222;
  margin: 0;
}

h1 {
  text-align: center;
  font-size: 2em;
  color: black;
  text-shadow: 2px 2px 4px #aaaaaa;
  margin-bottom: 1.5em;
}

h2 {
  font-size: 1.5em;
  margin-top: 1.2em;
  margin-bottom: 0.7em;
}

h3 {
  font-size: 1.2em;
  margin-top: 1.2em;
  margin-bottom: 0.7em;
}

h4 {
  font-size: 1.0em;
  margin-top: 1.0em;
  margin-bottom: 0.7em;
}

em {
  color: darkgreen;
}

strong {
  color: darkred;
}

table {
  border-collapse: collapse;
}

th {
  background-color: #cccccc;
}

th, td {
  border: 1px solid #888888;
  padding: 4px;
}

.data p, .data li, .data td {
  font-family: 'Lora', serif;
}

.data p {
  margin-top: 0.7em;
  margin-bottom: 0.7em;
}

pre:not(.markdown) {
  background-color: #dddddd;
  width: fit-content;
  padding: 3px;
  border: 1px solid #aaaaaa;
}

pre.markdown  {
  white-space: pre-wrap;
  font-family: 'Inconsolata', monospace;
}

code {
  background-color: #dddddd;
  font-family: 'Inconsolata', monospace;
}

.highlight {
  background-color: yellow;
}

/* Markdown processing sometimes creates spurious paras in bullets */
.data li>p {
  margin: 0 auto 0;
}


/*
 * Navigation menus
 */

details {
  margin-top: 0.2em;
  color: black;
}

details>details {
  margin-left: 0.8em;
}

details:last-child {
  margin-bottom: 0.6em;
}

details>p {
  margin-left: 1.5em;
  margin-top: 0;
  margin-bottom: 0;
  color: darkblue;
}

.filenav ul {
  color: darkblue;
  list-style: none;
  padding-left: 0.5em;
}

.filenav ul li {
  margin-top: 0.2em
}

.filenav ul ul ul li {
  margin-top: 0.2em
}

.filenav ul ul {
  opacity: 0.9;
}

.filenav ul ul ul {
  opacity: 0.8;
}

.filenav ul ul ul ul {
  opacity: 0.7;
}

/*
 * Search popup
 */

.search {
  background-color: #dfe0f4;
  display: none;
  flex-direction: row;
  align-items: center;
}

.search.expanded {
  display: flex;
}

.search input {
  flex: 1 0 4em;
  font-size: 1.0em;
  font-family: 'Raleway', sans-serif;
  margin: 8px 10px;
}

.search_result {
  color: darkblue;
  cursor: pointer;
}

.search div#search_submit {
  flex: 0 0 auto;
  margin-right: 10px;
}

/*
 * Property blocks
 */

.props table {
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
}

.props td {
  border: none;
  padding: 0px;
}

.props .subject {
  text-align: right;
  color: #888888;
  padding-right: 0.5em;
}

.props .value {
  text-align: left;
  padding-left: 0.5em;
}

div.props {
  align-self: end;
}

.props p {
  margin: 0.2em 0.5em 0.2em;
  text-align: right;
}


/*
 * Invariant layout
 */

/* Force mobile Chrome to recalculate screen size as it hides the url bar*/
html {
  position: fixed;
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
}

.globalnav {
  overflow-x: hidden;
  overflow-y: auto;
}

.filenav {
  overflow-x: hidden;
  overflow-y: auto;
}

.data {
  overflow-y: auto;
}

.props {
  overflow-x: hidden;
  overflow-y: hidden;
}

/*
 * Media based layout
 */

@media screen and (max-width:649px) {
/* Phone-like narrow layout with small text*/

body {
  font-size: 80%;
}
}

@media screen and (max-width:949px) {
/* Phone-like narrow layout */

body {
  display: flex;
  flex-direction: column;
}

.menu {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: 50px;
}

.globalnav, .filenav, .data {
  flex-grow: 0;
  flex-basis: 0;
  padding-left: 5px;
  padding-right: 5px;
  transition: all .15s ease-in;
}

.globalnav.active, .filenav.active, .data.active {
  flex-grow: 1;
  flex-basis: auto;
}

.search {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  width: 100%;
}

.props {
  display: none;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  padding-top: 5px;
  margin-top: 5px;
  width: 100%;
  background-color: #dfe0f4;
}

.props.expanded {
  display: block;
}
}

@media screen and (min-width:950px) and (max-width:1399px) {
/* Tablet-like medium width layout */

body {
  display: grid;
  grid-template-columns: 18em auto;
  grid-template-rows: auto 1fr auto auto 50px;
  grid-template-areas:
    "globalnav data"
    "filenav data"
    "props data"
    "search data"
    "menu data"
}

.globalnav {
  height: 0;
  margin-left:5px;
  grid-area: globalnav;
}

.globalnav.active {
  height: auto;
}

.filenav {
  grid-area: filenav;
}

.props {
  grid-area: props;
}

.data {
  grid-area: data;
  padding-left: 10px;
  padding-right: 10px;
}

.menu {
  grid-area: menu;
}

/* Hide properties and contents buttons since contents always shown. */
.menu>#contents_button { display: none; }
.menu>#props_button { display: none; }


}

@media screen and (min-width:1400px) {
/* Desktop-like wide layout */

body {
  display: grid;
  grid-template-columns: 14em auto 18em;
  grid-template-rows: 1fr auto 40px 50px;
  grid-template-areas:
    "globalnav data filenav"
    "globalnav data props"
    "search data props"
    "menu data props"
}

.globalnav {
  margin-left:5px;
  grid-area: globalnav;
}

.filenav {
  grid-area: filenav;
}

.props {
  grid-area: props;
}

.data {
  grid-area: data;
  padding-left: 10px;
  padding-right: 10px;
}

.menu {
  grid-area: menu;
}

/* Hide properties and contents buttons since contents always shown. */
.menu>#contents_button { display: none; }
.menu>#props_button { display: none; }

/* Hover is really jank on mobile, only define on the largest view */
.menu>div.enabled:hover{
  color: #df3737;
}
}


/*
 * Menu Control
 */

.menu {
  background: #c5c7e9;
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.menu>div {
  flex-grow: 0;
  flex-basis: 4em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a7a9c5;
  cursor: default;
}

.material-icons {
  font-size: 36px;
}

.menu>div.hidden {
  display: none;
}

.menu>div.enabled {
  color: #4e4f58;
  transition: all .1s ease-in;
  cursor: pointer;
}
