/* SafeSkin 2025 v3.0 - Modern Professional Design */

/* ===== CSS Variables (Design Tokens) ===== */
:root {
  /* Primary Colors - Trustworthy Teal */
  --color-primary-50: #E0F2F1;
  --color-primary-100: #B2DFDB;
  --color-primary-200: #80CBC4;
  --color-primary-300: #4DB6AC;
  --color-primary-400: #26A69A;
  --color-primary-500: #009688;
  --color-primary-600: #00897B;
  --color-primary-700: #00796B;
  --color-primary-800: #00695C;
  --color-primary-900: #004D40;

  /* Accent Colors - Warm Coral */
  --color-accent-50: #FFF3E0;
  --color-accent-100: #FFE0B2;
  --color-accent-200: #FFCC80;
  --color-accent-300: #FFB74D;
  --color-accent-400: #FFA726;
  --color-accent-500: #FF9800;
  --color-accent-600: #FB8C00;
  --color-accent-700: #F57C00;
  --color-accent-800: #EF6C00;
  --color-accent-900: #E65100;

  /* Neutral Grayscale */
  --color-white: #FFFFFF;
  --color-gray-50: #FAFAFA;
  --color-gray-100: #F5F5F5;
  --color-gray-200: #EEEEEE;
  --color-gray-300: #E0E0E0;
  --color-gray-400: #BDBDBD;
  --color-gray-500: #9E9E9E;
  --color-gray-600: #757575;
  --color-gray-700: #616161;
  --color-gray-800: #424242;
  --color-gray-900: #212121;

  /* Typography */
  --font-primary: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;

  /* Type Scale (1.250 Major Third) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.563rem;    /* 25px */
  --text-3xl: 1.953rem;    /* 31px */
  --text-4xl: 2.441rem;    /* 39px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.65;

  /* Spacing (8px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px - base unit */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */

  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-full: 9999px;

  /* Transitions */
  --duration-100: 100ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* ===== CSS Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== 기본 스타일 ===== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-normal);
  line-height: var(--leading-loose);
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
}

a {
  color: var(--color-primary-600);
  text-decoration: none;
  transition: color var(--duration-200) var(--ease-out);
}

a:hover {
  color: var(--color-primary-700);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Layout ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.content-wrapper {
  display: flex;
  gap: var(--space-10);
  margin-top: var(--space-8);
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* ===== Header ===== */
.header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  padding: var(--space-6) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.blog-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-3);
  display: block !important;
  visibility: visible !important;
}

.blog-title a {
  color: var(--color-gray-900);
  transition: color var(--duration-200) var(--ease-out);
  display: inline-block !important;
}

.blog-title a:hover {
  color: var(--color-primary-600);
}

.blog-menu a {
  margin-right: var(--space-6);
  color: var(--color-gray-600);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: color var(--duration-200) var(--ease-out);
}

.blog-menu a:hover {
  color: var(--color-primary-600);
}

/* ===== Article List (홈/카테고리) ===== */
.article-item {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-300) var(--ease-out),
              transform var(--duration-300) var(--ease-out);
}

.article-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-item:last-child {
  margin-bottom: 0;
}

.article-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
}

.article-title a {
  color: var(--color-gray-900);
  transition: color var(--duration-200) var(--ease-out);
}

.article-title a:hover {
  color: var(--color-primary-600);
}

.article-meta {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  margin-bottom: var(--space-4);
}

.article-meta span {
  margin-right: var(--space-4);
}

.article-summary {
  color: var(--color-gray-700);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-content-wrapper {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.article-text {
  flex: 1;
  min-width: 0;
}

.article-thumbnail {
  width: 200px;
  flex-shrink: 0;
  align-self: stretch;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.article-thumbnail a {
  display: block;
  height: 100%;
}

.article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-300) var(--ease-smooth);
}

.article-thumbnail:hover img {
  transform: scale(1.05);
}

/* ===== Article Detail (글 상세) ===== */
.article-detail {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.article-header {
  margin-bottom: var(--space-8);
}

.article-detail .article-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
  color: var(--color-gray-900);
}

.article-content {
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--color-gray-900);
}

.article-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  margin: var(--space-10) 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--color-primary-50);
  border-left: 4px solid var(--color-primary-500);
  border-radius: var(--radius-md);
  color: var(--color-primary-800);
}

