.accordion {
  display: grid;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-size: 1rem;

  > .accordion__header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-row: 1;
    height: 60px;
    padding: 1rem 1.25rem;
    transition: background-color 0.2s ease;
    background-color: rgba(207, 226, 255, 0);
    cursor: pointer;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;

    > .accordion__toggle {
      position: absolute;
      width: 100%;
      height: 100%;
      z-index: 10;
      cursor: pointer;
      opacity: 0;
    }

    > .accordion__arrow {
      content: var(--accordion-arrow);
      width: 1.25rem;
      height: 1.25rem;
      margin: 0;
      transition: transform 0.3s ease;
    }
  }

  > .accordion__body {
    display: grid;
    grid-template-rows: 0fr;
    grid-row: 2;
    opacity: 0;
    overflow: hidden;
    min-height: 0;
    transition: grid-template-rows 0.3s ease-out, opacity 0.2s ease-in;

    > .accordion__content {
      min-height: 0;

      > .image {
        margin: 1.25rem;
      }
    }
  }

  &:has(.accordion__toggle:checked) > .accordion__header {
    background-color: var(--accordion-opened-bg);

    > .accordion__title {
      color: var(--accordion-opened-color);
    }

    > .accordion__arrow {
      transform: rotateZ(-180deg);
    }
  }

  &:has(.accordion__toggle:checked) > .accordion__body {
    grid-template-rows: 1fr;
    opacity: 1;
  }
}
