.accordion {
  width: 20rem;
  border: 2px solid hsl(0, 0%, 52%);
  border-radius: 8px;
}

.accordion > * + * {
  border-top: 1px solid hsl(0, 0%, 52%);
}

.accordion h2 {
  margin: 0;
}

.accordion button {
  background: none;
  outline: none;
  border-style: none;
  text-align: left;
  cursor: pointer;
  border-style: none;
}

.accordion button::-moz-focus-inner {
  border: 0;
}

.accordion fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.accordion input {
  display: block;
  padding: 0.3em 0.5em;
  font-size: inherit;
  border: 1px solid hsl(0, 0%, 42%);
  border-radius: 0.3em;
  margin-top: 0.5rem;
}

.accordion [hidden] {
  display: none;
}

.accordion-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  color: hsl(0, 0%, 13%);
  font-size: 1rem;
}

.accordion h2:first-of-type,
.accordion h2:first-of-type .accordion-trigger {
  border-radius: 8px 8px 0 0;
}

.accordion h2:last-of-type,
.accordion h2:last-of-type .accordion-trigger {
  border-radius: 0 0 8px 8px;
}

.accordion-trigger:focus,
.accordion-trigger:hover {
  background: hsl(216, 94%, 94%);
}

.accordion-trigger:focus {
  outline: 4px solid transparent;
}

.accordion-title {
  display: block;
  pointer-events: none;
  border: transparent 2px solid;
  border-radius: 5px;
  padding: 0.25em;
  outline: none;
}

.accordion-trigger:focus .accordion-title {
  border-color: hsl(216, 94%, 43%);
}

.accordion-icon {
  position: absolute;
  height: 0.5rem;
  width: 0.5rem;
  top: 50%;
  right: 2em;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  transition: all 0.3s;
  pointer-events: none;
}

.accordion-trigger:focus .accordion-icon,
.accordion-trigger:hover .accordion-icon {
  border-color: hsl(216, 94%, 43%);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: translateY(-30%) rotate(-135deg);
}

.accordion-panel {
  margin: 0;
  padding: 1em 1.5em;
}
