/* wdbPlus: Darmstadt css.
 *
 * Author:KW <kevin.wunsch@tu-darmstadt.de>
 * Author:DK <dario.kampkaspar@tu-darmstadt.de>
 *
 * Synopsis:
 *  We use a three-color color scheme with additional white and black. 
 *  We use custom properties in css that are named as follows:
 *  --zeidMainColor: #54625e;
 *  --zeidAccentColor: #008877; (ULB Green)
 *  --zeidBackColor: #E9ECEB;
 *
 *  The property --zeidMainColor is used for headers, texts in navigation and text in the body.
 *  The --accent is used as highlight color and for headings on the starting page of each project
 *  --bg-color is used whenever the whiteness of a page is overwhelming, to introduce some separation of background and content.
 */

/* Override animation during AJAX requests due to PURL redirection */
.loadingModal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(255, 255, 255, .8) url('pa000000-0000-0119') 50% 50% no-repeat;
}

/* Color scheme declaration */
:root {
  --zeidMainColor: #54625e;
  --zeidAccentColor: #008877;
  --zeidBackColor: #e9eceb;
}

/* Generic stuff, like <main/> or <h{x}/> styles */
main {
  background: var(--zeidBackColor);
  padding: 0.5em;
  overflow-y: auto;
}

a {
  color: var(--zeidMainColor);
}

#files > a{
  color:var(--zeidAccentColor);
}

.dispOpts a {
  color: white;
}

/* header for wide displays: .headerSide to left/right */
body > header {
  background-color: var(--zeidMainColor);
  border-bottom: 1px solid white;
  grid-template-columns: 150px calc(100% - 300px) 150px;
  height: 8em;
  max-width: 100vw;
  padding: 0;
}
.headerSide {
  padding: 0 0.5em;
  display: flex;
  flex-wrap: wrap;
}

.headerCentre {
  border-left: 0.1px solid white;
  border-right: 0.1px solid white;
  grid-area: hc;
  flex-wrap: wrap;
  flex-direction: column;
}

/* Burger nur bei schmalen viewports anzeigen */
.headerMenu {
  display: none;
}

body > header h1 {
  font-size: 1.25em;
  font-family: arial;
  text-align: center;
  color: white;
  margin: 0.5em 1em;
  height: 1.5em;  /* overall height: 2.5em; */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: calc(100% - 2em);
}
body > header h2 {
  font-family: arial;
  display: block;
  color: white;
  text-align: center;
  margin: 0.5em 1em;
  height: 1.4em; /* overall height: 2.4em */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* <hr>-Style */
header hr {
  border: none;
  border-top: medium double white;
  color: white;
  height: 0.75em;
  margin-top: 1em;
  overflow: visible; /* For IE */
  padding: 0;
  text-align: center;
  width: 66%;
  
}
body > header hr:after {
  content: '§';
  display: inline-block;
  position: relative;
  top: -0.55em;
  font-size: 1.5em;
  background: var(--zeidMainColor);
  padding: 0 0.3em;
}

/* Funktionen im header */
.dispOpts {
  all: initial;
  font-family: Arial, sans-serif;
  font-size: 0.9em;
  position: relative;
  transition-duration: 0.5s;
  width: 100%;
}
.dispOpts::before,
.dispOpts::after {
  display: none;
}
.dispOpts:hover {
  background: var(--zeidAccentColor);
  cursor: pointer;
}

.dispOpts > * {
  bottom: 0;
  color: white;
  height: 1.2em;
  margin: auto;
  padding: 0;
  position: absolute;
  top: 0;
}
.dispOpts div {
  height: fit-content;
}
.dispOpts textarea {
  box-sizing: border-box;
  font-size: 0.9em;
  height: 3em;
  margin: 0 0 8px 0;
  overflow: hidden;
  resize: none;
  width: 100%;
}
.dispOpts button {
  border: none;
  background-color: transparent;
  font-size: 1em;
  text-align: left;
}
.dispOpts a:visited {
  color: white;
}

/* Dropdown menus in header */
.menuItem {
  margin-top: 0.25em;
  padding: .25em;
  top: 7em;
}

/*Authentication on toc.html */
#auth button {
  background: var(--zeidMainColor);
  color: white;
  border: 1px solid white;
  padding: 0.5em;
  transition-duration: 0.5s;
  margin-left: 0.4em;
}
#auth button:hover {
  background: var(--zeidAccentColor);
}