.article-content h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: var(--space-8) 0 var(--space-4);
  color: var(--color-gray-900);
}

.article-content p {
  margin-bottom: var(--space-5);
}

.article-content ul, .article-content ol {
  margin: var(--space-5) 0;
  padding-left: var(--space-8);
}

.article-content li {
  margin-bottom: var(--space-3);
}

.article-content img {
  margin: var(--space-5) 0;
  border-radius: var(--radius-md);
}

.article-content blockquote {
  margin: var(--space-5) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--color-gray-50);
  border-left: 4px solid var(--color-primary-500);
  color: var(--color-gray-700);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content code {
  background: var(--color-gray-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-primary-700);
}

.article-content pre {
  background: var(--color-gray-900);
  color: var(--color-gray-50);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-5) 0;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: var(--color-gray-50);
}

/* ===== Article Footer ===== */
.article-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-gray-200);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary-50);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-primary-700);
  transition: all var(--duration-200) var(--ease-out);
}

.tag:hover {
  background: var(--color-primary-500);
  color: var(--color-white);
}

/* ===== 광고 ===== */
.ad-container {
  margin: 2px 0;
  text-align: center !important;
  min-height: 0;
  min-width: 300px; /* 최소 너비 보장 */
  width: 100%; /* 전체 너비 확보 */
  overflow: hidden;
  transition: all 0.3s ease;
  padding: 0;
  display: block !important;
}

.ad-container .adsbygoogle {
  margin: 0 auto !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* 광고가 비어있거나 로드 실패 시 컨테이너 자체를 숨김 */
.ad-container:empty {
  display: none !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
}

.ad-container .adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

.ad-container:has(.adsbygoogle[data-ad-status="unfilled"]) {
  display: none !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
}

/* 광고가 숨겨진 경우 강제 제거 */
.ad-container[style*="display: none"] {
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  border: none !important;
}

/* 광고가 아직 로드 중일 때만 최소 높이 적용 */
.ad-container:has(.adsbygoogle:not([data-ad-status])) {
  min-height: 100px;
}

/* TOC 광고 특별 처리 - 광고 없을 때 완전히 숨김 */
.toc-ad:empty,
.toc-ad:has(.adsbygoogle[data-ad-status="unfilled"]),
.toc-ad[style*="display: none"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: 0 !important;
}

.ad-placeholder {
  margin: var(--space-5) 0;
}

.index-ad-container {
  margin: var(--space-10) 0;
  text-align: center;
  min-height: 0;
  padding: var(--space-6) 0;
  overflow: hidden;
}

.index-ad-container:empty {
  display: none;
  margin: 0;
  padding: 0;
}

.index-ad-container:has(.adsbygoogle:not([data-ad-status])) {
  min-height: 250px;
}

.sidebar-ad {
  text-align: center;
  min-height: 0;
  overflow: hidden;
}

.sidebar-ad:empty {
  display: none;
}

.sidebar-ad:has(.adsbygoogle:not([data-ad-status])) {
  min-height: 250px;
}

/* ===== 댓글 ===== */
.comment-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 2px solid var(--color-gray-200);
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky;
  top: calc(100px + var(--space-6));
  align-self: flex-start;
}

.widget {
  margin-bottom: var(--space-8);
  padding: var(--space-6);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary-500);
  color: var(--color-gray-900);
}

/* ===== 목차 (TOC) ===== */
.toc-widget {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-item {
  margin-bottom: var(--space-2);
}

.toc-h3 {
  margin-left: var(--space-4);
  font-size: var(--text-sm);
}

.toc-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--color-gray-700);
  border-radius: var(--radius-sm);
  transition: all var(--duration-200) var(--ease-out);
  font-size: var(--text-sm);
}

.toc-link:hover {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.toc-link.active {
  background: var(--color-primary-500);
  color: var(--color-white);
  font-weight: var(--font-medium);
}

/* ===== 최근 글 ===== */
.recent-list {
  list-style: none;
  padding: 0;
}

.recent-list li {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-gray-200);
}

.recent-list li:last-child {
  border-bottom: none;
}

.recent-list a {
  color: var(--color-gray-700);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  transition: color var(--duration-200) var(--ease-out);
}

