/* ========================================
   포스트 게시판 페이지 스타일
   ======================================== */

/* 포스트 페이지 전체 */
.posts-page {
  background-color: var(--main-dark);
  min-height: 100vh;
  padding-top: 80px;
}

/* ========================================
   헤더 섹션
   ======================================== */
.posts-header {
  padding: 100px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, rgba(13, 110, 253, 0.05) 0%, transparent 100%);
}

.posts-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: rgba(13, 110, 253, 0.1);
  border: 1px solid var(--accent-blue);
  border-radius: 50px;
  color: var(--accent-blue);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease;
}

.posts-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  animation: fadeInUp 0.8s ease;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-blue), #667eea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.posts-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
  animation: fadeInUp 1s ease;
}

/* ========================================
   포스트 그리드 섹션
   ======================================== */
.posts-grid-section {
  padding: 60px 0 100px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 2.5rem;
  margin: 0 auto;
}

/* ========================================
   포스트 카드
   ======================================== */
.post-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  height: 550px; /* 고정 높이 설정 */
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }

.post-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.post-card-inner {
  position: relative;
  padding: 3rem 2.5rem;
  height: 100%; /* 부모 높이에 맞춤 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ========================================
   이미지 영역
   ======================================== */
.post-image {
  margin-bottom: 2rem;
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.post-card:hover .post-image {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.4);
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
  transform: scale(1.1);
}

/* ========================================
   콘텐츠 영역
   ======================================== */
.post-content {
  flex: 1;
}

.post-category {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.post-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1rem;
  line-height: 1.3;
  transition: color 0.3s ease;
  /* 제목 말줄임표 처리 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-card:hover .post-title {
  color: #000;
}

.post-description {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 1.5rem;
  /* 설명 말줄임표 처리 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   해시태그
   ======================================== */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.tag {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.8);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.tag:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

/* ========================================
   호버 오버레이
   ======================================== */
.post-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 24px;
  z-index: 10;
  pointer-events: none;
}

.post-card:hover .post-overlay {
  opacity: 1;
  pointer-events: auto;
}

.read-more-btn {
  padding: 1rem 2rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(20px);
}

.post-card:hover .read-more-btn {
  transform: translateY(0);
}

.read-more-btn:hover {
  background: hsl(203.94deg 90.61% 40%);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(13, 110, 253, 0.4);
}

.read-more-btn i {
  transition: transform 0.3s ease;
}

.read-more-btn:hover i {
  transform: translateX(5px);
}

/* ========================================
   CTA 섹션
   ======================================== */
.posts-cta {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
  text-align: center;
}

.posts-cta .cta-content h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 1rem;
}

.posts-cta .cta-content p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
}

/* ========================================
   반응형 - 태블릿
   ======================================== */
@media (max-width: 992px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
  }
  
  .post-card-inner {
    padding: 2.5rem 2rem;
    min-height: 400px;
  }
  
  .post-image {
    height: 180px;
  }
  
  .post-title {
    font-size: 1.5rem;
  }
}

/* ========================================
   반응형 - 모바일
   ======================================== */
@media (max-width: 768px) {
  .posts-header {
    padding: 80px 0 40px;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .post-card-inner {
    padding: 2rem 1.5rem;
    min-height: 380px;
  }
  
  .post-image {
    height: 160px;
  }
  
  .post-title {
    font-size: 1.4rem;
  }
  
  .post-description {
    font-size: 0.95rem;
  }
  
  .posts-cta {
    padding: 60px 0;
  }
}

/* ========================================
   애니메이션
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
