/*
Theme Name: SelfDivorce Premium
Theme URI: https://selfdivorce.rand3.com/
Description: 나홀로 이혼소송 공개 정보 플랫폼 전용 프리미엄 테마. 8pt 스케일 디자인 시스템 기반.
Version: 1.0.0
Author: TION
Text Domain: selfdivorce-premium
*/

/* ============ DESIGN TOKENS ============ */
:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #F0EDE5;
  --ink: #1B2A4A;
  --ink-2: #2C3A5C;
  --teal: #2E7D74;
  --teal-deep: #25685F;
  --gold: #C9A227;
  --text: #3D4356;
  --muted: #6E7285;
  --line: #E6E1D6;
  --line-2: #EFEBE2;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(27,42,74,.06), 0 4px 14px rgba(27,42,74,.05);
  --shadow-md: 0 8px 24px rgba(27,42,74,.08);
  --shadow-lg: 0 18px 48px rgba(27,42,74,.12);
  --font-body: 'Pretendard Variable', Pretendard, 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  --font-head: 'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif;
  --container: 1180px;
  --sp-1: 8px; --sp-2: 16px; --sp-3: 24px; --sp-4: 32px; --sp-5: 48px; --sp-6: 64px; --sp-7: 96px; --sp-8: 128px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg);
  line-height: 1.7; word-break: keep-all; overflow-x: hidden;
  font-size: 16.5px;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--teal-deep); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.35; margin: 0 0 .6em; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid rgba(46,125,116,.45); outline-offset: 2px; border-radius: 4px; }

/* ============ CONTAINER ============ */
.site-container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-3); }
.container-narrow { max-width: 780px; margin: 0 auto; }

/* ============ HEADER ============ */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(247,245,240,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { flex: 0 0 auto; width: 42px; height: 42px; }
.brand-name { display: block; font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -0.02em; line-height: 1.25; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.main-nav ul { display: flex; align-items: center; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.main-nav a { display: inline-block; padding: 10px 14px; font-size: 15px; font-weight: 600; color: var(--ink-2); border-radius: 10px; }
.main-nav a:hover { color: var(--teal); background: rgba(46,125,116,.08); }
.nav-cta { background: var(--ink); color: #fff !important; padding: 12px 22px !important; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-sm); }
.nav-cta:hover { background: var(--teal); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 46px; height: 46px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--ink); }
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav { position: fixed; inset: 74px 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: var(--sp-2) var(--sp-3) var(--sp-3); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
  .main-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .main-nav a { display: block; padding: 14px 16px; font-size: 16px; }
  .nav-cta { text-align: center; }
}

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 26px; border-radius: 999px; font-weight: 700; font-size: 15.5px; border: 1px solid transparent; cursor: pointer; transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 18px rgba(46,125,116,.28); }
.btn-primary:hover { background: var(--teal-deep); color: #fff; transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #24365E; color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-sm { min-height: 44px; padding: 9px 20px; font-size: 14.5px; }

/* ============ SECTION HEADINGS ============ */
.section { padding: var(--sp-7) 0; }
.section-head { max-width: 720px; margin: 0 auto var(--sp-5); text-align: center; }
.eyebrow { display: inline-block; font-size: 13.5px; font-weight: 800; letter-spacing: .14em; color: var(--teal); text-transform: uppercase; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 14px; }
.section-head p { font-size: 17px; color: var(--muted); }

/* ============ FOOTER ============ */
.site-footer { background: var(--ink); color: #C7CDDB; padding: var(--sp-7) 0 var(--sp-4); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-5); }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { font-size: 14.5px; color: #9AA3B8; max-width: 360px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 16px; letter-spacing: .02em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: #AEB6C9; font-size: 14.5px; }
.footer-col a:hover { color: #fff; }
.footer-legal { margin-top: var(--sp-5); padding: var(--sp-4) 0 0; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 14px; }
.legal-text { font-size: 13px; line-height: 1.8; color: #98A1B7; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: var(--sp-3); border-top: 1px solid rgba(255,255,255,.1); font-size: 13.5px; color: #7F89A0; }
.footer-bottom nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: var(--sp-4); } }

/* ============ POST CARDS ============ */
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .22s ease, box-shadow .22s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card-thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-cat { font-size: 12.5px; font-weight: 800; color: var(--teal); letter-spacing: .02em; }
.post-card h3 { font-family: var(--font-body); font-weight: 800; font-size: 18.5px; line-height: 1.4; margin: 0; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--teal); }
.post-card p { font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.65; }
.post-card-meta { margin-top: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ============ POST GRID ============ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 1000px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; } }

/* ============ SINGLE POST ============ */
.single-hero { padding: var(--sp-6) 0 var(--sp-4); }
.single-head { text-align: center; max-width: 860px; margin: 0 auto; }
.single-head .post-card-cat { display: inline-block; background: rgba(46,125,116,.1); color: var(--teal); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; margin-bottom: 18px; }
.single-head h1 { font-size: clamp(30px, 4.6vw, 46px); margin-bottom: 16px; }
.single-head .post-meta { color: var(--muted); font-size: 14.5px; display: flex; justify-content: center; gap: 14px; }
.single-thumb { max-width: 920px; margin: var(--sp-4) auto 0; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-md); }
.single-thumb img { width: 100%; display: block; }
.article-body { font-size: 17px; line-height: 1.85; color: var(--text); }
.article-body > * { margin-bottom: 1.4em; }
.article-body h2 { font-size: clamp(24px, 3vw, 30px); margin-top: 2.2em; padding-bottom: .5em; border-bottom: 1px solid var(--line-2); scroll-margin-top: 96px; }
.article-body h3 { font-size: 21px; margin-top: 1.8em; scroll-margin-top: 96px; }
.article-body h3::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--teal); margin-right: 10px; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin-bottom: .55em; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body strong { color: var(--ink); }