/* Tabellen */
/*table {
  border-spacing: 2em;
}*/

td:not(:empty) {
  /*box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  transition: 0.3s;
  height: 3em;
  background: white;*/
  padding: 0.5em;
}
/* td:not(:empty):hover {
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}*/

/* All things related to navigation: button and nav */
body > header nav {
  background: var(--zeidBackColor);
  border: 1px solid black;
  margin: calc(0.25em + 1px) 0 0 -0.25em;
  max-height: calc(90vh - 7em);
  max-width: 40vw;
  padding: 0.25em 0.25em 0.75em 1.5em;
  top: 7em;
}

body > header nav > h2 {
   display: none;
}
nav button {
  background-color: var(--zeidBackColor);
  color: var(--zeidMainColor);
}
nav button:focus {
  outline: none;
}

nav ul {
  padding-bottom: 0.5em;
}

nav > ul > li:first-child {
  padding-top: 0.25em;
}
nav > li {
  padding: 0.25em;
}

nav li {
  padding: 0 0.25em;
  list-style: none;
  font-family: Arial;
  color: var(--zeidMainColor);
  background: var(--zeidBackColor);
}
nav li a {
    color:var(--zeidMainColor);
}

nav a:hover,
nav a:visited,
nav button:hover{
  color: var(--zeidAccentColor);
}

/* Haupt-Footer */
body > footer {
  display: flex;
  justify-content: space-between;
  padding: 0.25em 1em;
  background-color: white;
}

.footerLeft, .footerRight {
  align-items: center;
  display: flex;
  justify-content: center;
  width: calc(50vw - 1em); /* footer has padding-left/right of 1em */
}
.footerLeft > *, .footerRight > * {
  flex: 1 1 auto;
}

/* Standard für 2 Logos */
footer > img {
  max-height: min(10vh, 7em);
  max-width: 50vw;
}
footer a {
  height: 4em;
  line-height: 4em;
}
footer a img {
  height: 4em;
}
/* footer nur mit Text */
footer span a {
  height: 1.4em;
  line-height: 1.4em;
}

/* Layout for mobile devices: 
 * Breakpoints are width: 1366px (iPad Pro landscape), width:1024px,
  width: 768px (iPad portrait), width: 450px (too narrow for navigation);
  height: 768px.
 */
@media screen and ( max-width: 1365px ),
       screen and ( max-height: 767px ){
  body > header hr {
    display: none;
  }
}

