/* rich.css: site.css 위에 얹는 개선분 (2026-11-27, 고등어의 개인회생에서 처음 씀)
   1부 '도식 블록'은 :::steps 같은 새 문법을 쓸 때만 화면에 나타난다. 쓰지 않는 사이트의 화면은 바뀌지 않는다.
   2부 '글꼴·위계'는 모든 글의 모양을 바꾼다. 틀에 옮길 때 사이트별로 켤지 정한다.
   색은 site.css 의 --accent 계열과 아래 변수만 쓴다. */
:root {
  --accent-mid: #C9D8F4;  /* 빌드 때 theme.accentMid 로 바뀐다 */
  --hl: #FFE58A;          /* 형광펜 */
  --warn: #B45309;
  --warn-soft: #FFF6E5;
  --tip: #047857;
  --tip-soft: #E8F7F0;
  --note-soft: #F4F5F7;
  --radius: 16px;
}

/* =========================================================== 1부: 도식 블록 */
.rich { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 6px; }
.rich-title { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink) !important; }
.rich-note { font-size: 13px; line-height: 1.65; color: var(--muted) !important; }
.rich-note a { color: var(--muted); }
mark.hl { padding: 0 2px; border-radius: 3px; background: var(--hl); color: inherit; }

/* 절차 흐름 :::steps */
.steps { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-direction: column; gap: 0 !important; counter-reset: none; }
.step { position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--accent-soft); }
.step:last-child::before { display: none; }
.step-no { flex: 0 0 36px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 5px var(--bg); }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 5px; }
.step-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink) !important; }
.step-when { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.step-text { font-size: 15px; line-height: 1.7; color: var(--fg); }

/* 시간 띠 :::timeline */
.timeline { list-style: none; margin: 0; padding: 0 !important; display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 0 !important; border-top: 3px solid var(--accent); }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px 4px 0; }
.timeline li::before { content: ""; position: absolute; left: 0; top: -9px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.tl-when { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); }
.tl-what { font-size: 14px; line-height: 1.6; color: var(--fg); }

