.library-resource-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  padding: 1rem;
}

.library-resource-card {
  flex: 1 1 calc(50% - 40px);
  max-width: 640px;
  position: relative;
  border-radius: 30px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.library-resource-image {
  width: 100%;
  height: auto;
  position: relative;
  border-radius: 30px;
  overflow: hidden;
}

.library-resource-image__img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 30px;
}

.library-resource-content {
  width: 540px;
  min-height: 259px;
  max-height: 259px;
  background: rgba(255, 255, 255, 0.9);
  padding: 30px;
  border-radius: 30px;
  position: relative;
  top: -120px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.library-resource-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: #333;
}

.library-resource-content p {
  margin: 0;
  font-size: 16px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.btn-yellow {
  background-color: #FFC107;
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: bold;
  width: fit-content;
  border: none;
  font-size: 16px;
  margin-top: auto; 
}

@media (max-width: 768px) {
  .library-resource-grid {
    flex-direction: column;
    gap: 40px;
  }

  .library-resource-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .library-resource-content {
    width: 100%;
    padding: 20px;
    top: -60px;
  }

  .library-resource-image {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  
  .library-resource-image__img {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .library-resource-grid {
  padding: 0rem;
}
}
