/* This is the Underdark layout CSS. Its structure is based on SMACSS. See
https://smacss.com for more info. */

/* form */
form + form {
  border-top: 0;
}

/* table */
table code {
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  word-break: break-all;
}

/* containers */
body > header > div,
body > footer > div > nav,
body > footer > div.copyright p,
main {
  max-width: 80rem;
  margin: 0 auto;
  padding-left: 5%;
  padding-right: 5%;
}

/* body nav */
body > nav {
  padding: 0 5%;
}
body > nav > ul {
  list-style: none;
}

/* main */
main {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
article,
aside,
nav,
section {
  word-wrap: break-word;
}
section {
  margin: 3rem 0;
}

/* main section header */
main > header,
main section > header {
  margin-bottom: 2.5rem;
}
main > header > h1,
main section > header > h1 {
  margin-bottom: 0;
}
main > header > h1 + p,
main section > header > h1 + p {
  font-size: 1.125em;
  margin-top: 0;
}
/* main section footer */
main section > footer {
  margin-top: 2.5rem;
}
main section > footer a {
  display: inline-block; /* for images */
  max-width: 100%; /* for images */
}
main section > footer > a > img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* main sidebar */
main > aside,
main > nav {
  padding: 1rem 5%;
}
main > aside > ul,
main > nav > ul {
  padding: 0;
  list-style: none;
}
main aside > form,
main aside > nav,
main aside > section {
  margin-bottom: 1em;
  border: 1px solid #e2e2e2;
  background-color: #f4f4f4;
}
main aside form,
main nav form {
  padding-left: 1em;
  padding-right: 1em;
}
/* main aside form div > label,
main nav form div > label {
  display: block;
} */
main aside form > div,
main aside form > fieldset > div,
main nav form > div,
main nav form > fieldset > div {
  display: block; /* cancel flexbox */
}
main aside form [type="reset"],
main aside form [type="reset"],
main aside form [type="submit"],
main nav form [type="reset"],
main nav form [type="submit"] {
  margin-left: 0;
}

main aside > section,
main aside > nav {
  padding: 0 1em;
}
main aside > section > a,
main aside > nav > a {
  display: inline-block;
  margin-bottom: 1em;
}
main aside > section > form {
  margin: 1em 0;
  padding: 0;
  border: 0;
  background-color: transparent;
}
main aside form p,
main nav form p {
  margin-left: 0;
}
main aside legend {
  color: inherit;
}

body > nav + main {
  padding: 0 5%;
}

/* magazine and newspaper */
main > .magazine,
main > .newspaper {
  padding-left: 5%;
  padding-right: 5%;
}
.magazine,
.newspaper {
  column-gap: 3rem;
  -moz-column-gap: 3rem;
  -webkit-column-gap: 3rem;
}
.magazine {
  columns: 20rem 2;
  -moz-columns: 20rem 2;
  -webkit-columns: 20rem 2;
}
.newspaper {
  columns: 12rem 3;
  -moz-columns: 12rem 3;
  -webkit-columns: 12rem 3;
}
.magazine > *,
.newspaper > * {
  display: inline-block;
  width: 100%;
}
.magazine > section,
.newspaper > section {
  padding: 0;
}
main section > header + .magazine > * > :first-child,
main section > header + .newspaper > * > :first-child {
  /*margin-top: 0;*/
}
main aside ~ div > .magazine,
main aside ~ div > .newspaper,
main > nav ~ div > .magazine,
main > nav ~ div > .newspaper {
  padding: 0 5%;
}

/* .pure-img */
main > section > img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* body header and footer */
body > header,
body > footer {
  font-size: .9375em;
}
body > header nav ul,
body > footer nav ul {
  padding: 0;
  list-style: none;
}
body > header > div.logo {
  /* the logo sometimes is a direct descendant of body header */
  padding: 0;
}
body > header nav ul:not(.external) > li > a,
body > header .logo > a {
  text-decoration: none;
}

/* body header */
body > header {
  color: #fff;
  left: 0;
  top: 0;
  width: 100%;
  height: 4.25rem;
  border-bottom: .375rem solid #aaa;
  background-color: #333;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}
body > header nav ul {
  margin: 0;
}

/* logo */
body > header .logo > a {
  font-size: 2rem;
  font-weight: bold;
  display: inline-block; /* decrease click area width */
  line-height: 2rem;
  vertical-align: top;
}
body > header .logo > p {
  line-height: 1.5rem; /* round line-height */
  margin: 0;
}

/* menu toggle */
#menutoggle {
  color: transparent;
  position: absolute;
  right: 5%;
  top: 1rem;
  width: 3rem;
  min-width: auto; /* reset */
  height: 2.25rem;
  border: 1px solid #777;
  border-radius: .125rem;
  background: center / 1rem no-repeat url('data:image/svg+xml,<svg fill="%23888" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 1344v128q0 26-19 45t-45 19h-1408q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h1408q26 0 45 19t19 45zm0-512v128q0 26-19 45t-45 19h-1408q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h1408q26 0 45 19t19 45zm0-512v128q0 26-19 45t-45 19h-1408q-26 0-45-19t-19-45v-128q0-26 19-45t45-19h1408q26 0 45 19t19 45z"/></svg>');
  z-index: 2;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
body > header.is-open {
  max-height: 30rem;
}
body > header.is-open #menutoggle {
  opacity: .75;
}


/* body header form */
body > header form {
  margin-top: 1em;
}
body > header form.search label {
  visibility: hidden;
}

body > header form + nav > ul.external {
  margin: .875rem 0;
}

/* external nav links */
body > header nav > ul.external {
  /* font-size: .875rem; */
  float: right;
  margin: .375rem 0;
}
body > header nav > ul.external > li {
  display: inline-block;
}
body > header nav > ul.external > li:not(:last-child) {
  margin-right: 1em;
}
body > header nav > ul.external > li > a:not(:hover) {
  color: #888;
}

/* site nav links */
body > header nav > ul:not(.external) {
  clear: right;
  line-height: 1.5rem; /* round line-height */
}
/* links and buttons */
body > header nav > ul:not(.external) a,
body > header nav > ul:not(.external) > li > button {
  width: 100%;
  padding: .25rem 1em;
  transition-property: background-color;
  -webkit-transition-property: background-color;
}
body > header nav > ul:not(.external) a {
  color: #fff;
  display: block;
  box-sizing: border-box;
}
body > header nav > ul:not(.external) a:focus,
body > header nav > ul:not(.external) > li > button:focus {
  outline: 0;
}
body > header nav > ul:not(.external) a > i.fa {
  /* equivalent of Font Awesome's fa-fw class */
  width: 1.28571429em;
  text-align: center;
}
/* top level links and buttons */
body > header nav > ul:not(.external) > li > a,
body > header nav > ul:not(.external) > li > button {
  border-radius: .125rem;
  background-color: #444;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset;
}
body > header nav > ul:not(.external) > li > a:hover,
body > header nav > ul:not(.external) > li > a:focus,
body > header nav > ul:not(.external) > li > button:hover,
body > header nav > ul:not(.external) > li > button:focus {
  background-color: #555;
}
body > header nav > ul:not(.external) > li > button {
  color: inherit;
  min-width: 0;
  line-height: inherit;
  vertical-align: baseline;
}
body > header nav > ul:not(.external) > li > button::after {
  content: ' ▾';
  font-size: .875rem;
}
body > header nav > ul:not(.external) > li.is-open > button {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  background-color: #555;
}

/* sub links */
body > header nav > ul:not(.external) > li > ul {
  height: 0;
  overflow: hidden;
  transition: height ease-in-out .2s;
  -webkit-transition: height ease-in-out .2s;
}
body > header nav > ul:not(.external) > li > ul > li > a {
  background-color: #555;
}
body > header nav > ul:not(.external) > li > ul > li > a:hover,
body > header nav > ul:not(.external) > li > ul > li > a:focus {
  background-color: #666;
}

/* body group */
body > div.group {
  display: -webkit-flex;
  display: flex;
}
body > div.group > nav {
  flex-shrink: 0;
  font-size: .9375rem;
  color: #fff;
  background-color: #444;
}
body > div.group > nav a {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: .5rem 1em;
  -webkit-transition: background-color .2s;
  transition: background-color .2s;
}
body > div.group > nav > h2 {
  font-size: inherit;
  /* text-align: center; */
  /* margin: 0; */
}
body > div.group > nav > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
body > div.group > nav > ul > li > a {
  text-shadow: 0 -1px 1px rgba(0, 0, 0, .5);
  border-bottom: 1px solid rgba(0, 0, 0, .2);
}
body > div.group > nav > ul > li > a:hover {
  background-color: rgba(255, 255, 255, .1);
}
body > div.group > nav form {
  padding: 1em;
  border: 0;
  background-color: transparent;
}

body > div.group > nav input:not([type]),
body > div.group > nav input[type="text"],
body > div.group > nav input[type="password"],
body > div.group > nav input[type="email"],
body > div.group > nav input[type="url"],
body > div.group > nav input[type="date"],
body > div.group > nav input[type="month"],
body > div.group > nav input[type="time"],
body > div.group > nav input[type="datetime"],
body > div.group > nav input[type="datetime-local"],
body > div.group > nav input[type="week"],
body > div.group > nav input[type="number"],
body > div.group > nav input[type="search"],
body > div.group > nav input[type="tel"],
body > div.group > nav input[type="color"],
body > div.group > nav select,
body > div.group > nav button,
body > div.group > nav [type="button"],
body > div.group > nav [type="reset"],
body > div.group > nav [type="submit"],
body > div.group > nav .button {
  width: 100%;
  margin: 0;
}
body > div.group > nav button,
body > div.group > nav [type="button"],
body > div.group > nav [type="reset"],
body > div.group > nav [type="submit"],
body > div.group > nav .button {
  padding-top: .375rem;
  padding-bottom: .375rem;
}

body > div.group > main {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  max-width: none;
}

/* body footer */
body > footer {
  background-color: #222;
}
body > footer > div {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
body > footer nav {
  padding-left: 5%;
  padding-right: 5%;
}
body > footer nav > ul {
  text-align: center;
}
body > footer nav > ul > li {
  display: inline-block;
  margin: .25rem 1rem;
}
body > footer nav.categories > ul {
  text-align: inherit;
}
body > footer nav.categories > ul > li {
  display: block;
  margin: 0;
}
body > footer nav > ul.external > li > a:not(:hover) {
  color: #777;
}
/* copyright */
body > footer > div.copyright {
  color: #666;
  padding: .5rem 0;
  background-color: #333;
}

@media (min-width: 30rem) {
  .magazine form label:only-child,
  .magazine button:not(:only-child),
  .magazine [type="submit"]:not(:only-child),
  .newspaper form label:only-child,
  .newspaper button:not(:only-child),
  .newspaper [type="submit"]:not(:only-child) {
    margin-left: 0;
  }
}

@media screen and (max-width: 39.9375rem) {
  body {
    padding-top: 4.625rem; /* compensate for absolute positioned body header min height */
  }
  body > header {
    position: absolute;
    overflow: hidden;
    -webkit-transition: height ease-in-out .3s;
    transition: height ease-in-out .3s;
  }
  body > header nav {
    padding-top: .375rem;
  }
  body > header nav > ul:not(.external) > li:not(:last-child) {
    margin-bottom: .1875rem;
  }
  body > header > div {
    padding-top: .375rem;
    padding-bottom: .375rem;
  }
}

@media screen and (min-width: 40rem) {
  h1 {
    font-size: 2.375em;
  }

  body > header [type="submit"],
  body > footer [type="submit"] {
    margin-top: 0;
  }
  body > footer nav.categories {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }
  body > footer nav.categories > section:not(:last-child) {
    margin-right: 2rem;
  }

  body > nav {
    float: left;
    padding-right: 0;
  }
  body > nav + main {
    margin-left: 20%;
  }

  main > aside,
  main > nav,
  section > aside {
    float: left;
    width: 24%;
    padding-left: 3%;
  }
/*   body > :not(header) :not(main) > aside,
  body > :not(header) :not(main) > nav {
    padding-right: 3%;
  } */
  main > aside,
  main > nav {
    padding-right: 0;
  }
  main section > aside {
    padding-left: 3%;
    padding-right: 0;
    padding-bottom: 0;
  }

  main > nav form input,
  main > nav form button:not([type]),
  main > nav form [type="submit"] {
    min-width: 0;
    max-width: 100%;
  }
  main aside ~ div,
  main > nav ~ div,
  main > nav ~ section {
    margin-left: 27%
  }
/*     main aside ~ div > section,
  main > nav ~ div > section {
    padding-left: 0;
  } */

/*     main aside ~ div > .magazine,
  main aside ~ div > .newspaper,
  main > nav ~ div > .magazine,
  main > nav ~ div > .newspaper {
    padding-left: 0;
  } */

  #menutoggle {
    display: none;
  }

  body > header {
    min-height: 8rem; /* in case JS sets height to 0 */
    height: 8rem;
  }
  body > header .logo {
    float: left;
    margin-top: 2.25rem;
  }

  body > header form {
    position: absolute;
    right: 5%;
    margin-top: .5em;
    margin-bottom: .5em;
  }
  body > header form:not(:last-of-type) {
    margin-left: 1rem;
  }
  body > header form.login {
    top: 0;
  }
  body > header form.search {
    bottom: 0;
  }
  body > header form > div {
    display: inline-block;
  }

  body > header nav {
    clear: right; /* in case float right previous form */
  }
  body > header nav > ul.external {
    margin: 2.25rem 0;
    line-height: 1.5rem; /* round line-height */
  }
  body > header > div > :not(form) + nav > ul:not(.external):only-child {
    position: relative;
    top: 6rem;
  }
  body > header > div > :not(form) + nav > ul.external:only-child {
    margin: 3.25rem 0;
  }

  body > header nav > ul:not(.external) {
    text-align: right;
  }
  body > header nav > ul:not(.external) > li {
    text-align: left;
    display: inline-block;
  }

  body > header > div > form + nav > ul:not(.external):only-child {
    margin-top: 2rem;
  }
  body > header nav > ul:not(.external) > li > ul {
    position: absolute;
  }
  body > header nav > ul:not(.external) > li > a,
  body > header nav > ul:not(.external) > li > button {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }
  body > header nav > ul > li.is-open > ul {
    border-bottom: .375rem solid #888;
  }

  body > footer {
    clear: both;
  }
}

@media screen and (min-width: 60rem) {
  body > header form,
  body > footer form,
  table form {
    padding-left: 0;
    padding-right: 0;
  }
  .magazine form,
  .newspaper form {
    padding-left: 1rem;
    padding-right: 1rem;
  }

/*   main > section,
  main :not(aside):not(nav) > section,
  main aside ~ div > .magazine, main aside ~ div > .newspaper, main > nav ~ div > .magazine, main > nav ~ div > .newspaper {
    padding-left: 6%;
    padding-right: 6%;
  } */
  main > aside {
    padding-right: 0;
  }
  .magazine,
  .newspaper {
    column-gap: 4rem;
    -moz-column-gap: 4rem;
    -webkit-column-gap: 4rem;
  }
}

/* form */
form input:not([type]),
form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="url"],
form input[type="date"],
form input[type="month"],
form input[type="time"],
form input[type="datetime"],
form input[type="datetime-local"],
form input[type="week"],
form input[type="number"],
form input[type="search"],
form input[type="tel"],
form input[type="color"],
form input[type="file"],
form input[type="range"],
form select,
form textarea {
  width: 100%; /* flexbox needs both widths set */
  min-width: 0;
}
form textarea {
  min-width: 100%;
  max-width: 100%;
  height: 8em;
  min-height: 4rem;
}

