/*
Theme Name: DivorceDocs
Theme URI: https://divorcedocs.rand3.com/
Description: 이혼 소송 서류 정보 플랫폼 전용 테마 — 프리미엄 디자인 시스템(8pt 스케일, 딥네이비·소프트블루 팔레트)
Version: 1.0.0
Author: DivorceDocs
Text Domain: divorcedocs
*/

/* ============ Design Tokens ============ */
:root {
  --navy: #1F3A5F;
  --navy-800: #162B47;
  --navy-900: #0F1F36;
  --blue: #5B8DB8;
  --blue-soft: #E8F0F6;
  --sage: #7A9E7E;
  --sage-soft: #EDF3EE;
  --gold: #C9A227;
  --ink: #2B2B2B;
  --ink-soft: #4B5563;
  --muted: #7C8794;
  --paper: #FFFFFF;
  --ivory: #F7F5F0;
  --ivory-2: #F1EEE7;
  --line: #E5E1D8;
  --line-2: #D8D3C8;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(31,58,95,.06), 0 2px 8px rgba(31,58,95,.05);
  --shadow: 0 4px 14px rgba(31,58,95,.08), 0 12px 32px rgba(31,58,95,.06);
  --shadow-lg: 0 16px 44px rgba(31,58,95,.14);
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-display: "Noto Serif KR", "Pretendard Variable", Pretendard, Georgia, serif;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px;
  --space-5: 48px; --space-6: 64px; --space-7: 96px; --space-8: 128px;
  --container: 1160px;
  --content-max: 780px;
  --ease: cubic-bezier(.25,.1,.25,1);
}