/* summary box */
.post-summary { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--radius-m); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.post-summary-title { font-weight: 800; color: var(--ink); font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.post-summary-title::before { content: ""; width: 18px; height: 18px; border-radius: 6px; background: var(--teal); display: inline-block; }
.post-summary ul { margin: 0; padding-left: 1.2em; }
.post-summary li { margin-bottom: 6px; font-size: 15px; }

/* tables */
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.6em 0; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line-2); }
.article-body table th { background: var(--ink); color: #fff; text-align: left; padding: 12px 16px; font-weight: 700; font-size: 14.5px; }
.article-body table td { padding: 12px 16px; border-top: 1px solid var(--line-2); vertical-align: top; }
.article-body table tr:nth-child(even) td { background: #FAF9F5; }
.article-body table tr:hover td { background: rgba(46,125,116,.04); }
.article-body .table-wrap { overflow-x: auto; }
@media (max-width: 640px) { .article-body table { font-size: 13.5px; } .article-body table th, .article-body table td { padding: 9px 10px; } }

/* callout */
.info-highlight { background: rgba(46,125,116,.07); border-left: 4px solid var(--teal); border-radius: 0 var(--radius-m) var(--radius-m) 0; padding: 18px 22px; font-size: 15.5px; color: var(--ink-2); }
.info-highlight p { margin: 0; }
blockquote { margin: 1.6em 0; }

/* figures */
.post-figure { margin: 1.8em 0; }
.post-figure img { width: 100%; border-radius: var(--radius-m); box-shadow: var(--shadow-sm); }
.post-figure figcaption { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 10px; }

/* charts */
.chart { margin: 1.8em 0; }
.chart.timeline { display: grid; gap: 10px; }
.t-item { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-m); padding: 14px 18px; align-items: flex-start; }
.t-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.t-item strong { color: var(--ink); font-size: 15.5px; display: block; margin-bottom: 2px; }
.t-item p { margin: 0; font-size: 14px; color: var(--muted); }
.chart.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 110px; gap: 14px; align-items: center; }
.bar-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.bar-track { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), #57A79E); border-radius: 999px; }
.bar-val { font-size: 13px; color: var(--muted); text-align: right; }
.chart.gauge .gauge-wrap { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-m); padding: 20px 22px; }
.gauge-label { display: block; font-weight: 700; color: var(--ink-2); font-size: 15px; margin-bottom: 10px; }
.gauge-track { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.gauge-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.gauge-val { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .bar-row { grid-template-columns: 1fr; gap: 6px; } .bar-val { text-align: left; } }

/* notices */
.legal-notice, .ai-notice { line-height: 1.7; }
.ai-notice { font-style: normal; }

/* EZ TOC restyle */
div#ez-toc-container { background: var(--surface) !important; border: 1px solid var(--line-2) !important; border-radius: var(--radius-m) !important; box-shadow: var(--shadow-sm) !important; padding: 20px 22px !important; margin: 0 0 2em !important; display: block !important; width: 100% !important; }
div#ez-toc-container p.ez-toc-title, #ez-toc-container .ez_toc_custom_title_icon { color: var(--ink) !important; font-size: 15px !important; font-weight: 800 !important; }
div#ez-toc-container ul.ez-toc-list a, div#ez-toc-container ul.ez-toc-list a:visited { color: var(--ink-2) !important; }
div#ez-toc-container ul.ez-toc-list a:hover { color: var(--teal) !important; }
#ez-toc-container .ez-toc-title { font-weight: 800 !important; color: var(--ink) !important; font-size: 15px !important; }
#ez-toc-container ul { line-height: 1.9; }
#ez-toc-container a { color: var(--ink-2) !important; }
#ez-toc-container a:hover { color: var(--teal) !important; }
.ez-toc-list li a::before { color: var(--teal); }

/* ============ RELATED POSTS ============ */
.related-section { padding: var(--sp-6) 0; border-top: 1px solid var(--line-2); }
.related-section h2 { text-align: center; font-size: clamp(24px, 3vw, 32px); margin-bottom: var(--sp-4); }

/* ============ PAGE ============ */
.page-hero { padding: var(--sp-6) 0 var(--sp-3); text-align: center; }
.page-hero h1 { font-size: clamp(28px, 4vw, 42px); }
.page-body { padding-bottom: var(--sp-7); }

/* ============ ARCHIVE / BLOG ============ */
.archive-hero { padding: var(--sp-6) 0 var(--sp-4); text-align: center; background: linear-gradient(180deg, rgba(46,125,116,.06), transparent); }
.archive-hero h1 { font-size: clamp(28px, 4vw, 40px); }
.archive-hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.archive-list { padding: var(--sp-4) 0 var(--sp-7); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: var(--sp-5); }
.pagination .page-numbers { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; }
.pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

@media (max-width: 640px) {
  .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article-body table thead, .article-body table tbody { width: 100%; }
}

/* ============ MOTION ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}
