html {
  font-size: 17px;
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}

/* #############
 * Sticky footer
 * #############
 * Inspired by https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/
 */
body {
  margin: 0; /* Avoid a border around the entire page */

  line-height: 1.4;
}

div.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* CSS3: 100% viewport height */
  margin: 0;
  padding: 0;
}

main {
  /* 1 0 0 (instead of 1) ensures that the same mode is also used in IE 10 and
   * in IE 11. */
  flex: 1 0 0;
}


/* #######
 * General
 * #######
 */
body {
  /* Display a black background on mobile devices or in Chrome or Safari when
   * the user scrolls over or below the actual website. On the iPhone in
   * landscape mode, this also creates good looking black borders on the left
   * and right side instead of white ones.
   *
   * In Firefox under Windows this causes a black vertical scroll bar.
   * Currently no CSS flag exists to set the scroll bar color of Firefox. */
  background-color: #000;
  font-family: "Helvetica", sans-serif;
}

/*  If instead of using this div.page, the header, main and footer backgrounds
 *  would be set to white, the page would almost look perfect and this div
 *  wouldn't be needed. Except when zooming in under Chrome or Safari. Then,
 *  horizontal hairlines would be visible between the header and the main as
 *  well as between the main and the footer. Using this div prevents the
 *  unwanted hairlines.
 */
div.page {
  background-color: #fff;
  color: #000;
}

h1 {
  font-size: 1.4rem;
  font-weight: 500;
}

h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0.6rem 0 0.8rem 0;
}

p {
  font-size: 1rem;
  font-weight: 400;
  margin: 0.8rem 0 0.5rem 0;
}



/* ######
 * Header
 * ######
 */
header {
  display: flex;
  color: #fff;

  /* Before it was --left-height: 5vw, --right-height: 15vw.
   * But the drawback was that the height of the star background grew big on a
   * large browser width. And the logo had to be scaled accordingly.
   * To keep the same angle with a fixed left height:
   *
   * x := left-height
   * h := right-height
   * y := h - x
   * w := browser width = 100vw
   *
   * y / w = tan (alpha)
   * h = x + y = x + tan (alpha) * w
   *
   * tan (alpha) =[e.g. w=100]= 10 / 100 = 0.1
   *
   * => --right-height = h = x + 0.1 * w
   */
  --left-height: 40px;
  --right-height: calc(var(--left-height) + 10vw);
  --search-input-width: 22vw;

  height: calc(40px + 10vw); /* IE 10 and 11 fallback */
  height: var(--right-height);
  /* min-height: 120px; */
}

header .stars {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: calc(40px + 10vw); /* IE 10 and 11 fallback */
  height: var(--right-height);
  background-image: url("/static/home/images/2020_04_04_stars_and_mountains.jpg");
  background-position: 0% 21.5%;
  background-size: cover;
  clip-path: polygon(0 0, 100% 0, 100% var(--right-height), 0 var(--left-height));
}

/* IE 10 and 11 don't support clip-path. */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  header .stars {
    background-image: url("/static/home/images/header_triangle_for_internet_explorer.png");
    background-position: 100% 0%;
  }
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: top;
  width: 100%;
  z-index: 1;
  font-size: 1.2rem;
}

/* browser width between 760px and 1025px. */
header .logo {
  /* min-width: 15vw; would scale the logo nicely.
   * But it has the drawback that the logo would not be changed in size when 
   * the user changes his zoom factor of his user agent (e.g. by pressing
   * Command-+). So pixel values and @media is used instead.
   */
  min-width: 120px;
  height: 120px;
  margin-left: 22px;
}

header nav li {
  margin: 0;
}

header nav li a {
  display: flex;
  justify-content: flex-start;
  align-items: center;

  text-decoration: none;
  color: #fff;
}

header nav li a img {
  height: 26px;
  margin-right: 10px;
}

header nav ul.icons-only-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  width: 30vw;
  height: 40px;
  padding-left: 0;
  padding-right: 0;
  margin: 10px;
  margin-top: 3.5vw;
  margin-right: 6vw;

  list-style: none;
}

header nav ul.icons-only-header li {
  margin-top: 0;
}


/* ####
 * Main
 * ####
 */

