[data-slot='accordion'] {
  width: 100%;
}

[data-slot='accordion-item'] {
  border-bottom: 1px solid var(--border);

  &:last-child {
    border-bottom: 0;
  }
  /* Animates opening and closing where the browser can animate to a height of auto. */
  interpolate-size: allow-keywords;
  &::details-content {
    height: 0;
    overflow: hidden;
    transition:
      height 200ms ease-out,
      content-visibility 200ms allow-discrete;
  }
  &[open]::details-content {
    height: auto;
  }
}

[data-slot='accordion-trigger'] {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  list-style: none;
  cursor: pointer;
  outline: none;

  &::-webkit-details-marker {
    display: none;
  }
  &:hover {
    text-decoration: underline;
  }
  &:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
  }
  & svg {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    translate: 0 0.125rem;
    color: var(--muted-foreground);
    transition: rotate 200ms;
  }
  [open] > & svg {
    rotate: 180deg;
  }
}

[data-slot='accordion-content'] {
  padding-bottom: 1rem;
  font-size: 0.875rem;
}
