@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700,700i");
@import url("https://fonts.googleapis.com/css?family=Bree+Serif");

:root {
  --max-tab-count: 5;
  --tab-wrap-border-radius: 6px;
}

.tab-wrap {
  transition: 0.3s box-shadow ease;
  border-radius: var(--tab-wrap-border-radius);
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  position: relative;
  list-style: none;
  background-color: #fff;
  margin: 40px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.tab-wrap:hover {
  box-shadow: 0 12px 23px rgba(0, 0, 0, 0.23), 0 10px 10px rgba(0, 0, 0, 0.19);
}

.tab {
  display: none;
}

.tab:checked + label {
  background-color: #fff;
  box-shadow: 0 -1px 0 #fff inset;
  cursor: default;
}

.tab:checked + label:hover {
  box-shadow: 0 -1px 0 #fff inset;
  background-color: #fff;
}

.tab + label {
  box-shadow: 0 -1px 0 #eee inset;
  border-radius: var(--tab-wrap-border-radius) var(--tab-wrap-border-radius) 0 0;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: #333;
  flex-grow: 3;
  text-align: center;
  background-color: #f2f2f2;
  user-select: none;
  transition: 0.3s background-color ease, 0.3s box-shadow ease;
  height: 50px;
  box-sizing: border-box;
  padding: 15px;
}

.tab + label:hover {
  background-color: #f9f9f9;
  box-shadow: 0 1px 0 #f4f4f4 inset;
}

.tab:first-of-type:not(:last-of-type) + label {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.tab:not(:first-of-type):not(:last-of-type) + label {
  border-radius: 0;
}

.tab:last-of-type:not(:first-of-type) + label {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.tab__content {
  padding: 10px 25px;
  background-color: transparent;
  position: absolute;
  width: 100%;
  z-index: -1;
  opacity: 0;
  left: 0;
  transform: translateY(-3px);
  border-radius: var(--tab-wrap-border-radius);
}

.tab:checked ~ .tab__content {
  opacity: 1;
  transition: 0.5s opacity ease-in, 0.8s transform ease;
  position: relative;
  top: 0;
  z-index: 100;
  transform: translateY(0);
  text-shadow: 0 0 0;
}

/* Boring stuff */
body {
  font-family: "Helvetica", sans-serif;
  background-color: #e7e7e7;
  color: #777;
  padding: 30px 0;
  font-weight: 300;
}

.container {
  margin: 0 auto;
  display: block;
  max-width: 800px;
}

.container > *:not(.tab-wrap) {
  padding: 0 80px;
}

h1,
h2 {
  margin: 0;
  color: #444;
  text-align: center;
  font-weight: 400;
}

h2 {
  font-size: 1em;
  margin-bottom: 30px;
}

h3 {
  font-weight: 400;
}

p {
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Hide all tab content by default */
.tab__content {
  display: none;
}

/* Show the selected tab content when the corresponding radio button is checked */
.tab:checked + label + .tab__content {
  display: block;
}
