/**
 * Home Projects Grid Layout
 * 프로젝트 카드 3:5 비율 (이미지 3:2 + 텍스트 3:3)
 */

.home-projects {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  grid-auto-rows: auto;
}

/* 프로젝트 카드 - 3:5 비율 유지 */
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: white;
  /* 카드 높이를 너비의 5/3배로 유지 (3:5 비율) */
  aspect-ratio: 3 / 5;
}

/* 이미지 영역 - 3:2 비율 */
.project-card-image {
  width: 100%;
  height: 60%; /* 전체 카드의 60% = 3/5 중 3/2 부분 */
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-image.placeholder {
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

.placeholder-text {
  color: #999;
  font-size: 14px;
}

/* 텍스트 영역 - 3:3 비율 */
.project-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.project-card-content h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #222;
  word-break: break-word;
}

.project-card-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.project-card-content p.no-description {
  color: #999;
  font-style: italic;
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
}

.empty-state p {
  font-size: 1.1rem;
  margin: 0;
}

/* 반응형 - 태블릿 */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .project-card-content {
    padding: 1rem;
  }

  .project-card-content h3 {
    font-size: 1rem;
  }

  .project-card-content p {
    font-size: 0.85rem;
    -webkit-line-clamp: 7;
  }
}

/* 반응형 - 모바일 */
@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .home-projects {
    padding: 1rem;
  }

  .project-card-inner {
    aspect-ratio: 16 / 20; /* 모바일에서는 약간 조정 */
  }

  .project-card-content h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }

  .project-card-content p {
    font-size: 0.8rem;
    -webkit-line-clamp: 7;
  }
}
