.expander {
  font-size: initial;

  .expander_checkbox {
    @extend %visuallyhidden;

    & + .expander_label {
      position: relative;
      padding: 0;
      color: color(brand, logoBlue);
      cursor: pointer;

      user-select: none;
    }

    &:checked {
      & ~ .expander_content {
        display: block;
        max-height: 2000px;
        opacity: 1;
        animation: expandIn 200ms ease-in-out;
      }
    }

    &:not(:checked) {
      & ~ .expander_content {
        display: none;
        max-height: 0;
        opacity: 0;
        animation: expandOut 200ms ease-in-out;
      }

      & + .expander_label {
        &::after {
          position: static;
          border: 0;
          background: 0;
          content: attr(data-collapsed-label);
        }
      }
    }

    &:checked + .expander_label {
      &::after {
        position: static;
        border: 0;
        background: 0;
        content: attr(data-expanded-label);
      }
    }
  }

  @keyframes expandIn {
    0% {
      display: none;
      max-height: 0;
      opacity: 0;
    }

    1% {
      display: block;
    }

    100% {
      max-height: 2000px;
      opacity: 1;
    }
  }

  @keyframes expandOut {
    0% {
      display: block;
      max-height: 2000px;
      opacity: 1;
    }

    99% {
      max-height: 0;
      opacity: 0;
    }

    100% {
      display: none;
    }
  }

  .expander_checkbox:checked + .chevron {
    transition: transform 200ms ease-in-out;
    transform: none;
  }
}