/* ============ Reset / Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--navy); }
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.35;
  letter-spacing: -0.018em;
  margin: 0 0 .55em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 700; }
h3 { font-size: 1.22rem; font-weight: 600; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.3em; padding-left: 1.35em; }
li { margin-bottom: .45em; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(91,141,184,.65); outline-offset: 2px; border-radius: 4px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 26px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font-body); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-800); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #4A7CA8; color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); background: var(--ivory); }
.btn-lg { min-height: 54px; padding: 14px 32px; font-size: 16.5px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17.5px; color: var(--navy); letter-spacing: -0.02em; line-height: 1.2; }
.brand-sub { display: block; font-family: var(--font-body); font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }
.main-nav ul { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.main-nav li { margin: 0; }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 15px;
  border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.main-nav a:hover { color: var(--navy); background: var(--ivory); }
.main-nav .current-menu-item > a, .main-nav .current-cat > a { color: var(--navy); background: var(--ivory); }
.nav-cta { margin-left: 10px; }
.nav-cta a { background: var(--navy); color: #fff; border-radius: 9px; padding: 10px 18px; min-height: 44px; }
.nav-cta a:hover { background: var(--navy-800); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; min-height: 44px; min-width: 44px; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 5px auto; border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }

/* ============ Footer ============ */
.site-footer { background: var(--navy-900); color: #C7D2DE; margin-top: var(--space-7); }
.footer-top { padding: var(--space-7) 0 var(--space-5); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: #9FB0C4; font-size: 14.5px; max-width: 380px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 18px; font-family: var(--font-body); font-weight: 700; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #9FB0C4; font-size: 14.5px; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 26px 0 34px;
}
.footer-legal .legal-box { background: rgba(255,255,255,.05); border-left: 3px solid var(--blue); border-radius: 0 10px 10px 0; padding: 16px 18px; }
.footer-legal .legal-box p { margin: 3px 0; font-size: 12.5px; line-height: 1.7; color: #9FB0C4; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; margin-top: 22px; font-size: 13px; color: #7E93AA; }
.footer-meta a { color: #9FB0C4; }
.footer-meta a:hover { color: #fff; }
.ai-img-notice { color: #8AA0B8; font-size: 12.5px; }

/* ============ Hero (theme default) ============ */
.hero { position: relative; overflow: hidden; background: var(--navy-900); color: #fff; }
.hero-inner { position: relative; z-index: 2; max-width: var(--container); margin: 0 auto; padding: var(--space-8) 24px var(--space-7); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: #CFE0EF; padding: 7px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600; margin-bottom: 22px; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.28; margin-bottom: 20px; }
.hero p.lede { color: #C3D2E2; font-size: clamp(1rem, 1.6vw, 1.18rem); max-width: 640px; line-height: 1.8; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 36px; margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,.14); }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 1.7rem; color: #fff; }
.hero-stat span { font-size: 13.5px; color: #93A9C2; }

/* ============ Section headings ============ */
.sec { padding: var(--space-7) 0; }
.sec-alt { background: var(--ivory); }
.sec-head { max-width: 680px; margin-bottom: var(--space-5); }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-kicker { display: inline-block; color: var(--blue); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.sec-head h2 { margin-bottom: 14px; }
.sec-head p { color: var(--muted); font-size: 16px; }

/* ============ Cards ============ */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.post-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.post-card .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ivory-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.post-card:hover .thumb img { transform: scale(1.045); }
.post-card .card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.post-card .cat-badge { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 4px 11px; border-radius: 999px; margin-bottom: 12px; }
.post-card h3 { font-size: 17.5px; line-height: 1.45; margin-bottom: 8px; color: var(--navy); }
.post-card:hover h3 { color: var(--blue); }
.post-card .excerpt { font-size: 14.5px; color: var(--muted); line-height: 1.65; margin-bottom: 14px; flex: 1; }
.post-card .meta { font-size: 12.5px; color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

/* ============ Post content ============ */
.entry { max-width: var(--content-max); margin: 0 auto; }
.entry-header { text-align: left; margin-bottom: var(--space-4); }
.entry-header .cat-badge { display: inline-block; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 5px 14px; border-radius: 999px; margin-bottom: 18px; }
.entry-header h1 { margin-bottom: 14px; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; }
.entry-featured { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); margin-bottom: var(--space-5); }
.entry-featured img { width: 100%; }
.entry-content { font-size: 16.5px; line-height: 1.85; color: var(--ink); }
.entry-content h2 { margin-top: 2.2em; padding-top: .4em; }
.entry-content h3 { margin-top: 1.8em; }
.entry-content img.dd-fig { border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 26px 0; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(91,141,184,.5); }
.entry-content a:hover { text-decoration-color: var(--navy); }
.entry-content blockquote { margin: 26px 0; padding: 20px 22px; background: var(--ivory); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-soft); }
.entry-content blockquote p { margin: 0; }

.dd-summary { background: var(--blue-soft); border: 1px solid #D6E4F0; border-radius: var(--radius); padding: 20px 24px; margin: 22px 0; }
.dd-summary strong { display: block; color: var(--navy); font-size: 15.5px; margin-bottom: 8px; }
.dd-summary ul { margin: 0; padding-left: 1.2em; }
.dd-summary li { font-size: 14.8px; margin-bottom: 6px; color: var(--ink-soft); }

.dd-table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 15px; line-height: 1.6; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.dd-table caption { text-align: left; font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 16px; padding: 0 0 10px; }
.dd-table th { background: var(--navy); color: #fff; text-align: left; padding: 12px 16px; font-weight: 600; font-size: 14.5px; }
.dd-table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.dd-table tbody tr:nth-child(even) { background: var(--ivory); }
.dd-table tbody tr:hover { background: var(--blue-soft); }

.dd-flow { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0; }
.dd-flow-item { flex: 1 1 150px; display: flex; align-items: center; gap: 10px; background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.dd-flow-item span { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; border-radius: 50%; font-size: 13px; font-weight: 700; }
.dd-bar { margin: 26px 0; display: grid; gap: 14px; }
.dd-bar-item { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.dd-bar-label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.dd-bar-track { height: 26px; background: var(--ivory-2); border-radius: 999px; overflow: hidden; }
.dd-bar-fill { display: flex; align-items: center; justify-content: flex-end; height: 100%; background: linear-gradient(90deg, var(--blue), #6FA3CC); color: #fff; font-size: 12px; font-weight: 700; padding-right: 10px; border-radius: 999px; }
.dd-bar-fill-alt { background: linear-gradient(90deg, var(--sage), #92B796); }

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

/* TOC (easy-table-of-contents) */
#ez-toc-container { background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 26px; box-shadow: none; }
#ez-toc-container .ez-toc-title { font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 15.5px; }
#ez-toc-container ul { padding-left: 1.2em; }
#ez-toc-container li { margin-bottom: 6px; }
#ez-toc-container a { color: var(--ink-soft); font-size: 14.5px; }
#ez-toc-container a:hover { color: var(--navy); }

/* ============ Related posts ============ */
.related { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.related h2, .related .related-title { margin-bottom: var(--space-3); }
.related .related-title { font-size: 1.45rem; font-weight: 700; line-height: 1.3; color: var(--ink, #111); letter-spacing: -0.01em; }

/* ============ Pages ============ */
.page-entry { max-width: var(--content-max); margin: 0 auto; padding: var(--space-6) 0; }
.page-entry h2 { margin-top: 1.6em; }
.page-entry h2:first-child { margin-top: 0; }

/* ============ Archive ============ */
.archive-head { background: var(--ivory); border-bottom: 1px solid var(--line); padding: var(--space-5) 0; margin-bottom: var(--space-5); }
.archive-head .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.archive-head h1 { margin: 0; }

/* ============ 404 ============ */
.error404 .entry { text-align: center; padding: var(--space-7) 0; }
.error404 .entry h1 { font-size: 3rem; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    display: none; padding: 12px 20px 20px; box-shadow: var(--shadow);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { justify-content: flex-start; padding: 12px 14px; }
  .nav-cta { margin: 8px 0 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .dd-table { font-size: 13.8px; display: block; overflow-x: auto; white-space: nowrap; }
  .dd-table caption { white-space: normal; }
  .sec { padding: var(--space-6) 0; }
  .hero-inner { padding: var(--space-6) 24px var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
