body {
  min-width: 16rem;
  display: flex;
  width: 100%; /* required when setting overflow-x to auto on wide elements such as result tables */

  &.layout-wide {
    flex-direction: column;
  }
}

body > .page-cont {
  margin: 0 auto;
  max-width: 1200px;
  width: 100%;
}

header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--grey2);
  box-shadow: 0 0 1.2rem var(--grey2);

  .banner-cont {
    display: flex;
    justify-content: space-between;
    background-color: white;

    .banner {
      flex: auto;
    }
  }

  .logo-lfi {
    height: 8rem;

    a {
      display: block;
      height: 100%;
      text-decoration: none;
    }

    svg.logo,
    svg.logo-text {
      display: inline-block;
      height: 100%;
    }

    svg.logo {
      --logo-bg: var(--greenWsl);
      --logo-text: #ffffff;
    }

    svg.logo-text {
      display: none;
      fill: var(--greenWsl);
    }
  }

  .header-back-link-container {

    a {
      color: var(--red1);
      text-decoration-thickness: from-font;

      &:hover {
        text-decoration: none;
      }
    }
  }

  .menu-cont {
    font-size: 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    padding: 1rem;

    & > div {
      display: flex;
      align-items: center;
    }

    .icon {
      width: 2rem;
      height: 2rem;
    }
  }

  button.hamburger {

    &.icon {
      padding-right: 0;
      border: none;
      width: auto;
    }

    span {
      color: #000000;
    }

    svg {
      margin-left: .5rem;
    }
  }

  nav.lang {
    line-height: 1;

    ul {
      margin: 0;
      padding: 0;
      display: flex;
    }

    li {
      margin-right: .75rem;
      border-right: 0.1rem solid var(--grey4);
      padding-bottom: 0.1rem;

      &:last-child {
        border-right: none;
      }

      &.navActive {
        padding-right: .75rem;
        color: var(--blue1);
      }
    }

    a {
      padding-right: .75rem;
      text-decoration: none;
      color: inherit;

      &:hover {
        color: var(--blue1);
      }
    }
  }

  nav.lang,
  button.menu {
    color: var(--grey4);
    cursor: pointer;
  }
}

nav {

  &.main {
    display: none;
    margin-bottom: 3rem;
    width: 100vw;
    left: -1rem;
    position: relative;
    padding: 0 1rem;
    box-shadow: 0 .5rem .5rem var(--grey1);

    &.open {
      display: block;
    }

    ul {
      margin: 0;
      padding: 0;
    }

    .menu {

      ul {
        margin: 0 0 0 1rem;
        padding: 0;
      }

      a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-decoration: none;
        padding: 0.7rem 0;
        border-bottom: 1px solid var(--green2);
        color: var(--greenWsl);
      }

      & > li:last-of-type.menuOpen > ul > li:last-of-type a {
        border-bottom: none;
      }

      & > li:last-of-type a {
        border-bottom: none;
      }
    }

    .menuHasChild {

      &:not(.menuOpen) > ul {
        display: none;
      }

      & > a:after {
        content: '';
        width: 0;
        height: 0;
        border-right: .45rem solid var(--greenWsl);
        border-top: .45rem solid transparent;
        border-bottom: .45rem solid transparent;
        border-left: .45rem solid transparent;
      }
    }

    .menuOpen > a:after {
      border-top: .45rem solid var(--greenWsl);
      border-right: .45rem solid transparent;
    }

    .menuActive:not(.menuHasChild) > a,
    .menuHasActiveChild > a {
      color: var(--red1);
    }
  }

  .nav-user {
    font-size: var(--font-small);
    margin-bottom: 2rem;

    span.loggedIn {
      font-weight: bold;
    }

    a {
      color: black;
    }

    #loggedIn:before {
      content: '';
      display: inline-block;
      width: 0.5rem;
      height: 0.5rem;
      border-radius: 0.4rem;
      background-color: var(--red-accent);
      margin-right: 0.4rem;
      vertical-align: middle;
    }
  }
}

