/* IE8 compatibility */
article,
aside,
footer,
header,
main,
nav,
section {
  display: block;
}

/* Screen Reader only */
.accessibility {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0,0,0,0);
  overflow: hidden;
}

/* Generic */
html {
  padding: 0 8px;
  background: #e6ecef;
  box-sizing: border-box;
  overflow-x: hidden;
  font-family: Helvetica, Arial, sans-serif;
}

/* Default box-sizing */
*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  position: relative;
  max-width: 1400px;
  width: 100%;
  overflow-x: hidden;
  padding: 0;
  margin: 0 auto;
  background: white;
  z-index: 1;
}

button {
  cursor: pointer;
}

/* Skip to content link */
a[href="#main"].accessibility:focus {
  all: unset;
  display: block;
  position: relative;
  width: 100%;
  height: 20px;
  margin: 0;
  clip-path: none;
  clip: auto;
  overflow: initial;
}
#main {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0.1px;
  color: #2e3436;
  /* Better Font Rendering */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
}
#main h2 {
  font-family: Georgia, "Bitstream Charter", serif;
}

/* Page-intro */
.intro {
  padding: 120px 4%;
}
.intro .title-image {
  padding-bottom: 10px;
  max-width: 400px;
}
.intro .title-text {
  font-size: 1.2em;
}
.intro form {
  font-size: 0.8em;
}

/* Header illustration */
#potion {
  animation: disappear ease-in-out 4s infinite alternate;
}
#potion-right {
  animation: appear ease-in-out 4s infinite alternate;
}
.intro ellipse {
  animation: bubble ease 6s infinite normal;
}
@keyframes appear {
  from {opacity: 0;}
  to {opacity: 1;}
}
@keyframes disappear {
  from {opacity: 1;}
  to {opacity: 0;}
}
@keyframes bubble {
  0% {transform: scale(0.9) translate(1%, 10%);}
  30% {transform: scale(1.1) translate(-1%, -2%);}
  60% {transform: scale(1.1) translate(-1%, -3%);}
  to {transform: scale(1.2) translate(-2%, -8%);}
}

/* RW-Projects */
.rw-projects {
  color: #055372;
  background-color: #e6ecef;
}
.decommissioned-projects {
  color: #2e3436;
}
.rw-project-list {
  overflow: auto;
}
.rw-project-list {
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(300px, 1fr));
  grid-gap: 2em 4%;
  margin: auto 4%;
  padding-bottom: 80px;
}
/* Grid fallback - overridden by grid and in @supports block */
.rw-project-list-item {
  display: inline-block;
  width: 100%;
  vertical-align: top;
}
.rw-projects h2,
.decommissioned-projects h2 {
  margin: 0 4%;
  padding-top: 40px;
}
.rw-projects h2:before {
  content: url("../img/rw.svg");
  position: relative;
  padding-right: 10px;
  top: 10px;
}
.rw-projects h3,
.decommissioned h3 {
  height: 2em;
}
.project-origin {
  border-radius: 4px 4px 4px 4px;
  line-height: 2em;
  padding-left: 10px;
}
.project-origin.rwideas {
  background-color: #f65c51;
  color: #e6ecef;
}
.project-origin.community {
  background-color: #055372;
  color: #e6ecef;
}
.rw-projects .rw-project-list-item a {
  color: #055372;
}
.rw-project-list-item a:hover,
.rw-project-list-item a:focus {
  color: #055372;
  opacity: 0.8;
  text-decoration: none;
}
.rw-project-list-item img {
  border-radius: 10px;
  margin: 18px 0;
  width: 100%;
}
.decommissioned-projects .rw-project-list-item a {
  color: #2e3436;
}
.decommissioned-projects a:hover,
.decommissioned-projects a:focus {
  color: #2e3436;
}
.decommissioned-projects img {
  border: 1px solid #ddd;
}
.rw-description {
  font-size: 1.2em;
}
.project-page .rw-description,
.project-page .project-origin {
  margin-top: 80px;
}
.rw-status {
  font-size: 0.9em;
}

/** Grid fallback **/
@media screen and (min-width : 500px) {
  .rw-project-list-item {
    width: 46%;
    margin-right: 3%;
  }
  .rw-project-list-item:nth-child(2n) {
    margin-right: 0;
  }
}

@media screen and (min-width : 768px) {
  .rw-project-list-item {
    width: 30%;
    margin-right: 4%;
  }
  .rw-project-list-item:nth-child(2n) {
    margin-right: 4%;
  }
  .rw-project-list-item:nth-child(3n) {
    margin-right: 0;
  }
}

@supports (display: grid) {
  .rw-project-list-item {
    max-width: 400px;
    width: auto;
    margin: 0;
  }
  .rw-project-list-item:nth-child(n) {
    margin-right: 0;
  }
}