.recent-list a:hover {
  color: var(--color-primary-600);
}

/* ===== 태그 클라우드 ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag-item {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-gray-700);
  transition: all var(--duration-200) var(--ease-out);
}

.tag-item:hover {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
  color: var(--color-white);
}

/* 태그 빈도별 크기 (티스토리 자동 생성 클래스) */
.tag-item.cloud1 { font-size: var(--text-xs); opacity: 0.6; }
.tag-item.cloud2 { font-size: var(--text-xs); opacity: 0.7; }
.tag-item.cloud3 { font-size: var(--text-sm); opacity: 0.8; }
.tag-item.cloud4 { font-size: var(--text-sm); opacity: 0.9; }
.tag-item.cloud5 {
  font-size: var(--text-sm);
  opacity: 1.0;
  font-weight: var(--font-medium);
}

/* ===== Footer ===== */
.footer {
  margin-top: var(--space-8);
  padding: var(--space-6) 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-gray-200);
  text-align: center;
  color: var(--color-gray-600);
  font-size: var(--text-sm);
}

/* 댓글 섹션 하단 여백 축소 */
.comment-section {
  margin-bottom: 0 !important;
  padding-bottom: var(--space-6) !important;
}

/* ===== 반응형 (모바일) ===== */
@media (max-width: 767px) {
  /* 컨테이너 패딩 축소 */
  .container {
    padding: 0 5px;
  }

  /* 레이아웃 세로 정렬 */
  .content-wrapper {
    flex-direction: column;
    gap: var(--space-6);
  }

  /* 사이드바 */
  .sidebar {
    width: 100%;
    position: static;
    order: 2; /* 메인 콘텐츠 다음에 표시 */
  }

  /* 헤더 */
  .header {
    padding: var(--space-4) 0;
  }

  .blog-title {
    font-size: var(--text-xl);
  }

  .blog-menu {
    margin-top: var(--space-2);
  }

  .blog-menu a {
    display: inline-block;
    margin-right: var(--space-4);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
  }

  /* 글 상세 패딩 */
  .article-detail {
    padding: var(--space-3);  /* 12px */
  }

  /* 글 제목 */
  .article-detail .article-title {
    font-size: var(--text-2xl);
    line-height: var(--leading-tight);
  }

  .article-item .article-title {
    font-size: var(--text-lg);
  }

  /* 본문 */
  .article-content {
    font-size: var(--text-base);
    line-height: 1.6;
  }

  .article-content h2 {
    font-size: var(--text-xl);
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
  }

  .article-content h3 {
    font-size: var(--text-lg);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
  }

  .article-content p {
    margin-bottom: var(--space-4);
    line-height: 1.6;
  }

  /* 본문 상단 목차 - 모바일 */
  .article-toc {
    padding: var(--space-4);
    margin-bottom: var(--space-6);
  }

  .article-toc .toc-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
  }

  .article-toc .toc-link {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: break-word;
    gap: var(--space-1);
  }

  .article-toc .toc-link::before {
    font-size: var(--text-base);
  }

  .article-toc .toc-h3 .toc-link::before {
    font-size: var(--text-sm);
  }

  /* 글 목록 */
  .article-item {
    padding: var(--space-4);
  }

  .article-content-wrapper {
    flex-direction: column-reverse; /* 썸네일을 위로 */
  }

  .article-thumbnail {
    width: 100%;
    height: 180px;
    margin-bottom: var(--space-3);
  }

  .article-text {
    width: 100%;
  }

  /* 메타 정보 */
  .article-meta {
    font-size: var(--text-xs);
    flex-wrap: wrap;
  }

  .article-meta span {
    margin-right: var(--space-3);
  }

  /* 위젯 */
  .widget {
    padding: var(--space-4);
  }

  .widget-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
  }

  /* 목차 */
  .toc-widget {
    font-size: var(--text-sm);
  }

  .toc-list {
    max-height: none;
  }

  /* 광고 */
  .ad-container,
  .sidebar-ad {
    margin: var(--space-2) 0;
    padding: 0;
  }

  /* 광고 요소 자체의 여백 제거 */
  .ad-container .adsbygoogle,
  .sidebar-ad .adsbygoogle {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 태그 */
  .tag-list {
    gap: var(--space-2);
  }

  .tag-item {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
  }

  /* 댓글 */
  .comment-section {
    padding: var(--space-4);
  }

  /* 푸터 */
  .footer {
    padding: var(--space-6) 0;
    font-size: var(--text-sm);
  }

  /* 이미지 */
  .article-content img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
  }

  /* 테이블 오버플로우 */
  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* 코드 블록 */
  .article-content pre {
    overflow-x: auto;
    font-size: var(--text-sm);
  }
}

