:root {
  --color-primary: #1a365d;
  --color-primary-light: #2b6cb0;
  --color-primary-dark: #0f2440;
  --color-accent: #2b6cb0;
  --color-accent-light: #4299e1;
  --color-accent-subtle: #ebf4ff;
  --color-surface: #ffffff;
  --color-surface-alt: #f7fafc;
  --color-surface-elevated: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #edf2f7;
  --color-text: #1a202c;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;
  --color-text-inverse: #ffffff;
  --color-success: #38a169;
  --color-warning: #d69e2e;
  --color-danger: #e53e3e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  --spacing-4xl: 96px;
  --spacing-5xl: 128px;
  --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Noto Serif KR', Georgia, serif;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --content-width: 760px;
  --wide-width: 1200px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.7;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition-normal);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  max-width: var(--wide-width); margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.header-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.header-logo img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.header-logo-text {
  font-size: 1.05rem; font-weight: 700; color: var(--color-primary);
  letter-spacing: -0.02em;
}
.header-nav { display: flex; gap: var(--spacing-lg); align-items: center; }
.header-nav a {
  font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary);
  text-decoration: none; transition: color var(--transition-fast);
  position: relative; padding: 4px 0;
}
.header-nav a:hover { color: var(--color-primary); }
.header-nav a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--color-accent); transform: scaleX(0);
  transition: transform var(--transition-normal);
}
.header-nav a:hover::after { transform: scaleX(1); }
.mobile-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; align-items: center; justify-content: center;
}
.mobile-toggle span {
  display: block; width: 22px; height: 2px; background: var(--color-text);
  position: relative; transition: var(--transition-fast);
}
.mobile-toggle span::before, .mobile-toggle span::after {
  content: ''; position: absolute; width: 100%; height: 100%;
  background: inherit; transition: inherit;
}
.mobile-toggle span::before { top: -7px; }
.mobile-toggle span::after { top: 7px; }

/* === SINGLE POST === */
.entry-header { padding: 100px 0 40px; text-align: center; }
.entry-category {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  color: var(--color-accent); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: var(--spacing-md);
}
.entry-title {
  font-family: var(--font-serif); font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700; color: var(--color-primary-dark); line-height: 1.3;
  max-width: var(--content-width); margin: 0 auto;
}
.entry-meta {
  margin-top: var(--spacing-md); font-size: 0.85rem;
  color: var(--color-text-muted);
}
.entry-featured-image {
  max-width: 900px; margin: 0 auto var(--spacing-3xl);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.entry-featured-image img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }

.entry-content {
  max-width: var(--content-width); margin: 0 auto;
  padding: 0 var(--spacing-lg) var(--spacing-4xl);
  font-size: 1.05rem; line-height: 1.8;
}
.entry-content p { margin-bottom: 1.5em; color: var(--color-text); }
.entry-content h2 {
  font-family: var(--font-serif); font-size: 1.55rem; font-weight: 700;
  color: var(--color-primary-dark); margin: 2.5em 0 0.8em;
  padding-bottom: 0.5em; border-bottom: 2px solid var(--color-border-light);
  line-height: 1.4;
}
.entry-content h3 {
  font-size: 1.2rem; font-weight: 600; color: var(--color-primary);
  margin: 2em 0 0.6em; line-height: 1.4;
}
.entry-content img {
  max-width: 100%; height: auto; border-radius: var(--radius-md);
  margin: 1.5em 0; box-shadow: var(--shadow-sm);
}
.entry-content figure { margin: 2em 0; }
.entry-content figcaption {
  font-size: 0.85rem; color: var(--color-text-muted);
  text-align: center; margin-top: var(--spacing-sm);
}
.entry-content ul, .entry-content ol {
  margin: 1em 0 1.5em; padding-left: 1.5em;
}
.entry-content li { margin-bottom: 0.5em; line-height: 1.7; }
.entry-content blockquote {
  margin: 1.5em 0; padding: 1.2em 1.5em;
  background: var(--color-accent-subtle);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: normal;
}
.entry-content blockquote p { margin-bottom: 0; color: var(--color-primary); }
.entry-content a {
  color: var(--color-accent); text-decoration: underline;
  text-underline-offset: 3px;
}
.entry-content a:hover { color: var(--color-primary); }

