:root {
  interpolate-size: allow-keywords;
}

details {
  margin-block-end: 0.5rem;
  padding: 0.75rem 1rem;
  font: 0.875rem system-ui, sans-serif;
  background-color: whitesmoke;
  border-radius: 0.5rem;
}

summary {
  font-weight: bold;
  cursor: pointer;
}

details p {
  margin: 0.5rem 0 0;
}

details::details-content {
  block-size: 0;
  overflow: clip;
  transition:
    block-size 0.3s,
    content-visibility 0.3s allow-discrete;
}

details[open]::details-content {
  block-size: auto;
}