/* ============================================
   InfoToday — 교통사고 후유증 정보 플랫폼
   Premium Design System
   ============================================ */

:root {
  /* Color Tokens */
  --clr-primary: #1B4965;
  --clr-primary-light: #2A6F97;
  --clr-primary-dark: #0F2D40;
  --clr-accent: #3D8B6E;
  --clr-accent-light: #4CA880;
  --clr-warm: #C1976B;
  --clr-bg: #FAFBFC;
  --clr-surface: #FFFFFF;
  --clr-surface-alt: #F3F5F7;
  --clr-border: #E2E6EA;
  --clr-border-light: #EEF0F3;
  --clr-text: #1A1D21;
  --clr-text-secondary: #4A5568;
  --clr-text-muted: #8896A6;
  --clr-danger: #D9534F;

  /* Spacing (8pt scale) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  --sp-9: 48px; --sp-10: 56px; --sp-11: 64px; --sp-12: 80px;
  --sp-13: 96px; --sp-14: 112px; --sp-15: 128px;

  /* Typography */
  --font-body: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Noto Serif KR', 'Pretendard Variable', serif;
  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-base: 1rem;
  --fs-md: 1.125rem; --fs-lg: 1.25rem; --fs-xl: 1.5rem;
  --fs-2xl: 2rem; --fs-3xl: 2.5rem; --fs-4xl: 3.25rem;
  --lh-tight: 1.3; --lh-normal: 1.7; --lh-relaxed: 1.8;
  --ls-tight: -0.02em; --ls-normal: -0.01em;

  /* Shapes */
  --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 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms; --dur-normal: 250ms; --dur-slow: 400ms;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--clr-text);
  background: var(--clr-bg);
  letter-spacing: var(--ls-normal);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--clr-primary); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--clr-accent); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--clr-primary-dark);
}

