/* ========================================
   포스트 상세 페이지 스타일
   ======================================== */

/* 스크롤 진행 바 */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-blue), #667eea);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* ========================================
   히어로 섹션
   ======================================== */
.post-hero {
  position: relative;
  height: 70vh;
  min-height: 500px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 80px;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(14, 29, 52, 0.85) 0%, rgba(14, 29, 52, 0.7) 100%);
  z-index: 1;
}

.post-hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.post-category-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: rgba(13, 110, 253, 0.2);
  border: 2px 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;
}

.post-hero-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;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 1s ease;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.meta-item i {
  color: var(--accent-blue);
}

.post-tags-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  animation: fadeInUp 1.2s ease;
}

.tag-hero {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

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

/* ========================================
   콘텐츠 섹션
   ======================================== */
.post-content-section {
  padding: 80px 0;
  background-color: var(--main-dark);
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* 메인 콘텐츠 */
.post-main-content {
  max-width: 800px;
}

.content-body {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  line-height: 1.8;
}

.content-body h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-white);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--accent-blue);
}

.content-body h3 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-white);
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
}

.content-body h4 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-white);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content-body p {
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
}

.content-body ul,
.content-body ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.content-body li {
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
}

.content-body a {
  color: var(--accent-blue);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.content-body a:hover {
  color: #667eea;
}

.content-body code {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #f8f8f2;
}

.content-body pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.content-body blockquote {
  border-left: 4px solid var(--accent-blue);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}

.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
}

/* 소셜 공유 */
.social-share {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.social-share h4 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 1.5rem;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn.facebook {
  background: #1877f2;
  color: white;
}

.share-btn.twitter {
  background: #1da1f2;
  color: white;
}

.share-btn.linkedin {
  background: #0077b5;
  color: white;
}

.share-btn.link {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ========================================
   사이드바 (목차)
   ======================================== */
.post-sidebar {
  position: relative;
}

.sidebar-sticky {
  position: sticky;
  top: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.sidebar-sticky h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.table-of-contents {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.table-of-contents a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  padding-left: 1rem;
  border-left: 2px solid transparent;
  line-height: 1.6;
}

.table-of-contents a:hover {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  padding-left: 1.25rem;
}

.table-of-contents a.active {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  font-weight: 600;
}

.table-of-contents a.toc-h3 {
  padding-left: 2rem;
  font-size: 0.9rem;
}

.table-of-contents a.toc-h3:hover {
  padding-left: 2.25rem;
}

/* ========================================
   관련 포스트 섹션
   ======================================== */
.related-posts-section {
  padding: 80px 0;
  background: linear-gradient(180deg, var(--main-dark) 0%, rgba(13, 110, 253, 0.05) 100%);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-white);
  text-align: center;
  margin-bottom: 3rem;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.related-post-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.related-post-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--accent-blue);
}

.related-post-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

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

.related-post-content {
  padding: 1.5rem;
}

.related-post-category {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: rgba(13, 110, 253, 0.2);
  border-radius: 15px;
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.related-post-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.related-post-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-meta {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.related-post-meta i {
  color: var(--accent-blue);
  margin-right: 0.5rem;
}

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

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

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

/* ========================================
   반응형 - 태블릿
   ======================================== */
@media (max-width: 992px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .post-sidebar {
    display: none;
  }

  .post-hero {
    height: 60vh;
    min-height: 400px;
  }

  .content-body h2 {
    font-size: 2rem;
  }

  .content-body h3 {
    font-size: 1.75rem;
  }
}

/* ========================================
   반응형 - 모바일
   ======================================== */
@media (max-width: 768px) {
  .post-hero {
    height: 50vh;
    min-height: 350px;
  }

  .post-hero-title {
    font-size: 2rem;
  }

  .post-meta {
    gap: 1rem;
  }

  .meta-item {
    font-size: 0.9rem;
  }

  .post-content-section {
    padding: 60px 0;
  }

  .content-body {
    font-size: 1rem;
  }

  .content-body h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
  }

  .content-body h3 {
    font-size: 1.5rem;
    margin-top: 1.75rem;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  .related-posts-section,
  .post-cta-section {
    padding: 60px 0;
  }
}

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