/* 비교표 :::compare */
.table-wrap--compare { border-radius: var(--radius); }
table.compare thead th { background: var(--ink); color: #ffffff; font-size: 14px; }
table.compare thead th.is-focus { background: var(--accent); }
table.compare tbody th { width: 1%; white-space: nowrap; font-size: 14px; color: var(--ink); background: var(--soft); }
table.compare td.is-focus { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
table.compare td { line-height: 1.6; }

/* 숫자 카드 :::stat */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-radius: var(--radius); background: var(--accent-soft); }
.stat-val { font-size: 26px; font-weight: 800; line-height: 1.25; letter-spacing: -0.035em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.stat-sub { font-size: 12px; line-height: 1.5; letter-spacing: 0; color: var(--muted); }

/* 계산식 :::formula */
.formula { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.fx { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fx-box { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--soft); }
.fx-name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.fx-sub { font-size: 12px; letter-spacing: 0; color: var(--muted); }
.fx-box--result { background: var(--accent); }
.fx-box--result .fx-name, .fx-box--result .fx-sub { color: var(--accent-ink); }
.fx-op { font-size: 22px; font-weight: 700; color: var(--muted); }

/* 자주 묻는 질문 :::qa */
.qa-list { gap: 8px; }
.qa { border: 1px solid var(--line); border-radius: 14px; }
.qa summary { position: relative; display: flex; align-items: center; min-height: 52px; padding: 12px 48px 12px 18px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: "Q"; flex: 0 0 auto; margin-right: 10px; font-weight: 800; color: var(--accent); }
.qa summary::after { content: "+"; position: absolute; right: 18px; font-size: 20px; font-weight: 400; color: var(--muted); }
.qa[open] summary::after { content: "−"; }
.qa p { padding: 0 18px 16px 40px; font-size: 15px; }

/* 강조 상자 :::key :::warn :::tip :::note */
.callout { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; padding: 18px 20px 18px; border-left: 4px solid var(--accent); border-radius: 4px var(--radius) var(--radius) 4px; background: var(--accent-soft); }
.callout-head { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink) !important; }
.callout-icon { flex: 0 0 auto; color: var(--accent); }
.callout-body { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.callout-body p { color: var(--fg); }
.callout--warn { border-color: var(--warn); background: var(--warn-soft); }
.callout--warn .callout-icon { color: var(--warn); }
.callout--tip { border-color: var(--tip); background: var(--tip-soft); }
.callout--tip .callout-icon { color: var(--tip); }
.callout--note { border-color: #9aa1ab; background: var(--note-soft); }
.callout--note .callout-icon { color: #6b7280; }

/* 사진 :::photo */
.prose figure.photo img { border-radius: var(--radius); aspect-ratio: 16 / 10; object-fit: cover; background: var(--soft); }

/* 홈: 절차 흐름, 읽는 순서, 숫자 */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; counter-reset: none; }
.flow-step a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.flow-step a:hover { border-color: var(--accent); transform: translateY(-2px); }
.flow-no { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.flow-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.flow-text { font-size: 13px; line-height: 1.6; color: var(--fg); }
.flow-when { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
.path { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.path-row { display: flex; align-items: flex-start; gap: 18px; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.path-row:hover .path-title { color: var(--accent); }
.path-no { flex: 0 0 auto; font-size: 22px; font-weight: 800; line-height: 1.3; letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.path-text { display: flex; flex-direction: column; gap: 2px; }
.path-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.path-sum { font-size: 14px; color: var(--muted); }
.stats--home .stat-val { font-size: 24px; }
.btn-ghost--lg { min-height: 54px; padding: 0 22px; border-radius: 14px; font-size: 16px; }
.topic-badge { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--cat-tint); color: var(--cat-fg); }
.topic-badge .topic-icon { color: var(--cat-fg); }
.topic-desc { margin: 4px 0 6px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.brand-mark img { display: block; width: 30px; height: 30px; border-radius: 8px; }
.brand-mark { background: none; }

/* =========================================================== 2부: 글꼴·위계 */
body { font-size: 16.5px; }
.prose { gap: 16px; counter-reset: h2; }
.prose > p, .prose li { font-size: 17px; line-height: 1.85; }
.prose h2 { position: relative; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 25px; font-weight: 800; letter-spacing: -0.035em; }
.prose h2::before { counter-increment: h2; content: counter(h2, decimal-leading-zero); display: block; margin-bottom: 6px; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; color: var(--accent); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 12px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.prose strong { color: var(--ink); font-weight: 800; background: linear-gradient(transparent 62%, var(--accent-mid) 62%); }
.prose blockquote { position: relative; margin: 6px 0; padding: 40px 22px 18px; border-radius: var(--radius); background: var(--soft); }
.prose blockquote::before { content: "꾸민 예시"; position: absolute; top: 14px; left: 22px; font-size: 12px; font-weight: 800; letter-spacing: 0; color: var(--muted); }
.prose blockquote p { font-size: 16px; line-height: 1.8; color: var(--ink); }
.prose table tbody tr:nth-child(even) td { background: #fafbfc; }
.prose table td strong { background: none; color: var(--accent); }
.article h1 { font-size: 38px; letter-spacing: -0.04em; }
.article-cat { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--cat-fg, var(--accent)); }
.dot-cat { width: 8px; height: 8px; border-radius: 50%; background: var(--cat-fg, var(--accent)); }
.answer { position: relative; padding: 26px 28px; border: 2px solid var(--accent); background: var(--bg); }
.answer h2 { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.answer p { font-size: 19px; font-weight: 600; line-height: 1.7; }
.answer-icon { color: var(--accent); }
.hero h1 { font-size: 44px; letter-spacing: -0.045em; }
.hero h1 mark { color: var(--accent); background: linear-gradient(transparent 70%, var(--hl) 70%); }
.hero-img { flex: 0 1 320px; width: 320px; }
.block h2, .block-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.foot { align-items: flex-start; }
.foot-copy { font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .prose > p, .prose li { font-size: 16.5px; }
  .prose h2 { font-size: 22px; margin-top: 36px; padding-top: 18px; }
  .article h1 { font-size: 29px; }
  .hero h1 { font-size: 31px; }
  .answer { padding: 20px; }
  .answer p { font-size: 17.5px; }
  .stat-val { font-size: 23px; }
  .fx { gap: 8px; }
  .fx-box { flex: 1 1 auto; padding: 10px 12px; }
  .fx-op { font-size: 18px; }
  .flow { display: flex; overflow-x: auto; margin: 0 -20px; padding: 0 20px 8px; scroll-snap-type: x mandatory; }
  .flow-step { flex: 0 0 160px; scroll-snap-align: start; }
  .timeline { grid-template-columns: 1fr; border-top: 0; border-left: 3px solid var(--accent); padding-left: 18px !important; }
  .timeline li { padding: 0 0 18px; }
  .timeline li::before { left: -28px; top: 2px; }
  table.compare tbody th { white-space: normal; min-width: 76px; }
  .callout { padding: 16px; }
}
@media print {
  .callout, .stat, .formula { break-inside: avoid; }
}

/* 광고책임 변호사 표기 (변호사 광고) */
.sponsor-top { flex-wrap: wrap; }
.sponsor-resp { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