/* ---- Site Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border-light);
  padding: var(--sp-4) 0;
}
.site-header .container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo { display: flex; align-items: center; gap: var(--sp-3); }
.site-logo img { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.site-logo-text {
  font-family: var(--font-heading); font-size: var(--fs-lg);
  font-weight: 700; color: var(--clr-primary-dark);
}

.site-nav { display: flex; gap: var(--sp-2); align-items: center; }
.site-nav a {
  display: inline-block; padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm); font-weight: 500;
  color: var(--clr-text-secondary); border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
}
.site-nav a:hover { color: var(--clr-primary); background: var(--clr-surface-alt); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--sp-2); }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--clr-text); margin: 5px 0; transition: var(--dur-normal); border-radius: 2px; }

/* ---- Hero Section ---- */
.hero-section {
  position: relative; min-height: 520px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: var(--sp-13);
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(15,45,64,0.88) 0%, rgba(27,73,101,0.72) 50%, rgba(61,139,110,0.5) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; max-width: 800px; padding: var(--sp-12) var(--sp-6);
}
.hero-badge {
  display: inline-block; padding: var(--sp-2) var(--sp-4);
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px; font-size: var(--fs-xs); font-weight: 600;
  color: rgba(255,255,255,0.9); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: var(--sp-6);
  backdrop-filter: blur(4px);
}
.hero-title {
  font-size: clamp(2rem, 5vw, var(--fs-4xl)); color: #fff;
  margin-bottom: var(--sp-5); line-height: 1.2;
}
.hero-subtitle {
  font-size: var(--fs-md); color: rgba(255,255,255,0.85);
  line-height: var(--lh-relaxed); max-width: 600px; margin: 0 auto var(--sp-8);
}
.hero-cta {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-7); background: var(--clr-accent);
  color: #fff; font-weight: 600; font-size: var(--fs-base);
  border-radius: 100px; border: none; cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  box-shadow: 0 4px 16px rgba(61,139,110,0.3);
}
.hero-cta:hover { background: var(--clr-accent-light); transform: translateY(-2px); color: #fff; box-shadow: 0 6px 24px rgba(61,139,110,0.4); }
.hero-cta svg { width: 18px; height: 18px; }

/* ---- Section Layout ---- */
.section { padding: var(--sp-13) 0; }
.section-alt { background: var(--clr-surface-alt); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-6); }
.section-header { text-align: center; margin-bottom: var(--sp-11); }
.section-label {
  display: inline-block; font-size: var(--fs-xs); font-weight: 700;
  color: var(--clr-accent); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
.section-title { font-size: var(--fs-2xl); margin-bottom: var(--sp-4); }
.section-desc { font-size: var(--fs-md); color: var(--clr-text-secondary); max-width: 600px; margin: 0 auto; line-height: var(--lh-relaxed); }

/* ---- Article Card Grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-7);
}
.article-card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-normal) var(--ease-out);
  border: 1px solid var(--clr-border-light);
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.article-card .card-img {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
}
.article-card .card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.article-card:hover .card-img img { transform: scale(1.04); }
.article-card .card-body { padding: var(--sp-6); }
.article-card .card-category {
  display: inline-block; font-size: var(--fs-xs); font-weight: 600;
  color: var(--clr-accent); margin-bottom: var(--sp-3);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.article-card .card-title {
  font-size: var(--fs-lg); font-family: var(--font-heading);
  color: var(--clr-primary-dark); margin-bottom: var(--sp-3);
  line-height: var(--lh-tight);
}
.article-card .card-excerpt {
  font-size: var(--fs-sm); color: var(--clr-text-secondary);
  line-height: var(--lh-normal);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .card-meta {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-4); padding-top: var(--sp-4);
  border-top: 1px solid var(--clr-border-light);
  font-size: var(--fs-xs); color: var(--clr-text-muted);
}

/* ---- Featured / Carousel ---- */
.featured-card {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1.2fr 1fr;
  background: var(--clr-surface); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md);
  border: 1px solid var(--clr-border-light);
}
.featured-card .card-img { aspect-ratio: auto; min-height: 340px; }
.featured-card .card-body { padding: var(--sp-9); display: flex; flex-direction: column; justify-content: center; }
.featured-card .card-title { font-size: var(--fs-xl); }

/* ---- Info Blocks / Stats ---- */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-6);
}
.info-block {
  background: var(--clr-surface); border-radius: var(--radius-md);
  padding: var(--sp-7) var(--sp-6);
  border: 1px solid var(--clr-border-light);
  text-align: center;
  transition: all var(--dur-normal) var(--ease-out);
}
.info-block:hover { border-color: var(--clr-accent); box-shadow: var(--shadow-md); }
.info-icon {
  width: 48px; height: 48px; margin: 0 auto var(--sp-4);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  border-radius: var(--radius-md); color: #fff;
}
.info-icon svg { width: 24px; height: 24px; }
.info-block h3 { font-size: var(--fs-md); margin-bottom: var(--sp-3); font-family: var(--font-body); font-weight: 700; }
.info-block p { font-size: var(--fs-sm); color: var(--clr-text-secondary); line-height: var(--lh-normal); }

/* ---- Single Post ---- */
.single-post-wrap { max-width: 780px; margin: 0 auto; padding: var(--sp-12) var(--sp-6); }
.single-post-wrap .entry-header { margin-bottom: var(--sp-9); }
.single-post-wrap h1.entry-title {
  font-size: clamp(1.5rem, 4vw, var(--fs-3xl));
  line-height: var(--lh-tight); margin-bottom: var(--sp-5);
}
.single-post-wrap .entry-meta {
  display: flex; gap: var(--sp-4); align-items: center;
  font-size: var(--fs-sm); color: var(--clr-text-muted);
  padding-bottom: var(--sp-6); border-bottom: 1px solid var(--clr-border-light);
}
.single-post-wrap .entry-content { font-size: var(--fs-md); line-height: var(--lh-relaxed); }
.single-post-wrap .entry-content h2 {
  font-size: var(--fs-xl); margin: var(--sp-11) 0 var(--sp-5);
  padding-bottom: var(--sp-3); border-bottom: 2px solid var(--clr-primary);
  color: var(--clr-primary-dark);
}
.single-post-wrap .entry-content h3 {
  font-size: var(--fs-lg); margin: var(--sp-8) 0 var(--sp-4);
  color: var(--clr-primary);
}
.single-post-wrap .entry-content p { margin-bottom: var(--sp-5); }
.single-post-wrap .entry-content img {
  border-radius: var(--radius-md); margin: var(--sp-7) 0;
  box-shadow: var(--shadow-sm);
}
.single-post-wrap .entry-content ul, .single-post-wrap .entry-content ol {
  margin: var(--sp-5) 0 var(--sp-5) var(--sp-6);
}
.single-post-wrap .entry-content li { margin-bottom: var(--sp-2); line-height: var(--lh-normal); }