@media screen and ( max-width: 767px ),
       screen and ( max-height: 767px ) {
  body > header {
    border-bottom: 1px solid white;
    display: grid;
    grid-template-areas: '. .' '. .';
    grid-template-columns: 50% 50%;
  }
  body > header nav {
    margin: 0;
    top: 2em;
  }
  .headerSide {
    flex-wrap: unset;
    padding: 0 0.25em;
    position: relative;
    height: 1.5em;
    align-items: center;
  }
  .headerCentre {
    border: 0;
    border-bottom: 1px solid white;
    flex: 1 0 auto;
    grid-area: 1/1;
    height: 5em;
    max-width: 100vw;
    overflow: hidden;
    width: 100vw;
  }
  .headerSide:first-of-type {
    grid-area: 2/1;
    width: calc(55vw - 0.5em);
  }
  .headerSide:first-of-type > .dispOpts + .dispOpts {
    border-left: 1px solid white;
  }
  .headerSide:last-of-type {
    flex-direction: row-reverse;
    grid-area: 2/2/2/4;
    width: calc(45vw - 0.5em);
  }
  .headerSide:last-of-type >  .dispOpts + .dispOpts {
    border-right: 1px solid white;
  }
  .headerSide form {
    margin-top: 0.125em;
    padding: 0;
  }
  .dispOpts {
    height: 1.5em;
    padding: .4em .5em 0 .5em;
    width: unset;
  }
  .dispOpts textarea {
    border: 0;
    height: 1.2em;
    width: 15em;
    line-height: inherit;
    margin: 0 5px 0 0;
    padding: 1px 3px 2px 3px;
  }
  .dispOpts > * {
    display: contents;
  }
  body > header h1 {
    padding-top: 0.25em;
    margin: 0.25em 1em; /* total height: 2.25em */
  }
  body > header h2 {
    margin: 0.25em 1em; /* total height: 1.9em */
  }
  body > footer {
    margin: 0;
    padding: 0 1em;
    border-top: 1px solid white;
  }
  body > footer p {
    margin: 0;
    margin-left: 1em;
  }

  aside p, main p {
    font-size: 1.2em;
    line-height: 1.5em;
  }
}
@media screen and ( max-width: 449px ),
       screen and ( max-height: 767px ) {
  /* header und footer sollten möglichst wenig Höhe einnehmen;
   * Funktionen über Menü unter der Kopfzeile, ein-/ausblenden über Burgermenu */
  body > header {
    background-color: initial;
    border: 0;
    height: auto;
    grid-template-areas: '. . .';
    grid-template-columns: auto auto 42px;
    position: absolute;
  }
  
  body > footer {
    padding: 0 1em;
  }
  body > footer > p {
    margin: 0.1em 0.5em 0.05em 0.5em;
  }
  
  .headerSide:first-of-type > .dispOpts + .dispOpts,
  .headerSide:last-of-type > .dispOpts + .dispOpts {
    border: none;
  }

  .headerSide nav {
    margin: 0;
    max-width: calc(100vw - 110px);
    right: calc(10em + 10px);
    top: 0;
    width: 30vw;
  }

  /* Seiten ausblenden, Mitte festsetzen, Burger anzeigen */
  .headerSide {
    display: none;
    padding: 0 5px;
    margin: 0;
    max-width: unset;
    flex-direction: row-reverse;
    height: auto;
    flex-wrap: wrap;
    justify-self: end;
    background-color: var(--zeidMainColor);
    position: relative;
    z-index: 100;
  }
  .headerSide:first-of-type {
    grid-area: 2/2/2/4;
    width: 10em;
  }
  .headerSide:last-of-type {
    grid-area: 3/2/3/4;
    width: 10em;
  }

  .headerCentre {
    background-color: var(--zeidMainColor);
    border: 0;
    grid-area: 1/1/1/3;
    height: auto;
    flex: 1 0 auto;
    width: calc(100vw - 42px);
  }

  .headerMenu {
    background-color: var(--zeidMainColor);
    border: 0;
    display: flex;
    grid-area: 1/3;
    justify-content: center;
  }
  
  .headerMenu .respNav {
    display: initial;
    font-size: 1.5em;
    padding: 0;
  }
  
  /* Nur eine Zeile für Titel und weniger margin und padding */
  body > header h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0;
    font-size: 1.1em;
    height: 1.5em; /* total height: 2.1em */
    margin: 0.4em 0.2em 0.1em 0.5em;
    width: calc(100% - 0.7em);
  }
  body > header h2 {
    font-size: 0.9em;
    height: 1.5em; /* total height: 1.8em */
    letter-spacing: 0.15em;
    margin: 0 0.2em 0.2em 0.5em;
    width: calc(100% - 0.7em);
  }
  
  /* Funktionen rects über Text */
  .dispOpts {
    width: 100%;
    font-size: 0.8em;
    height: auto;
    padding: 0.3em 0;
    line-height: normal;
  }
  .dispOpts:hover {
    background-color: var(--zeidMainColor);;
  }
  .dispOpts textarea {
    height: 2.4em;
    margin: 0;
    padding: 2px 1px;
  }
  
  .headerSide form {
    padding: 0.3em 0;
    font-size: 0.8em;
  }

  .dispOpts a, .dispOpts button {
    font-size: 1.2em;
    line-height: 1.5em;
    height: 1.5em;
    align-self: center;
  }
  
  .dispOpts + .dispOpts, .menuItem + .dispOpts {
    border: 0;
  }
  
  /* margin and padding for right and left parts to account for fixed height header */
  aside, main {
    /* header = ( h1 ( 0.4em + 1.5em + 0.1em) + h2 ( 1.5em + 0.2em ) + 0.05em between ) */
    margin-top: 2.25em; 
    padding-top: 1.5em; /* additional height of header when header:has(h2), which sadly is not available yet */
  }
  #content {
    padding-top: 0.25em; /* additional padding as aside must stick to the top while the text needs padding */
  }

  /* Login-Formular mit minimaler Größe */
  #login {
    width: 134px;
  }
}
