/* Base
------------------------------ */

BODY {
  margin: 0;
  font: 16px/1.4 "Trebuchet MS", Arial, sans-serif;
  color: #000;
}

A {
  color: steelblue;
}

H1, H2, H3, H4 {
  font-family: Georgia, serif;
  font-weight: normal;
}

H1 {
  font-size: 2.5em;
  text-align: center;
}

H2 {
  margin: 0;
  margin-bottom: .5em;
  font-size: 2em;
}

H3 {
  margin: 0;
  margin-bottom: .35em;
  font-size: 1.25em;
}

H4 {
  margin: 0;
  margin-bottom: .5em;
  font-size: 1.1em;
}

P {
  margin: 1.2rem 0;
}

TEXTAREA {
  width: 100%;
  height: 150px;
  margin: 0;
  padding: .5em;
  border: 1px solid #CCC;
  border-radius: 8px;
  font-size: 13px;
  font-family: monospace;
}

CODE {
  padding: 0 3px;
  background: #EEE;
  border-radius: 5px;
  text-shadow: 1px 1px 0 white;
  font-family: monospace;
  color: #333;
}



/* Helpers
------------------------------ */

.hidden {
  display: none;
  }

.visuallyhidden {
  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;
}



/* Layout
------------------------------ */

.wrapper {
  min-width: 375px;
  max-width: 900px;
  margin: auto;
  padding: 1.5rem 2rem 4rem;
  box-sizing: border-box;
}

.header {
  position: relative;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #CCC;
}

.footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #CCC;
}

.section + .section {
  margin-top: 2.5em;
}



/* Examples
------------------------------ */
.examples {
  width: 100%;
}

.examples__container {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -4px;
}

.examples__control {
  flex-basis: 40px;
  height: 40px;
  flex-shrink: 0;
  margin: 4px;
  padding: 4px;
  background: #FFF;
  border: 1px solid #CCC;
  border-radius: 8px;
  cursor: pointer;
}

.examples__control:focus {
  outline: none;
  box-shadow:
    0 0 0 2px yellowgreen,
    0 0 0 1px teal inset;
  border-color: teal;
}

.examples__control--current {
  box-shadow: 0 0 0 2px yellowgreen;
  border-color: yellowgreen;
}

.examples__control svg {
  width: 100%;
  height: 100%;
}



/* Containers
------------------------------ */

.containers {
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  }

.container {
  position: relative;
  margin-bottom: 1em;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.container__header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.container__label {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding-left: 1em;
}



/* Demos
------------------------------ */

.demos {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.demos svg {
  display: block;
  width: 100%;
  height: 300px;
  outline: 1px solid #CCC;
}

@media (max-width: 700px) {
  .demos svg {
    height: 200px;
  }
}

.demos__svg-container {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.demos__item {
  width: calc((100% - 3rem) / 3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 700px) {
  .demos__item {
    width: 100%;
  }
}

.demo {
  width: 100%;
  outline: 1px solid #CCC;
}

.demo__target {
  width: 100%;
  height: 300px;
  background: url(https://source.unsplash.com/600x600?summer);
  background-size: cover;
}

@media (max-width: 700px) {
  .demo__target {
    height: 200px;
  }
}

.demo__target--before {
  background-color: teal;
  -webkit-clip-path: url(#clip-path-before);
  clip-path: url(#clip-path-before);
}
.demo__target--after {
  background-color: turquoise;
  -webkit-clip-path: url(#clip-path-after);
  clip-path: url(#clip-path-after);
}



/* Full code
------------------------------ */

.full-codes {
  display: flex;
  justify-content: space-between;
}

.full-codes__item {
  width: calc((100% - 3rem) / 2);
  height: auto;
}

.full-codes TEXTAREA + H3 {
  margin-top: 1.5em;
}

.full-codes__result {
  display: flex;
  align-items: center;
}