/* Tables */
.single-post-wrap .entry-content table,
.entry-content table,
.wp-block-table table {
  width: 100%; border-collapse: collapse; margin: var(--sp-6) 0;
  font-size: var(--fs-sm); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.single-post-wrap .entry-content table thead th,
.entry-content table thead th {
  background: var(--clr-primary); color: #fff;
  padding: var(--sp-3) var(--sp-4); text-align: left;
  font-weight: 600; font-size: var(--fs-xs);
  letter-spacing: 0.03em;
}
.single-post-wrap .entry-content table td,
.entry-content table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--clr-border-light);
}
.single-post-wrap .entry-content table tr:nth-child(even) td { background: var(--clr-surface-alt); }
.single-post-wrap .entry-content table tr:hover td { background: rgba(27,73,101,0.04); }

/* Blockquote / Callout */
.single-post-wrap .entry-content blockquote,
.entry-content blockquote {
  background: linear-gradient(135deg, rgba(27,73,101,0.04), rgba(61,139,110,0.04));
  border-left: 4px solid var(--clr-primary);
  padding: var(--sp-6); margin: var(--sp-7) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--fs-base); color: var(--clr-text-secondary);
  line-height: var(--lh-relaxed);
}
.single-post-wrap .entry-content blockquote p:last-child { margin-bottom: 0; }