section.grid {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 5px; /* Some space to be away from the logo */
  padding-bottom: 25px; /* Symmetry with the top */
  padding-left: 10px; /* To look good with the spacing of article */
  padding-right: 10px; /* To look good with the spacing of article */

  display: grid;    
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

section.grid article {
  padding: 5px;
  margin: 5px;
  margin-top: 20px;

  display: flex;
  flex-direction: column;
}

section.grid article a {
  margin: 0;
  padding: 0;
  color: black;
  text-decoration: none;
}

section.grid article img {
  margin-bottom: 0;
  width: 100%;
}

section.article_page {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 35px; /* Some space to be away from the logo, in particular on small screens. */
  padding-bottom: 25px; /* Symmetry with the top */
  padding-left: 5vw; /* CSS3: 100% viewport width */
  padding-right: 5vw;
}

.video_wrapper_landscape {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video_wrapper_landscape iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

section.article_page h2 {
    padding-top: 8px;
}




/* ######
 * Footer
 * ######
 */
footer {
  display: flex;
  height: 100vw;
  min-height: 120px;
  color: #fff;
}

footer .stars {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 100vw;
  background-image: url("/static/home/images/2020_04_04_stars_and_mountains.jpg");
  background-size: cover;
  background-position: 0% 25%;
  clip-path: polygon(0 0, 100% 10%, 100% 100%, 0 100%); 
  /* It might look better when the angled lines (the one in the header and the
   * one in the footer) are not parallel but have a vanishing point on the
   * left side. You might want to replace the line above with something like
   clip-path: polygon(0 0, 100% 15%, 100% 100%, 0 100%); */
}

/* IE 10 and 11 don't support clip-path. */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  footer .stars {
    background-image: url("/static/home/images/footer_for_internet_explorer.png");
    background-position: 0% 0%;
  }
}

footer div.content {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-top: 13vw;

  z-index: 1;
  font-size: 1.2rem;
}

footer ul.sponsors {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28%;
  margin: 0;
  padding: 0 0 0 4vw;
  z-index: 1;
  list-style: none;
}

footer ul.sponsors li {
  margin: 0;
  padding: 0 3vw 0 3vw;
}

footer ul.sponsors li a {
  display: flex;
  justify-content: flex-start;
  align-items: center;

  text-decoration: none;
}

footer ul.sponsors li a img {
  width: 110px;
}

footer ul.sponsors li a img.wide {
  width: 200px;
}


/* ###########################
 * Width dependent alterations
 * ###########################
 */

/* Temp comment: Maybe a max-device-width for mobile phones is needed as well.
 * See https://stackoverflow.com/questions/13550541/media-min-width-max-width.
 */

/* browser width >= 1025px. */
@media (min-width: 1025px) {
  header {
    --search-input-width: 30vw;

    /* Alternative: If only the search bar should expand.
    /* --search-input-width: calc(100vw - 815px); /* 1025px - input.width(when < 1025px) = 210px */
  }

  /* Only needed because of the IE fallback */
  header nav ul li input {
    width: 30vw; /* IE 10 and 11 fallback */
    width: var(--search-input-width);
  }
}

/* browser width <= 860px. */
@media (max-width: 860px) {
  header nav {
    font-size: 1rem;
  }

  iframe {
    width: 90vw;
    height: 51vw;
  }
}

/* browser width <= 730px. */
@media (max-width: 730px) {
  header .logo {
    min-width: 110px;
    height: 110px;
  }

  footer div.content ul.sponsors li a img {
    width: 82px;
  }
  
  footer div.content ul.sponsors li a img.wide {
    width: 150px;
  }
}

/* IE 10 and 11. */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) and (max-width: 730px) {
  footer .stars {
    background-position: 0% 0%;
  }
}

/* browser width <= 560px. */
@media (max-width: 560px) {
  header nav ul.icons-only-header {
    width: 40vw;
    margin-top: 3vw;
  }

  header nav li a img {
    height: 23px;
  }

  footer div.content ul.sponsors li a img {
    width: 77px;
  }
  
  footer div.content ul.sponsors li a img.wide {
    width: 140px;
  }
}

/* IE 10 and 11. */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) and (max-width: 560px) {
  footer .stars {
    background-position: 0% 0%;
  }
}

/* browser width <= 480px. */
@media (max-width: 480px) {
  header nav ul.icons-only-header {
    margin-top: 2vw;
  }

  header {
    --left-height: 34px;
  }

  header .logo {
    min-width: 90px;
    height: 90px;
    margin-left: 12px;
  }

  header nav li a img {
    height: 20px;
  }

  footer div.content ul.sponsors li a img {
    width: 66px;
  }
  
  footer div.content ul.sponsors li a img.wide {
    width: 120px;
  }
}

/* browser width <= 360px. */
@media (max-width: 360px) {
  footer div.content ul.sponsors {
    padding-top: 1vw;
  }

  footer div.content ul.sponsors li a img {
    width: 55px;
  }
  
  footer div.content ul.sponsors li a img.wide {
    width: 100px;
  }
}


/* browser width <= 315px. */
@media (max-width: 315px) {
  header {
    --left-height: 25px;
  }

  header .logo {
    min-width: 68px;
    height: 68px;
    margin-left: 8px;
  }

  header nav ul.icons-only-header {
    margin-top: 1vw;
  }

  header nav li a img {
    height: 15px;
  }

  section.grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  footer div.content ul.sponsors li a img {
    width: 44px;
  }
  
  footer div.content ul.sponsors li a img.wide {
    width: 80px;
  }
}

/* browser width <= 220px. */
@media (max-width: 220px) {
  section.grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

}
