// Copyright (C) 2019-2021 Estonian Information System Authority.
// See the file 'LICENSE' for copying permission.

.details
  display: block
  padding: 0
  color: inherit
  &::not(.has-no-hover):hover
    background-color: rgba(0,0,0,.05)
  & > summary
    position: relative
    list-style: none
    padding: 0 $gap * 2
    &:focus
      outline: none
    &:hover
      cursor: pointer
    &:before
      content: ""
      display: block
      position: absolute
      left: 0
      top: 50%
      transform: translateY(-50%)
      width: 0
      height: 0
      border-style: solid
      border-width: 3.5px 0 3.5px 7px
      border-color: transparent transparent transparent $black
      +dark-mode
        border-color: transparent transparent transparent $white
    &::-webkit-details-marker
      display: none
  &[open] > summary
    margin-bottom: $gap
    &:before
      border-width: 7px 3.5px 0 3.5px
      border-color: $black transparent transparent transparent
      +dark-mode
        border-color: $white transparent transparent transparent
