/* 법률 인사이트 — 매거진 스타일
 * 참조: blog.ehyun.co.kr (header dark) + blog.sugar-legal (clean grid) + ehyun-detail (TOC)
 */

:root {
  --c-bg:         #FAFAF8;
  --c-card:       #FFFFFF;
  --c-text:       #1A1A1A;
  --c-sub:        #5A5A5A;
  --c-muted:      #8C8C8C;
  --c-line:       #E5E3DE;
  --c-header:     #2A1F2D;
  --c-header-fg:  #F5F1E8;
  --c-accent:     #B8826B;
  --c-tag-news:   #C94B4B;
  --c-tag-compare:#2D6A8F;
  --c-tag-faq:    #6B8E4E;
  --c-tag-weekly: #8B6BAC;
  --maxw:         1180px;
  --maxw-read:    720px;
  --font:         "Pretendard","Pretendard JP","-apple-system",BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* ─── 헤더 ─── */
.site-header {
  background: var(--c-header);
  color: var(--c-header-fg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
}
.brand-sub { color: rgba(245,241,232,0.55); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; }
.nav-list {
  display: flex; gap: 4px; list-style: none; margin: 0; padding: 0;
  flex-wrap: wrap;
}
.nav-list a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  color: rgba(245,241,232,0.78);
  transition: background 0.15s, color 0.15s;
}
.nav-list a:hover { background: rgba(255,255,255,0.08); color: var(--c-header-fg); }
.nav-list a.is-active { background: var(--c-accent); color: #fff; }

/* ─── Hero (메인 첫 카드) ─── */
.hero {
  max-width: var(--maxw);
  margin: 32px auto 0;
  padding: 0 24px;
}
.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.06); }
.hero-thumb { background: #EEE; aspect-ratio: 16/10; object-fit: cover; width: 100%; height: 100%; }
.hero-body { padding: 36px 36px 36px 0; display: flex; flex-direction: column; justify-content: center; }
.hero-tag { display: inline-block; margin-bottom: 12px; }
.hero-title { font-size: 28px; line-height: 1.35; margin: 0 0 14px; font-weight: 700; letter-spacing: -0.025em; }
.hero-desc { font-size: 15px; line-height: 1.7; color: var(--c-sub); margin: 0 0 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { font-size: 13px; color: var(--c-muted); }

/* ─── 카드 그리드 ─── */
.grid-wrap { max-width: var(--maxw); margin: 40px auto; padding: 0 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 20px; }
.section-title { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.section-meta  { font-size: 13px; color: var(--c-muted); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.06); }
.card-thumb { aspect-ratio: 16/10; object-fit: cover; background: #EEE; width: 100%; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card-tag { margin-bottom: 10px; }
.card-title { font-size: 17px; line-height: 1.45; margin: 0 0 10px; font-weight: 700; letter-spacing: -0.02em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc { font-size: 13.5px; color: var(--c-sub); margin: 0 0 14px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 12px; color: var(--c-muted); margin-top: auto; }

/* ─── 태그 ─── */
.tag {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  color: #fff;
}
.tag-news    { background: var(--c-tag-news); }
.tag-compare { background: var(--c-tag-compare); }
.tag-faq     { background: var(--c-tag-faq); }
.tag-weekly  { background: var(--c-tag-weekly); }

/* ─── 상세 페이지 ─── */
.post-wrap {
  max-width: var(--maxw);
  margin: 32px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 48px;
  align-items: start;
}
.post-toc {
  position: sticky;
  top: 32px;
  font-size: 13.5px;
  border-left: 2px solid var(--c-line);
  padding-left: 16px;
}
.post-toc-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--c-muted); margin: 0 0 12px;
}
.post-toc ul { list-style: none; padding: 0; margin: 0; }
.post-toc li { margin: 8px 0; line-height: 1.5; }
.post-toc a {
  color: var(--c-sub);
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  margin-left: -18px; padding-left: 16px;
  transition: color 0.15s, border-color 0.15s;
}
.post-toc a:hover, .post-toc a.is-active { color: var(--c-accent); border-left-color: var(--c-accent); }

.post-main { min-width: 0; }
.post-header { margin-bottom: 32px; }
.post-header .tag { margin-bottom: 16px; }
.post-title {
  font-size: 32px; line-height: 1.3;
  margin: 0 0 18px; font-weight: 800; letter-spacing: -0.03em;
}
.post-summary {
  font-size: 16px; line-height: 1.75; color: var(--c-sub);
  margin: 0 0 20px;
  padding-left: 16px;
  border-left: 3px solid var(--c-accent);
}
.post-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--c-muted);
}
.post-hero-img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: 10px; margin-bottom: 32px; background: #EEE;
}

