/* (A) TABS CONTAINER */
.tab {
  position: relative;
  max-width: 600px;
}

/* (B) HIDE CHECKBOX */
.tab input { display: none; }

/* (C) TAB LABEL */
.tab label {
  display: block;
  margin-top: 10px;
  padding: 10px;
  color: #fff;
  font-weight: bold;
  background: #2d5faf;
  cursor: pointer;
}

/* (D) TAB CONTENT */
.tab .tab-content {
  background: #ccdef9;
  /* CSS ANIMATION WILL NOT WORK WITH AUTO HEIGHT */
  /* THIS IS WHY WE USE MAX-HEIGHT INSTEAD */
  overflow: hidden;
  transition: max-height 0.3s;
  max-height: 0;
}
.tab .tab-content p { padding: 10px; }

/* (E) OPEN TAB ON CHECKED */
.tab input:checked ~ .tab-content { max-height: 100vh; }

/* (F) EXTRA - ADD ARROW INDICATOR */
.tab label::after {
  content: "\25b6";
  position: absolute;
  right: 10px;
  top: 10px;
  display: block;
  transition: all 0.4s;
}
.tab input:checked ~ label::after { transform: rotate(90deg); }

/* (X) DOES NOT MATTER */
html, body { font-family: arial, sans-serif; }