/* =========================
   Folder Card
   Figma: Card - Folder / Card - Folder Option.
   Vertical/horizontal folder card with icon, title, options menu and summary.
========================= */

@use "../kit-deps" as *;

.folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 280px;
  padding: $space-5;
  border: $border-width-base $border-style-base $neutral-200;
  border-radius: $radius-xl;
  background-color: $neutral-0;
  color: $neutral-900;
  text-align: center;
  cursor: pointer;
  transition:
    border-color $motion-base $motion-ease,
    background-color $motion-base $motion-ease;

  &:hover:not(.is-selected) {
    border-color: $neutral-300;
    background-color: $neutral-50;
  }

  &:focus-visible {
    @include focus_ring;
    outline-offset: 2px;
  }

  &.is-selected {
    border-color: $mint-500;
    background-color: $mint-50;
  }

  &--horizontal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: $space-4;
    max-width: 480px;
    text-align: left;

    .folder-card__main {
      flex-direction: row;
      align-items: center;
    }

    .folder-card__icon {
      width: 52px;
      height: 52px;

      .vmk-icon,
      .ph {
        width: 48px;
        height: 48px;
        font-size: 48px;
      }

      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
    }

    .folder-card__summary {
      display: none;
    }
  }

  &__menu {
    position: absolute;
    top: $space-4;
    right: $space-4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: $radius-full;
    background-color: transparent;
    color: $neutral-500;
    font-size: 20px;
    cursor: pointer;
    transition: background-color $motion-base $motion-ease;

    &:hover {
      background-color: $neutral-100;
      color: $neutral-900;
    }

    &:focus-visible {
      @include focus_ring;
    }
  }

  &__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: $space-4;
    margin-bottom: $space-5;
  }

  &__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    color: $lavender-500;

    .vmk-icon,
    .ph {
      width: 80px;
      height: 80px;
      font-size: 80px;
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }

  &__title {
    margin: -0.2em 0;
    padding: 0;
    font-size: $font-size-lg;
    font-weight: $font-weight-bold;
    line-height: 1;
    color: $neutral-900;
  }

  &__summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: $space-4;
    padding: $space-4;
    border: $border-width-base $border-style-base $neutral-100;
    border-radius: $radius-lg;
    background-color: $neutral-50;
  }

  &__summary-item {
    display: flex;
    flex-direction: column;
    gap: $space-1;

    &--full {
      grid-column: 1 / -1;
    }
  }

  &__summary-label {
    color: $neutral-500;
    font-size: $font-size-sm;
    font-weight: $font-weight-medium;
  }

  &__summary-value {
    color: $neutral-900;
    font-size: $font-size-md;
    font-weight: $font-weight-semibold;
  }
}
