*, *::before, *::after {
  box-sizing: border-box;
}

/* Fonts */

header, h1, h2, h3, h4, h5, h6 {
  color:        #111;
  font-family:  'Libre Baskerville', serif;
  line-height:  1;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.17em; }
h4 { font-size: 1.12em; }
h5 { font-size: 0.83em; }
h6 { font-size: 0.75em; }

p {
  max-width: 44em;
  line-height: 2;
}

table {
  border-collapse: collapse;
}
table th, table td {
  padding: 0.5em 1em;
}

.signature {
  letter-spacing: 10px;
  color:          black;
  font-family:    monospace;
  text-shadow:    1px 1px #ddd;
  border-left:    2px solid rgba(160,0,0,0.3);
  padding:        0 2em;
  border-radius:  0.75em;
}

p.error {
  background-color: #fcc;
  color:            red;
  padding:          1em;
}

html {
  height: 100%;
}

body {
  margin:         0;
  color:          #111;
  font-family:    'Open Sans', sans-serif;
  min-height:     100%;
  display:        -webkit-flex;
  display:        flex;
  -webkit-flex-direction: column;
  flex-direction: column;
}

body > main {
  min-height:      100%;
  -webkit-flex-grow: 1;
  flex-grow:       1;
  display: -webkit-flex;
  display:         flex;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-align-items: center;
  align-items:     center;
  padding:         1em;
}

body > footer {
  color:            white;
  background-color: #333;
  font-weight:      bold;
  padding:          1vh 1em 2vh 1em;
  display: -webkit-flex;
  display:          flex;
  -webkit-flex-direction: column;
  flex-direction:   column;
  -webkit-align-items: center;
  align-items:      center;
}

body > footer p {
  text-align:  center;
  line-height: 3;
}
body > footer p::first-letter {
  color: orange;
}

body > footer a {
  color:  white;
  cursor: pointer;
}

body > footer .links {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-justify-content: center;
  justify-content: center;
}

body > footer .links a {
  margin: 0.5em;
}

body > header {
  display: -webkit-flex;
  display:          flex;
  position:         relative;
  -webkit-align-items: center;
  align-items:      center;
  -webkit-justify-content: space-around;
  justify-content:  space-around;
  background-color: #333;
  font-weight:      bold;
  padding:          2vh 0;
}

@media all and (min-width: 1000px) {
  body > header {
    background-image:    url('/images/me.png');
    background-repeat:   no-repeat;
    background-size:     auto 90%;
    background-position: bottom right;
  }
}

body > header > nav .login,
body > header > nav .logout {
  color:            rgba(255,255,255,0.3);
  text-align:       center;
  white-space:      nowrap;
  position:         absolute;
  top:              -4em;
  left:             -4em;
  display:          block;
  height:           8em;
  padding-top:      6.25em;
  width:            8em;
  background-color: #B9323D;
  transform:        rotate(-45deg);
  font-family:      'Open Sans', serif;
  text-decoration:  none;
  transition:       color 0.2s linear;
}
body > header > nav .logout {
  background-color: #3DB932;
}

body > header > nav .login:hover,
body > header > nav .logout:hover {
  color: rgba(255,255,255,0.9);
}


body > header > h1 {
  margin:       1em;
  padding-left: 12vw;
}

body > header > h1::first-letter {
  color: orange;
}

body > header > h1 > a {
  color:           white;
  text-decoration: none;
}

body > header > nav {
  -webkit-flex-grow: 1;
  flex-grow:       1;
  margin:          1em;
  margin-right:    13em;
  display:         -webkit-flex;
  display:         flex;
  -webkit-align-items: center;
  align-items:     center;
  -webkit-justify-content: center;
  justify-content: center;
}

@media all and (max-width: 999px) {
  body > header > nav {
    margin-right: 1em;
    -webkit-justify-content: space-around;
    justify-content: space-around;
  }
}

body > header > nav > a:not(.login):not(.logout) {
  display:          block;
  color:            white;
  padding:          1em 3em;
  background-color: rgba(255,255,255,0.1);
  margin:           0 1em;
  text-decoration: none;
  transition: box-shadow 0.05s linear;
}

body > header > nav > a:not(.login):not(.logout):hover {
  box-shadow: 0 0 1px 1px rgba(255,255,255,0.5);
}

@media all and (max-width: 890px) {
  body > header {
    -webkit-flex-direction: column;
    flex-direction: column;
    padding-bottom: 0.4em;
  }
  body > header > h1 {
    padding-left:  0;
    margin-bottom: 0.3em;
    margin-top:    0.3em;
    font-size:     2em;
  }
  body > header > nav {
    width: 96%;
    font-size: 0.9em;
    -webkit-flex-grow: 1;
    flex-grow: 1;
    -webkit-justify-content: space-around;
    justify-content: space-around;
  }
  body > header > nav > a:not(.login):not(.logout) {
    padding: 1em 0;
    -webkit-flex-grow: 1;
    flex-grow: 1;
    max-width: 14em;
    text-align: center;
  }
  body > main {
    padding: 1em;
  }
}

body > main section:not(:last-child) {
  margin-bottom: 3em;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
button {
  padding: 0.5em 1em;
  font-size: 1em;
  font-family: 'Open Sans', serif;
}

button {
  cursor: pointer;
}

[contenteditable]:focus {
  outline: 0px solid transparent;
}


/**
 * Page titles
 */
h2.page-title {
  font-size:   1.7rem;
  line-height: 2;
  text-align:  center;
}

@media all and (max-width: 850px) {
  h2.page-title {
    font-size: 1.5rem;
  }
}

@media all and (max-width: 700px) {
  h2.page-title {
    font-size: 1.3rem;
  }
}

h2.page-title::first-letter {
  color: orange;
}