/* ===== 인쇄 ===== */
@media print {
  .header, .sidebar, .footer, .comment-section, .ad-container {
    display: none !important;
  }

  .main-content {
    width: 100%;
  }
}

/* ===== 관련글 카드 ===== */
.related-post-card {
  margin: 2rem 0;
  border: 1px solid var(--color-gray-300);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  min-height: 0; /* 기본 최소 높이를 0으로 설정 */
}

/* 카드가 비어있을 때 숨김 */
.related-post-card:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

.related-post-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.related-post-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  min-height: 0;
}

.related-post-thumbnail {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 이미지 로딩 실패 시 숨김 */
.related-post-thumbnail img[src=""],
.related-post-thumbnail img:not([src]) {
  display: none;
}

.related-post-placeholder {
  font-size: 3rem;
  color: var(--color-gray-400);
}

.related-post-text {
  flex: 1;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.related-post-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 제목이 비어있을 때 숨김 */
.related-post-title:empty {
  display: none;
  margin: 0;
}

.related-post-desc {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 설명이 비어있을 때 숨김 */
.related-post-desc:empty {
  display: none;
  margin: 0;
}

.related-post-url {
  font-size: var(--text-xs);
  color: var(--color-primary-600);
  font-weight: 500;
}

/* URL이 비어있을 때 숨김 */
.related-post-url:empty {
  display: none;
}

@media (max-width: 768px) {
  .related-post-link {
    flex-direction: column;
  }

  .related-post-thumbnail {
    width: 100%;
    height: 180px;
  }

  .related-post-text {
    padding: 1rem;
  }
}

/* ========================================
   본문 상단 목차 스타일
   ======================================== */
.article-toc {
  background: var(--color-primary-50);
  border-left: 4px solid var(--color-primary-500);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: 15px;
}

.article-toc .toc-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-primary-700);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary-300);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-toc .toc-toggle-icon {
  font-size: var(--text-2xl);
  transition: transform 0.3s ease;
  color: var(--color-primary-600);
}

.article-toc.collapsed .toc-toggle-icon {
  transform: rotate(-90deg);
}

.article-toc .toc-container {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.article-toc.collapsed .toc-container {
  max-height: 0 !important;
  opacity: 0;
  margin-top: 0;
}

.article-toc .toc-container {
  margin: 0;
}

.article-toc .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-toc .toc-item {
  margin-bottom: var(--space-2);
}

.article-toc .toc-h3 {
  margin-left: var(--space-4);
  font-size: var(--text-sm);
}

.article-toc .toc-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--color-gray-700);
  border-radius: var(--radius-sm);
  transition: all var(--duration-200) var(--ease-out);
  font-size: var(--text-base);
  text-decoration: none;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.article-toc .toc-link::before {
  content: "•";
  color: var(--color-primary-600);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  flex-shrink: 0;
}

.article-toc .toc-h3 .toc-link::before {
  content: "◦";
  font-size: var(--text-base);
}

.article-toc .toc-link:hover {
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  transform: translateX(4px);
}

.article-toc .toc-link.active {
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  font-weight: var(--font-medium);
}

/* ========================================
   CTA Button Styling
   ======================================== */
.cta-button-wrapper {
  text-align: center;
  margin-top: 25px;
  margin-bottom: 25px;
  user-select: none;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 700px;
  padding: 12px 20px;
  font-weight: bold;
  font-size: var(--text-lg);
  color: #000000;
  background: linear-gradient(135deg, rgb(255, 215, 0) 0%, rgb(255, 200, 50) 100%);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: all 0.3s ease;
  animation: blink 2s ease-in-out infinite;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4), 0 3px 6px rgba(0, 0, 0, 0.15);
  animation: none;
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

@media (max-width: 768px) {
  .cta-button {
    width: 95%;
    font-size: var(--text-base);
    padding: 10px 16px;
  }
}
