
.resource-link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 212px;
  min-width: 212px;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;

  &:hover {
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
  }
}

div.resource {
  width: 212px;
  min-width: 212px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);

  .image-container {
    position: relative;
    width: 212px;
    height: 132px;
    flex-shrink: 0;

    > img {
      width: 212px;
      height: 132px;
      object-fit: cover;
      border-radius: var(--border-radius-lg);
      display: block;
    }

    .file-type {
      width: 212px;
      height: 132px;
      background-color: var(--color-bg-primary);
      border-radius: var(--border-radius-lg);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: var(--fs-h1);
      font-weight: var(--font-medium);
      color: var(--color-gray-light);
      border: 1px solid var(--color-border-dark);
      box-sizing: border-box;
    }

    .overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      transition: opacity 0.5s ease;
      border-radius: var(--border-radius-lg);
      display: flex;
      align-items: flex-start;
      justify-content: flex-end;
      padding: var(--space-12);

      > img {
        width: 35px;
        height: 35px;
        background: var(--color-white);
        border-radius: var(--border-radius-lg);
        padding: 7.5px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(-10px);
        transition: transform 0.5s ease;
      }
    }
  }

  &:hover {
    .overlay {
      opacity: 1;

      > img {
        transform: translateY(0);
      }
    }
  }

  .content-container {
    width: 212px;
    height: 86px;
    padding: 0;
    margin: var(--space-12) 0 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    flex-shrink: 0;

    > p {
      font-size: var(--fs-tiny);
      line-height: 18px;
      font-weight: 300;
      color: var(--color-gray-light);
      margin: 0;
      padding: 0;
      height: 18px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      flex-shrink: 0;
    }

    > h3 {
      font-size: var(--fs-h2);
      line-height: 32px;
      font-weight: var(--font-medium);
      color: var(--color-black);
      margin: 0;
      padding: 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      height: 64px;
      flex-shrink: 0;
    }
  }
}

@media (max-width: 768px) {
  .resource-link {
    width: 212px;
    min-width: 212px;
  }

  div.resource {
    width: 212px;

    .image-container {
      width: 212px;
      height: 132px;

      > img,
      .file-type {
        width: 212px;
        height: 132px;
      }
    }
  }
}

@media (max-width: 480px) {
  .resource-link {
    width: min(212px, calc(100vw - 32px));
    min-width: min(212px, calc(100vw - 32px));
  }

  div.resource {
    width: min(212px, calc(100vw - 32px));

    .image-container {
      width: min(212px, calc(100vw - 32px));
      height: auto;
      aspect-ratio: 212/132;

      > img,
      .file-type {
        width: min(212px, calc(100vw - 32px));
        height: auto;
        aspect-ratio: 212/132;
      }
    }

    .content-container {
      width: min(212px, calc(100vw - 32px));
    }
  }
}