#menuUser.menu {

  li {

    a {
      border-bottom: 1px solid var(--green2);
    }
  }
}

main {
  padding: 1rem;
}

aside {

  &.cont-right {
    margin: 0 auto 1.5rem auto;
    width: 100%;
    font-size: var(--font-small);

    figure {
      margin: 0 0 1.5rem 0;
    }

    ul {
      margin-left: 0;
      /*padding-left: 0;*/
    }
  }
}

footer {
  margin-top: 3rem;

  &::before {
    content: " ";
    margin: 1rem auto 1.25rem auto;
    display: block;
    width: 100%;
    clear: right;
    border-top: 1px solid var(--grey2);
  }

  .logo-wsl svg {
    width: 2rem;
    height: 2rem;
    fill: var(--greenWsl);
    float: left;
    margin-right: 0.5rem;
  }

  ul,
  span {
    font-size: var(--font-small);
  }

  ul {
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  li {
    display: inline-block;

    &:after {
      content: " | ";
    }

    &:last-child:after {
      content: none;
    }
  }
}

.aside-image {
  display: block;
  border: 1px solid #cccccc;
}

article {
  /*min-height: 24rem;*/
  margin-bottom: 1rem;
}

@media screen and (min-width: 768px), print {
  header {
    .logo-lfi svg.logo-text {
      display: inline-block;
      margin-left: .5rem;
    }

    .menu-cont {
      font-size: var(--font-default);

      .icon {
        width: var(--font-default);
        height: var(--font-default);
      }
    }
  }

  aside.cont-right {
    float: right;
    margin-left: 1.5rem;
    max-width: 33.3rem;
    width: 37%;
  }

  aside.cont-right::after {
    content: none;
  }

  nav {

    &.main {

      .menu {

        a {
          font-size: var(--font-default);
        }
      }
    }
  }
}

@media screen and (min-width: 1024px), print {
  header {
    display: block;
    padding-right: 0;

    .banner-cont {
      box-shadow: inset 3.8rem 0 var(--greenWsl);
    }

    .banner {
      background-image: url('/api/layout/image');
      background-position: left;
      background-size: 93.2rem 10rem;
      height: 10rem;
    }

    .menu-cont {
      padding: 0.4rem 0.4rem 0.4rem 0;
    }

    button.hamburger {
      display: none;
    }
  }

  @media (min-resolution: 132dpi) {
    header .banner {
      background-image: url('/api/layout/image/hires');
    }
  }

  main {
    display: flex;
    padding: 1rem;
  }

  nav.main {
    display: block;
    width: 19rem;
    margin-top: 0.8rem;
    flex: none;
    margin-right: 2.5rem;
    margin-bottom: 0;
    padding: 0;
    left: 0;
    box-shadow: none;
    background-color: #ffffff;

    .menu {

      a {
        color: var(--greenWsl);
        border-bottom: 1px solid var(--green2);

        &:hover {
          color: var(--red1);
        }
      }

      li:last-of-type {

        a {
          border-bottom: 1px solid var(--green2);
        }
      }
    }

    .menuHasChild {

      & > a:after {
        border-right: .45rem solid var(--greenWsl);
        border-top: .45rem solid transparent;
        border-bottom: .45rem solid transparent;
        border-left: .45rem solid transparent;
      }
    }

    .menuOpen > a:after {
      border-top: .45rem solid var(--greenWsl);
      border-right: .45rem solid transparent;
    }

    .menuActive:not(.menuHasChild) > a,
    .menuHasActiveChild > a {
      color: var(--red1);
    }
  }

  .article-cont {
    flex-grow: 1;
    /* overflow: auto; */ /* do we need this?, it cuts off the search dropdown, when longer than content */
  }

  footer {
    margin-top: 6rem;
  }
}

@media print {
  @page {
    margin: 1.2cm 0.6cm;
  }

  nav.main.hidden {
    display: none;
  }
}