{{/*
    Docs: https://docs.hugoblox.com/reference/markdown/#toggle-lists

    Parameters
    ----------
    text :
        Spoiler title.
    class : optional
        Additional class for <details> tag.
    style : optional
        Additional style for <details> tag.
*/}}

{{- $title := .Get "text" | default "" -}}
{{- $id := printf "spoiler-%d" .Ordinal -}}

<details class="spoiler {{ .Get "class" }}" {{ with .Get "style" }}style="{{ . | safeCSS }}"{{ end }} id="{{$id}}">
  <summary class="cursor-pointer">{{ $title }}</summary>
  <div class="rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2">
    {{ .InnerDeindent | markdownify }}
  </div>
</details>