form > p,
form > fieldset > p {
  margin-top: 0;
}

form > div,
form > fieldset > div {
 margin: .5em 0;
}

form button,
form [type="button"],
form [type="reset"],
form [type="submit"] {
  margin: .5rem 0;
}
form button:only-child,
form [type="button"]:only-child,
form [type="reset"]:only-child,
form [type="submit"]:only-child {
  margin: 0;
}

/* form control classes */
input.loading,
select.loading,
textarea.loading {
  background-image: url('images/throbber.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 1.5rem;
}

form table {
  margin: .5em 0;
  background-color: #fff;
}
form table + div:only-of-type {
  margin-top: 1rem;
}

form ol,
form ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
form li {
  margin: .25em 0;
}

/* form single div */
form > div:only-of-type > [type="submit"],
form > fieldset > div:only-of-type > [type="submit"] {
  margin-bottom: 0;
}
/* form single div variant 2 (filter) */
form > div:only-child > label,
form > fieldset:only-child > div:only-of-type > label {
  position: absolute;
  visibility: hidden;
}
form > div:only-child > :nth-child(2):nth-last-child(2),
form > fieldset:only-child > div:only-of-type > :nth-child(2):nth-last-child(2) {
  flex-basis: auto;
}

@media (min-width: 30rem) {
  form > div:only-of-type, /* do not put the submit outside the form control block */
  form > fieldset > div:only-of-type {
    margin: 0;
  }
  form > div:only-of-type > [type="submit"],
  form > fieldset > div:only-of-type > [type="submit"] {
    min-width: auto; /* set default min-width, otherwise flexbox word-spacing won't let the button grow when the value text is too long */
    margin: 0 0 0 .5rem;
  }
}

@media screen and (max-width: 29.9375rem) {
  form input ~ input,
  form input ~ select,
  form select ~ input,
  form select ~ select {
    margin-top: .25rem;
  }

  form button,
  form [type="button"],
  form [type="reset"],
  form [type="submit"],
  form .button {
    width: 100%;
  }

  form > div,
  form > fieldset > div {
    margin-top: .75em;
  }

  form div > label {
    display: block;
    margin: .125em 0;
  }
}

@media (min-width: 30rem) {
  form input[type="file"] {
    margin: .3125rem 0;
  }
  form input[type="range"] {
    margin: .4375rem 0;
  }

  form > div,
  form > fieldset > div {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: flex-start; /* don't use all vertical space */
    align-items: flex-start;
  }
  form ol,
  form ul,
  /* form :not(td):not(th):not(li) > select, */
  form input:not([type]),
  form input[type="text"],
  form input[type="password"],
  form input[type="email"],
  form input[type="url"],
  form input[type="date"],
  form input[type="month"],
  form input[type="time"],
  form input[type="datetime"],
  form input[type="datetime-local"],
  form input[type="week"],
  form input[type="number"],
  form input[type="search"],
  form input[type="tel"],
  form input[type="color"],
  form input[type="file"],
  form select,
  form textarea {
    -webkit-flex: 0 1 62%;
    flex: 0 1 62%;
  }
  form ol,
  form ul {
    margin: .125em 0;
  }
  form div > textarea {
    min-width: auto;
    max-width: none;
  }
  aside form div > textarea,
  nav form div > textarea {
    min-width: 100%;
    max-width: 100%;
  }


  form input ~ input,
  form input ~ select,
  form select ~ input,
  form select ~ select {
    margin-left: .25rem;
  }

  form > div > input + span,
  form > div > output + span,
  form > div > select + span,
  form > div > textarea + span,
  form > fieldset > div > input + span,
  form > fieldset > div > output + span,
  form > fieldset > div > select + span,
  form > fieldset > div > textarea + span {
    margin: .375rem 0 .375rem .5rem;
    white-space: nowrap;
  }
  form > div > output,
  form > div > span,
  form fieldset > div > output,
  form fieldset > div > span {
    margin: .375rem 0;
  }


/*   form ol,
  form ul {
    margin-bottom: .5rem;
  } */
/*   form label + ol,
  form label + ul {
    margin: .125em 0;
  } */

  form div > label:first-child {
    -webkit-flex: 0 0 38%;
    flex: 0 0 38%;
    margin: .375rem 0;
    padding-right: 1rem;
    box-sizing: border-box;
  }

  form > p,
  form > fieldset > p,
  form > fieldset > ol,
  form > fieldset > ul {
    margin-left: 38%;
  }

  form div > label:only-child,
  form div > span:only-child {
    flex-basis: 62%;
    margin-left: 38%;
  }

  form div > span:not(:last-child),
  form > fieldset > div > span:not(:last-child) {
    margin: .375rem .5rem .375rem 0;
  }

  table [type="submit"],
  form > [type="submit"]:only-child,
  form > :not(div):not(fieldset) + [type="submit"] {
    margin: 0; /* reset */
  }

  form div > span > input:not([type]),
  form div > span > input[type="text"],
  form div > span > input[type="password"],
  form div > span > input[type="email"],
  form div > span > input[type="url"],
  form div > span > input[type="date"],
  form div > span > input[type="month"],
  form div > span > input[type="time"],
  form div > span > input[type="datetime"],
  form div > span > input[type="datetime-local"],
  form div > span > input[type="week"],
  form div > span > input[type="number"],
  form div > span > input[type="search"],
  form div > span > input[type="tel"],
  form div > span > input[type="color"],
  form div > span > input[type="file"],
  form div > span > input[type="range"] {
    width: auto; /* reset */
  }

  aside form input[type="file"],
  nav form input[type="file"] {
    margin: 0;
  }
  aside form input[type="range"],
  nav form input[type="range"] {
    margin: 0;
  }

  aside form > div,
  aside form > fieldset > div,
  nav form > div,
  nav form > fieldset > div {
    margin-top: .75em;
  }
  aside form div > label,
  nav form div > label {
    display: block;
    margin: .125em 0;
    padding-right: 0;
  }
  aside form div > label:only-child,
  nav form div > label:only-child {
    margin-left: 0;
  }

  form > div > input[type="range"] + span,
  form > fieldset > div > input[type="range"] + span {
    width: 31%;
  }
  form [type="reset"],
  form [type="submit"] {
    margin-left: 38%;
  }
  form button:not([type="reset"]):only-child,
  form [type="submit"]:only-child {
    margin-left: 0;
  }

  form > figure,
  form > fieldset > figure {
    margin: 0 0 0 38%;
  }
}

@media screen and (min-width: 40rem) {
  form {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  body > header form,
  body > footer form {
    font-size: .75rem;
  }
}

/* table */
table {
  width: 100%;
}
/* form in table */
table form {
  display: inline-block;
  padding: 0;
  border: 0;
  background-color: transparent;
}
/* button in table */
table button,
table [type="button"],
table [type="reset"],
table [type="submit"],
table .button {
  font-size: .875rem;
  min-width: 4rem;
  line-height: 1;
  padding: .3125rem .625rem;
  vertical-align: top;
}
/* input in table */
table input:not([type]),
table input[type="text"],
table input[type="password"],
table input[type="email"],
table input[type="url"],
table input[type="date"],
table input[type="month"],
table input[type="time"],
table input[type="datetime"],
table input[type="datetime-local"],
table input[type="week"],
table input[type="number"],
table input[type="search"],
table input[type="tel"],
table input[type="color"],
table select,
table textarea {
  width: 100%;
}

/* body header and body footer */
body > header form,
body > footer form {
  padding: 0;
  border: 0;
  background-color: transparent;
}

body > header [type="submit"],
body > footer [type="submit"],
main aside [type="submit"] {
  min-width: auto;
  margin-left: 0;
}
/* form in section footer */
section > footer > form {
  display: inline-block;
}

