/* === Variables === */
:root {
  --accent: #4A7CB5;
  --accent-light: #EEF3FA;
  --accent-dark: #2B5A8C;
  --text: #1a1a1a;
  --text-muted: #888;
  --text-soft: #555;
  --border: #e5e5e5;
  --bg: #fff;
  --max-w: 680px;
}

/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui,
    sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* === Layout === */
.site-header {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  z-index: 100;
}
.site-header .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.site-logo a {
  color: var(--text);
  text-decoration: none;
}
.logo-icon {
  font-size: 1.1rem;
}
.site-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.site-nav a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.6rem 1.25rem 2rem;
}
main.single-post {
  padding: 2.5rem 1.25rem 2rem;
}

/* === Post Header === */
.post-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.post-title {
  font-size: 1.6rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.post-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.post-meta .cat-link {
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

/* === Featured Image === */
.featured-image {
  margin-bottom: 1.75rem;
}
.featured-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

/* === TOC === */
.toc {
  background: var(--accent-light);
  border: 1px solid #c8d4e8;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 2.4rem;
}
.toc summary {
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--accent-dark);
  list-style: none;
}
.toc summary::-webkit-details-marker {
  display: none;
}
.toc summary::before {
  content: "📋 ";
}
.toc-list {
  margin-top: 0.6rem;
}
.toc-list a {
  display: block;
  padding: 0.2rem 0;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.94rem;
  border-bottom: 1px solid #dce4f0;
  transition: color 0.15s;
}
.toc-list a:last-child {
  border-bottom: none;
}
.toc-list a:hover {
  color: var(--accent);
}

/* === Post Content Typography === */
.post-content h2 {
  font-size: 1.5rem;
  margin: 3.5rem 0 1.4rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--accent);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.post-content h3 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.6rem;
  font-weight: 600;
  color: #333;
}
.post-content p {
  margin-bottom: 1.2rem;
}
.post-content figure,
.post-intro figure {
  margin: 1.8rem 0 1.25rem;
}
.post-content img,
.post-intro img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin: 0;
  display: block;
}
.post-content figcaption,
.post-intro figcaption {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 0.4rem;
}
.post-content a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-content ul,
.post-content ol {
  margin: 0.75rem 0 1.5rem 2rem;
}
.post-content li {
  margin-bottom: 0.2rem;
}
.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.85rem 1.1rem;
  margin: 1.5rem 0;
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  color: var(--text-soft);
  font-style: italic;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.85rem;
  text-align: left;
}
.post-content th {
  background: var(--accent-light);
  font-weight: 600;
  color: var(--accent-dark);
}
.post-content tr:nth-child(even) td {
  background: #fafafa;
}

/* === FAQ 박스 === */
.faq-section {
  background: var(--accent-light);
  border: 1px solid #c8d4e8;
  border-radius: 10px;
  padding: 0.5rem 1.4rem 0.5rem 1.4rem;
  margin: 0;
}
.faq-item {
  border-bottom: 1px solid #dce4f0;
  padding: 1.2rem 0;
}
.faq-item:first-child {
  padding-top: 0.8rem;
}
.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0.8rem;
}
.faq-q {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}
.faq-q::before {
  content: "Q. ";
  color: var(--accent);
  font-weight: 700;
}
.faq-a {
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.8;
  padding-left: 1.6rem;
}

/* === Ad Units === */
.ad-unit {
  margin: 1.75rem 0;
  text-align: center;
  min-height: 90px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

/* === Post Footer === */
.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.post-tags {
  margin-bottom: 1.5rem;
}
.tag {
  display: inline-block;
  background: #eef2f7;
  color: var(--accent-dark);
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  margin: 0.2rem 0.15rem;
  font-weight: 500;
}
.tag a {
  text-decoration: none;
  color: var(--text-soft);
}

/* === Related Posts === */
.related-posts h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  border-left: none;
  padding-left: 0;
  color: var(--text);
}
.related-posts a {
  display: block;
  padding: 0.5rem 0;
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  transition: color 0.15s;
}
.related-posts a:last-child {
  border-bottom: none;
}
.related-posts a:hover {
  color: var(--accent);
}

/* === Post Card === */
.post-card {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 1rem;
  align-items: start;
}
.post-card.no-thumb {
  grid-template-columns: 1fr;
}
.post-card:last-child {
  border-bottom: none;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.card-thumb-link {
  display: block;
  flex-shrink: 0;
}
.post-card-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.post-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-card h2 a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s;
}
.post-card h2 a:hover {
  color: var(--accent);
}
.post-card .excerpt {
  color: var(--text-soft);
  font-size: 0.85rem;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.post-card .card-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.post-card .card-cat {
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.1rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

/* === Post Intro === */
.post-intro {
  margin-bottom: 1.75rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-soft);
}
.post-intro p {
  margin-bottom: 1rem;
}

/* === Pagination === */
.pagination {
  margin-top: 2.5rem;
  text-align: center;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  margin: 0.15rem;
  border-radius: 6px;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pagination a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.4rem;
}
.site-footer a:hover {
  color: var(--accent);
}

/* === Hamburger === */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Responsive === */
@media (max-width: 640px) {
  .post-title {
    font-size: 1.4rem;
    line-height: 1.5;
  }
  .post-content h2 {
    font-size: 1.2rem;
  }
  .post-content h3 {
    font-size: 1.1rem;
  }
  main {
    padding: 0.4rem 1rem;
  }
  main.single-post {
    padding: 1.8rem 1rem;
  }
  .site-header .inner {
    padding: 0 1rem;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
    width: 30px;
    height: 30px;
    padding: 4px;
    gap: 4px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 1rem 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    z-index: 99;
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    font-size: 0.9rem;
    padding: 0.65rem 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
  }
  .site-nav a:last-child {
    border-bottom: none;
  }
  .site-nav a:hover {
    background: none;
    color: var(--accent);
  }

  .nav-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .nav-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .post-card {
    grid-template-columns: 1fr 80px;
  }
  .post-card-thumb {
    width: 80px;
    height: 54px;
  }

  .featured-image {
    margin-bottom: 1.25rem;
  }
  .toc {
    padding: 0.85rem 1rem;
  }
  .post-content th,
  .post-content td {
    padding: 0.5rem 0.5rem;
  }
}
