.infobox-title {
  padding: 4px;
  padding-left: 12px;
  border: solid 1px;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  margin-top: 1em;
}

.infobox-title > span::before {
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  text-decoration: inherit;
  margin-right: 0.5em;
  vertical-align: middle;
  line-height: 1em;
}

.infobox {
  font-size: 15px;
  border: solid 1px;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 12px;
  padding-top: 8px;
  margin-bottom: 1em;
}

.infobox ul {
  padding-left: 28px;
  margin: 0;
  margin-bottom: .5em;
}

.infobox p {
  margin-bottom: .5em;
}

.infobox p:first-child {
  font-style: italic;
}

.infobox pre {
  font-family: monospace;
  font-size: 13px;
  margin: 0;
  margin-bottom: .75em;
  line-height: 1.4em;
  background-color: hsla(0, 0%, 100%, 0.58);
  border-radius: 4px;
  padding: 3px;
  padding-left: 5px;
  white-space: pre-wrap;
}
.infobox li pre, .infobox p pre {
  display: inline;
  line-height: initial;
  margin: 0;
  padding: 2px;
}

/* Togglability styles */

input[type="checkbox"].toggle {
  /* Hide the actual checkbox */
  display: none;
}

.infobox-title.toggle {
  cursor: pointer;
  display: block;
  transition: border-radius 0.1s ease-out;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
  position: relative;
}

.infobox-title.toggle > span::after {
  /* The arrow indicated whether the infobox is toggled */
  content: '';

  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 11px solid currentColor;
  padding-top: 3px;

  position: absolute;
  right: 12px;
  top: 55%;
  transform: translateY(-50%);

  transition: transform .3s ease-out;
}

.infobox.toggle {
  overflow: hidden;
  transition: all .2s ease-in-out;
  transition-delay: .1s; /* wait for corners before expanding */
  max-height: 100vh;
}

input.toggle:checked + .infobox-title.toggle  {
  /* Round the bottom corners of the title box when infobox is hidden */
  border-radius: 8px;
  transition-delay: 0.3s; /* wait for content before rounding corners */
}

input.toggle:checked + .infobox-title.toggle > span::after {
  /* Rotate the arrow to the left when the infobox is hidden */
  transform: rotate(90deg) translate(-8px, 3px);
}

input.toggle:checked + .infobox-title.toggle + .infobox.toggle  {
  /* Hide the infobox's content when toggled */
  max-height: 0px;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  background-color: transparent;
}

/* Warning-specific attributes of an infobox */
.infobox-title.warning {
  background-color: hsl(var(--infobox-warning-hue), 80%, 60%);
  border-color: hsl(var(--infobox-warning-hue), 100%, 20%);
}

.infobox-title.warning > span::before {
  content: url('../icons/alert.svg');
}

.infobox.warning {
  background-color: hsl(var(--infobox-warning-hue), 60%, 85%);
  border-color: hsl(var(--infobox-warning-hue), 100%, 20%);
}

/* "How-it-works"-specific */
.infobox-title.howitworks {
  background-color: hsl(var(--infobox-howitworks-hue), 80%, 60%);
  border-color: hsl(var(--infobox-howitworks-hue), 100%, 20%);
}

.infobox-title.howitworks > span::before {
  content: url('../icons/question.svg');
}

.infobox.howitworks {
  background-color: hsl(var(--infobox-howitworks-hue), 60%, 85%);
  border-color: hsl(var(--infobox-howitworks-hue), 100%, 20%);
}