/* Tables */
.entry-content table {
  width: 100%; border-collapse: collapse; margin: 1.5em 0;
  font-size: 0.92rem; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--color-border);
}
.entry-content thead { background: var(--color-primary); color: #fff; }
.entry-content th {
  padding: 12px 16px; font-weight: 600; text-align: left;
  font-size: 0.85rem; letter-spacing: 0.02em;
}
.entry-content td {
  padding: 11px 16px; border-bottom: 1px solid var(--color-border-light);
}
.entry-content tbody tr:nth-child(even) { background: var(--color-surface-alt); }
.entry-content tbody tr:hover { background: var(--color-accent-subtle); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5em 0; }

/* Callout */
.callout {
  padding: 1.2em 1.5em; margin: 1.5em 0; border-radius: var(--radius-md);
  background: #fffbeb; border: 1px solid #fcd34d;
}
.callout-info {
  background: var(--color-accent-subtle); border-color: var(--color-accent-light);
}
.callout-title {
  font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3em;
  color: var(--color-primary);
}

/* Summary Box */
.summary-box {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff; padding: 1.5em 2em; border-radius: var(--radius-lg);
  margin-bottom: 2em;
}
.summary-box h3 { color: #fff; margin-bottom: 0.5em; font-size: 1.1rem; }
.summary-box ul { padding-left: 1.2em; }
.summary-box li { color: rgba(255,255,255,0.9); margin-bottom: 0.3em; }

/* Bar Chart */
.bar-chart { margin: 1.5em 0; }
.bar-item { margin-bottom: 12px; }
.bar-label {
  font-size: 0.85rem; font-weight: 500; margin-bottom: 4px;
  color: var(--color-text-secondary);
}
.bar-track {
  height: 28px; background: var(--color-surface-alt); border-radius: 14px;
  overflow: hidden; position: relative;
}
.bar-fill {
  height: 100%; border-radius: 14px; display: flex; align-items: center;
  justify-content: flex-end; padding-right: 10px; font-size: 0.78rem;
  font-weight: 600; color: #fff; min-width: 40px;
  transition: width 0.8s ease;
}
.bar-fill-primary { background: linear-gradient(90deg, var(--color-accent), var(--color-primary)); }
.bar-fill-accent { background: linear-gradient(90deg, #38a169, #2f855a); }
.bar-fill-warning { background: linear-gradient(90deg, #d69e2e, #b7791f); }
.bar-fill-danger { background: linear-gradient(90deg, #e53e3e, #c53030); }

/* Steps */
.steps { margin: 1.5em 0; counter-reset: step; }
.step-item {
  display: flex; gap: 16px; margin-bottom: 20px;
  padding-bottom: 20px; border-bottom: 1px solid var(--color-border-light);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); color: #fff; font-weight: 700;
  font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
}
.step-content { flex: 1; }
.step-content h4 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.step-content p { font-size: 0.92rem; color: var(--color-text-secondary); margin: 0; }

/* FAQ */
.faq-section { margin: 2em 0; }
.faq-item {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  margin-bottom: 8px; overflow: hidden;
}
.faq-question {
  padding: 14px 18px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  background: var(--color-surface-alt); transition: background var(--transition-fast);
}
.faq-question:hover { background: var(--color-accent-subtle); }
.faq-arrow { transition: transform var(--transition-normal); font-size: 0.8rem; color: var(--color-text-muted); }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  padding: 0 18px; max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  font-size: 0.92rem; color: var(--color-text-secondary); line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 14px 18px; }

/* Related Posts */
.related-posts { margin: 3em 0; padding-top: 2em; border-top: 2px solid var(--color-border-light); }
.related-posts h3 {
  font-family: var(--font-serif); font-size: 1.3rem;
  color: var(--color-primary-dark); margin-bottom: 1em;
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--spacing-lg); }
.related-card {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--color-border); transition: all var(--transition-normal);
  text-decoration: none; color: inherit;
}
.related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.related-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.related-card-body { padding: 14px 16px; }
.related-card-title { font-size: 0.92rem; font-weight: 600; color: var(--color-text); line-height: 1.4; }

/* TOC */
.toc-box {
  background: var(--color-surface-alt); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.5em; margin: 0 0 2.5em;
}
.toc-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.8em; color: var(--color-primary); }
.toc-list { list-style: none; padding: 0; }
.toc-list li { margin-bottom: 0.4em; }
.toc-list a {
  font-size: 0.9rem; color: var(--color-text-secondary); text-decoration: none;
  display: flex; align-items: baseline; gap: 8px;
  transition: color var(--transition-fast);
}
.toc-list a::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-accent); flex-shrink: 0; margin-top: 2px;
}
.toc-list a:hover { color: var(--color-primary); }

/* === FOOTER === */
.site-footer {
  background: var(--color-primary-dark); color: rgba(255,255,255,0.8);
  padding: var(--spacing-4xl) 0 var(--spacing-xl);
}
.footer-inner {
  max-width: var(--wide-width); margin: 0 auto; padding: 0 var(--spacing-lg);
}
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--spacing-3xl);
  padding-bottom: var(--spacing-3xl); border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand-name {
  font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: var(--spacing-md);
}
.footer-desc { font-size: 0.85rem; line-height: 1.7; color: rgba(255,255,255,0.6); }
.footer-col h4 {
  font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--spacing-md);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.88rem;
  transition: color var(--transition-fast);
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  padding-top: var(--spacing-xl); display: flex;
  justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: var(--spacing-md);
}
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.4); }
.footer-legal { font-size: 0.75rem; color: rgba(255,255,255,0.35); max-width: 700px; line-height: 1.6; }

/* === MOBILE === */
@media (max-width: 768px) {
  .header-nav { 
    display: none; position: fixed; top: 64px; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg); gap: 0;
    border-top: 1px solid var(--color-border);
  }
  .header-nav.open { display: flex; }
  .header-nav a { padding: 12px 0; border-bottom: 1px solid var(--color-border-light); font-size: 1rem; }
  .header-nav a::after { display: none; }
  .mobile-toggle { display: flex; }
  .footer-top { grid-template-columns: 1fr; gap: var(--spacing-xl); }
  .entry-content { padding: 0 var(--spacing-md) var(--spacing-3xl); }
  .entry-title { font-size: 1.5rem; }
  .related-grid { grid-template-columns: 1fr; }
  .entry-content table { font-size: 0.82rem; }
  .entry-content th, .entry-content td { padding: 8px 10px; }
}

/* Scroll animations */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Legal notices */
.ai-notice { font-size: 0.85em !important; color: #888 !important; margin-top: 2em !important; }
.legal-notice {
  font-size: 0.85em !important; color: #777 !important;
  background: #f8f9fa !important; border-left: 3px solid #cbd5e1 !important;
  padding: 10px 14px !important; margin-top: 2em !important;
  border-radius: 0 6px 6px 0 !important;
}
.legal-notice p { margin: 4px 0 !important; }

/* WP overrides - remove all default WP styling */
.wp-site-blocks { padding: 0 !important; }
body .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: none; margin-left: auto; margin-right: auto;
}
.wp-block-post-content { padding: 0; }
