.unit {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: calc($unit / 2);
  // min-height: 320px;
  // max-width: 200px;
  position: relative;
  margin-bottom: $unit * 4;

  &.editable .image:hover {
    border: $hover-stroke;
    box-shadow: $hover-shadow;
    cursor: pointer;
    transform: $scale-tall;
  }

  &.filled h3 {
    display: block;
  }

  &.filled ul {
    display: flex;
  }

  .Button {
    pointer-events: none;
    opacity: 0;
  }

  &:hover .Button,
  .Button.Clicked {
    pointer-events: initial;
    opacity: 1;
  }

  h3,
  ul {
    display: none;
  }

  h3 {
    color: var(--text-primary);
    font-size: $font-regular;
    font-weight: $normal;
    line-height: 1.1;
    margin: 0;
    max-width: 131px;
    text-align: center;
    word-wrap: normal;

    @include breakpoint(phone) {
      font-size: $font-small;
    }
  }

  img {
    position: relative;
    width: 100%;
    z-index: 2;
  }

  .image {
    aspect-ratio: 131 / 273;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0);
    border-radius: $unit;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: $duration-zoom all ease-in-out;
    height: auto;
    width: 100%;
    -webkit-user-select: none; /* Safari */
    user-select: none;

    &:hover .icon svg {
      fill: var(--icon-secondary-hover);
    }

    .icon {
      position: absolute;
      height: $unit * 3;
      width: $unit * 3;
      z-index: 1;

      svg {
        transition: $duration-color-fade fill ease-in-out;
        fill: var(--icon-secondary);
      }
    }
  }

  .name {
    @include breakpoint(phone) {
      font-size: $font-tiny;
    }
  }

  &:hover .perpetuity.empty {
    opacity: 1;
  }

  .perpetuity {
    position: absolute;
    background-image: url('/icons/perpetuity/filled.svg');
    background-size: $unit-4x $unit-4x;
    z-index: 20;
    top: $unit * -1;
    right: $unit-3x;
    width: $unit-4x;
    height: $unit-4x;
    transition: $duration-zoom opacity ease-in-out;

    &:hover {
      background-image: url('/icons/perpetuity/empty.svg');
      cursor: pointer;
    }

    &.empty {
      background-image: url('/icons/perpetuity/empty.svg');
      opacity: 0;

      &:hover {
        background-image: url('/icons/perpetuity/filled.svg');
      }
    }
  }
}
