:root {
  --color-primary: #1a365d;
  --color-primary-dark: #0f2440;
  --color-accent: #2b6cb0;
  --color-accent-light: #3182ce;
  --color-surface: #ffffff;
  --color-surface-alt: #f7fafc;
  --color-surface-muted: #edf2f7;
  --color-border: #e2e8f0;
  --color-border-light: #f0f4f8;
  --color-text: #1a202c;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;
  --color-text-light: #a0aec0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px 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);
  --font-heading: 'Noto Serif KR', 'Georgia', serif;
  --font-body: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;
  --content-width: 780px;
  --site-width: 1200px;
  --transition: 200ms cubic-bezier(0.4,0,0.2,1);
}

@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; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-primary);
}
.site-logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}
.site-logo-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-menu {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}
.nav-menu a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}
.nav-menu a:hover { color: var(--color-primary); }
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}
.nav-menu a:hover::after { width: 100%; }
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}
.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: var(--transition);
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--color-primary-dark);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,36,64,0.92) 0%, rgba(26,54,93,0.78) 50%, rgba(43,108,176,0.6) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: var(--space-5xl) var(--space-lg);
}
.hero-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 100px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-lg);
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  max-width: 640px;
}
.hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.8;
  max-width: 520px;
  margin-bottom: var(--space-2xl);
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}
.hero-cta:hover { background: var(--color-accent-light); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ===== SECTIONS ===== */
.section { padding: var(--space-5xl) var(--space-lg); }
.section-alt { background: var(--color-surface-alt); }
.section-inner { max-width: var(--site-width); margin: 0 auto; }
.section-header { text-align: center; margin-bottom: var(--space-3xl); }
.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}
.section-desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-xl);
}
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-image img { transform: scale(1.04); }
.card-body { padding: var(--space-lg); }
.card-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}
.card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.45;
  margin-bottom: var(--space-sm);
}
.card-title a { text-decoration: none; color: inherit; transition: color var(--transition); }
.card-title a:hover { color: var(--color-accent); }
.card-excerpt {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
  font-size: 0.78rem;
  color: var(--color-text-light);
}

/* ===== CAROUSEL ===== */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-md);
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .card {
  min-width: 340px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* ===== FEATURES ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
}
.feature-card {
  padding: var(--space-2xl);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}
.feature-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}
.feature-icon svg { width: 24px; height: 24px; stroke: var(--color-accent); fill: none; stroke-width: 1.5; }
.feature-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}
.feature-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.7);
  padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
}
.footer-inner {
  max-width: var(--site-width);
  margin: 0 auto;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}
.footer-brand { max-width: 320px; }
.footer-brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-md);
}
.footer-brand-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
}
.footer-links { display: flex; gap: var(--space-3xl); flex-wrap: wrap; }
.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-sm); }
.footer-col a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-col a:hover { color: rgba(255,255,255,0.9); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-2xl);
  flex-wrap: wrap;
  gap: var(--space-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.65;
  margin-top: var(--space-md);
}

/* ===== SINGLE POST ===== */
.single-post-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg) var(--space-5xl);
}
.single-post-wrap .entry-header { margin-bottom: var(--space-2xl); }
.single-post-wrap .entry-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.single-post-wrap .entry-meta {
  margin-top: var(--space-md);
  font-size: 0.82rem;
  color: var(--color-text-light);
}
.single-post-wrap .entry-content {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--color-text-secondary);
}
.single-post-wrap .entry-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: var(--space-3xl) 0 var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
}
.single-post-wrap .entry-content h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  margin: var(--space-2xl) 0 var(--space-md);
}
.single-post-wrap .entry-content p {
  margin-bottom: var(--space-lg);
}
.single-post-wrap .entry-content img {
  border-radius: var(--radius-md);
  margin: var(--space-2xl) 0;
  box-shadow: var(--shadow-sm);
}
.single-post-wrap .entry-content ul,
.single-post-wrap .entry-content ol {
  margin: var(--space-lg) 0;
  padding-left: var(--space-lg);
}
.single-post-wrap .entry-content li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}
.single-post-wrap .entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-2xl) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.9rem;
}
.single-post-wrap .entry-content table thead {
  background: var(--color-primary);
  color: #fff;
}
.single-post-wrap .entry-content table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
}
.single-post-wrap .entry-content table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}
.single-post-wrap .entry-content table tbody tr:nth-child(even) {
  background: var(--color-surface-alt);
}
.single-post-wrap .entry-content blockquote {
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface-alt);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-2xl) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}
.single-post-wrap .entry-content .wp-block-table {
  overflow-x: auto;
}
.single-post-wrap .featured-image {
  margin-bottom: var(--space-2xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.single-post-wrap .featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin: 0;
  box-shadow: none;
}

/* Related posts */
.related-posts { margin-top: var(--space-4xl); padding-top: var(--space-3xl); border-top: 1px solid var(--color-border); }
.related-title { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--color-text); margin-bottom: var(--space-xl); }

/* ===== PAGE ===== */
.page-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg) var(--space-5xl);
}
.page-wrap h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2xl);
}
.page-wrap h2 { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; color: var(--color-primary); margin: var(--space-2xl) 0 var(--space-md); }
.page-wrap p { margin-bottom: var(--space-md); line-height: 1.75; color: var(--color-text-secondary); }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--color-border);
    gap: var(--space-md);
  }
  .nav-menu.open { display: flex; }
  .hero-section { min-height: 420px; }
  .hero-content { padding: var(--space-3xl) var(--space-lg); }
  .card-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .carousel-track .card { min-width: 280px; }
  .footer-top { flex-direction: column; gap: var(--space-xl); }
  .footer-links { flex-direction: column; gap: var(--space-xl); }
  .section { padding: var(--space-3xl) var(--space-md); }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
  .fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .fade-in.visible { opacity: 1; transform: translateY(0); }
}

/* ===== TOC ===== */
.toc-box {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}
.toc-box h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-md) !important;
  color: var(--color-text);
}
.toc-box ol {
  padding-left: var(--space-lg);
}
.toc-box li {
  margin-bottom: var(--space-xs);
  font-size: 0.88rem;
}
.toc-box a {
  color: var(--color-accent);
  text-decoration: none;
}
.toc-box a:hover { text-decoration: underline; }

/* Callout */
.callout-box {
  background: linear-gradient(135deg, #ebf4ff 0%, #f0f7ff 100%);
  border: 1px solid #bee3f8;
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
}
.callout-box strong { color: var(--color-primary); }

/* Hide default WP elements */
.wp-site-blocks > header,
.wp-site-blocks > footer,
.has-global-padding > .wp-block-template-part { display: none !important; }

/* Override TT5 global styles */
body .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: none;
}