/* Summary box */
.summary-box {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
  box-shadow: var(--shadow-sm);
}
.summary-box .summary-title {
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--clr-primary); margin-bottom: var(--sp-3);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Warning/Danger callout */
.callout-danger {
  background: #FFF5F5; border-left: 4px solid var(--clr-danger);
  padding: var(--sp-5) var(--sp-6); margin: var(--sp-6) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.callout-danger strong { color: var(--clr-danger); }

/* Tip callout */
.callout-tip {
  background: rgba(61,139,110,0.06);
  border-left: 4px solid var(--clr-accent);
  padding: var(--sp-5) var(--sp-6); margin: var(--sp-6) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Legal / AI notice */
.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; }
.ai-notice { font-size: 0.85em; color: #888; margin-top: 2em; }

/* Chart bar */
.chart-bar-wrap { margin: var(--sp-6) 0; }
.chart-bar-item { margin-bottom: var(--sp-3); }
.chart-bar-label { font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-1); color: var(--clr-text-secondary); }
.chart-bar-track { height: 28px; background: var(--clr-surface-alt); border-radius: 100px; overflow: hidden; position: relative; }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent)); border-radius: 100px; display: flex; align-items: center; padding: 0 var(--sp-3); min-width: 40px; transition: width var(--dur-slow) var(--ease-out); }
.chart-bar-val { font-size: var(--fs-xs); color: #fff; font-weight: 700; white-space: nowrap; }

/* ---- Footer ---- */
.site-footer {
  background: var(--clr-primary-dark); color: rgba(255,255,255,0.7);
  padding: var(--sp-12) 0 var(--sp-7);
}
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: var(--sp-9); margin-bottom: var(--sp-9); padding-bottom: var(--sp-9); border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand-name { font-family: var(--font-heading); font-size: var(--fs-lg); color: #fff; font-weight: 700; margin-bottom: var(--sp-3); }
.footer-desc { font-size: var(--fs-sm); line-height: var(--lh-normal); }
.footer-col h4 { color: #fff; font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--sp-4); font-family: var(--font-body); letter-spacing: 0.05em; }
.footer-col a { display: block; font-size: var(--fs-sm); color: rgba(255,255,255,0.6); padding: var(--sp-1) 0; transition: color var(--dur-fast); }
.footer-col a:hover { color: #fff; }
.footer-legal {
  font-size: var(--fs-xs); color: rgba(255,255,255,0.45);
  line-height: var(--lh-relaxed); margin-top: var(--sp-6);
}
.footer-legal p { margin-bottom: var(--sp-2); }
.footer-bottom { text-align: center; font-size: var(--fs-xs); color: rgba(255,255,255,0.35); }

/* ---- Page Templates ---- */
.page-wrap { max-width: 780px; margin: 0 auto; padding: var(--sp-12) var(--sp-6); }
.page-wrap h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-7); }
.page-wrap h2 { font-size: var(--fs-xl); margin: var(--sp-9) 0 var(--sp-4); color: var(--clr-primary-dark); }
.page-wrap p { margin-bottom: var(--sp-4); line-height: var(--lh-relaxed); color: var(--clr-text-secondary); }
.page-wrap ul, .page-wrap ol { margin: var(--sp-4) 0 var(--sp-4) var(--sp-6); }
.page-wrap li { margin-bottom: var(--sp-2); line-height: var(--lh-normal); color: var(--clr-text-secondary); }

/* ---- Related Posts ---- */
.related-posts { margin-top: var(--sp-12); padding-top: var(--sp-9); border-top: 1px solid var(--clr-border-light); }
.related-posts h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-6); font-family: var(--font-body); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-5); }
.related-card { border-radius: var(--radius-md); overflow: hidden; background: var(--clr-surface); box-shadow: var(--shadow-sm); border: 1px solid var(--clr-border-light); transition: all var(--dur-normal) var(--ease-out); }
.related-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.related-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.related-card .related-title { padding: var(--sp-4); font-size: var(--fs-sm); font-weight: 600; color: var(--clr-primary-dark); }

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-section { min-height: 420px; }
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: var(--fs-base); }

  .card-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .featured-card { grid-template-columns: 1fr; }
  .featured-card .card-body { padding: var(--sp-6); }
  .featured-card .card-img { min-height: 220px; }

  .info-grid { grid-template-columns: 1fr 1fr; }

  .footer-top { grid-template-columns: 1fr; gap: var(--sp-6); }

  .site-nav { display: none; position: fixed; top: 57px; left: 0; right: 0; background: var(--clr-surface); flex-direction: column; padding: var(--sp-4); box-shadow: var(--shadow-lg); border-top: 1px solid var(--clr-border-light); z-index: 99; }
  .site-nav.active { display: flex; }
  .nav-toggle { display: block; }

  .single-post-wrap { padding: var(--sp-7) var(--sp-4); }
  .page-wrap { padding: var(--sp-7) var(--sp-4); }

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

  .single-post-wrap .entry-content table { display: block; overflow-x: auto; }
}

@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .fade-up { opacity: 1; transform: none; }
}

/* ---- Accessibility ---- */
:focus-visible { outline: 2px solid var(--clr-accent); outline-offset: 2px; border-radius: 2px; }
.skip-link { position: absolute; left: -9999px; top: var(--sp-2); background: var(--clr-primary); color: #fff; padding: var(--sp-2) var(--sp-4); z-index: 9999; border-radius: var(--radius-sm); }
.skip-link:focus { left: var(--sp-2); }

/* Hide WordPress default elements */
.wp-site-blocks > header, .wp-site-blocks > footer { display: none !important; }
.powered-by-wordpress, .wp-block-template-part footer { display: none !important; }