/* 본문 콘텐츠 */
.post-content {
  font-size: 16.5px; line-height: 1.85;
  color: var(--c-text);
}
.post-content h1, .post-content h2, .post-content h3 {
  letter-spacing: -0.025em; line-height: 1.4;
}
.post-content h1 { display: none; }  /* 상세 페이지에서 h1은 별도 처리됨 */
.post-content h2 {
  font-size: 24px; margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-line);
}
.post-content h3 { font-size: 19px; margin: 32px 0 12px; }
.post-content p { margin: 14px 0; }
.post-content a { color: var(--c-accent); border-bottom: 1px solid currentColor; }
.post-content blockquote {
  margin: 20px 0; padding: 12px 18px;
  background: #F4F0EA;
  border-left: 3px solid var(--c-accent);
  font-size: 14.5px; color: var(--c-sub);
}
.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
  font-size: 14.5px;
}
.post-content table th, .post-content table td {
  border: 1px solid var(--c-line);
  padding: 10px 12px;
  text-align: left;
}
.post-content table th { background: #F4F0EA; font-weight: 600; }
.post-content ul, .post-content ol { padding-left: 22px; margin: 14px 0; }
.post-content li { margin: 6px 0; }
.post-content hr { border: none; border-top: 1px solid var(--c-line); margin: 36px 0; }

/* 사이드 (작성자/관련) */
.post-aside { position: sticky; top: 32px; }
.aside-box {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.aside-box-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--c-muted); margin: 0 0 14px;
}
.lawyer-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-line);
}
.lawyer-row:last-child { border-bottom: none; }
.lawyer-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.lawyer-info { flex: 1; min-width: 0; }
.lawyer-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.lawyer-link { font-size: 11.5px; color: var(--c-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lawyer-link a { color: var(--c-accent); border-bottom: 1px solid transparent; }
.lawyer-link a:hover { border-bottom-color: currentColor; }

.share-bar {
  display: flex; gap: 8px; margin-top: 8px;
  padding-top: 12px; border-top: 1px solid var(--c-line);
}
.share-btn {
  border: 1px solid var(--c-line);
  background: #FFF;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--c-sub);
  transition: border-color 0.15s, color 0.15s;
}
.share-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* ─── 관련 글 ─── */
.related {
  max-width: var(--maxw);
  margin: 0 auto 80px;
  padding: 0 24px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.related-card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 18px;
  transition: border-color 0.15s;
}
.related-card:hover { border-color: var(--c-accent); }
.related-card .tag { font-size: 10px; padding: 2px 8px; margin-bottom: 8px; }
.related-card .title { font-size: 14.5px; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ─── 푸터 ─── */
.site-footer {
  background: #1A1418;
  color: rgba(245,241,232,0.6);
  font-size: 13px;
  padding: 40px 24px 32px;
  margin-top: 60px;
}
.site-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.site-footer a { color: rgba(245,241,232,0.6); border-bottom: 1px solid transparent; }
.site-footer a:hover { border-bottom-color: currentColor; }
.disclaimer { font-size: 11.5px; color: rgba(245,241,232,0.4); line-height: 1.65; max-width: 600px; }
.footer-socials { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.footer-socials-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(245,241,232,0.45); margin-right: 4px; }
.footer-socials a {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid rgba(245,241,232,0.22); color: #F5F1E8;
  background: rgba(245,241,232,0.04); transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.footer-socials a svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.footer-socials a:hover { transform: translateY(-2px); color: #fff; }
.footer-socials a.s-instagram:hover { background: #E4405F; border-color: #E4405F; }
.footer-socials a.s-facebook:hover  { background: #1877F2; border-color: #1877F2; }
.footer-socials a.s-threads:hover   { background: #000;     border-color: #000; }
.footer-socials a.s-tiktok:hover    { background: #000;     border-color: #000; }
.footer-socials a.s-youtube:hover   { background: #FF0000; border-color: #FF0000; }
.footer-socials a.s-navercafe:hover { background: #03C75A; border-color: #03C75A; }

/* ─── 반응형 ─── */
@media (max-width: 980px) {
  .post-wrap { grid-template-columns: 1fr; }
  .post-toc, .post-aside { position: static; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-body { padding: 24px 24px 30px; }
  .hero-thumb { aspect-ratio: 16/10; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .site-header-inner { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .hero, .grid-wrap, .post-wrap, .related { padding: 0 16px; }
  .post-title { font-size: 25px; }
  .card-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 23px; }
}

/* ───── 신규 섹션: 자료실(/forms/) + 정보(/info/) ───── */
.tag-form { background: #3E7C8C; }
.tag-info { background: #9A6A3A; }
.res-card .card-body { padding: 18px; }

/* 양식 페이지: TOC 없이 단일 컬럼 중앙 */
.form-wrap { grid-template-columns: 1fr; max-width: 820px; }

/* 다운로드 / 출처 박스 */
.dl-box {
  border: 1px solid var(--c-line); border-radius: 10px;
  background: #FBF8F2; padding: 20px 22px; margin: 22px 0;
}
.dl-box-title { font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.dl-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-btn {
  display: inline-block; padding: 11px 18px; border-radius: 8px;
  font-size: 14.5px; font-weight: 600; text-decoration: none; transition: .15s;
}
.dl-primary { background: var(--c-accent); color: #fff; }
.dl-primary:hover { filter: brightness(0.93); }
.dl-secondary { background: #fff; color: var(--c-text); border: 1px solid var(--c-line); }
.dl-secondary:hover { border-color: var(--c-accent); color: var(--c-accent); }
.dl-note { font-size: 12.5px; color: var(--c-muted); margin: 12px 0 0; line-height: 1.6; }
.form-law {
  font-size: 13.5px; color: var(--c-sub); margin: 18px 0;
  padding: 12px 16px; background: #F4F1EA; border-radius: 8px;
}
.form-law strong { color: var(--c-text); }

/* 정보 페이지: 핵심 요약(GEO 인용성) */
.info-points {
  border-left: 3px solid var(--c-accent); background: #F8F4EC;
  padding: 14px 18px; margin: 18px 0; border-radius: 0 8px 8px 0;
}
.info-points-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--c-accent); }
.info-points ul { margin: 0; padding-left: 20px; }
.info-points li { font-size: 14.5px; line-height: 1.7; margin-bottom: 6px; }
