/* =========================================================
   해결 사례 전용 컴포넌트 (style.css → areas.css 다음에 불러옵니다)
   README 12.4 · 12.5 기준. 모든 규칙은 .case-detail 안에서만 적용 (D-23)
   토큰은 style.css :root 변수만 사용 — 새 색·새 서체·새 브레이크포인트·important 선언 금지

   목차
   1. case-detail          본문 열(760px), 머리(분야 칩·H1·사건 정보), 본문 섹션·h2·문단
   2. case-em              밑줄 강조
   3. case-result          처분 결과 박스
   4. case-notice          결과 비보장 고지 (표 아래 작은 글씨에도 사용)
   5. case-toc             목차
   6. case-lead            도입문
   7. case-stats           숫자 카드
   8. case-box             개념 박스
   9. case-steps           대응 단계
   10. case-table          표
   11. case-checklist      체크리스트
   12. case-faq            FAQ (<details>)
   13. case-summary        간단 요약 (#summary)
   14. case-reasons        든솔을 선택해야 할 이유
   15. case-list           허브·분야별 목록의 사례 카드 목록 (.grid-3 + .crosslink--card 재사용)
   ========================================================= */

/* ---------- 1. case-detail: 본문 열과 머리 ---------- */
/* 본문 열: 폭 최대 760px 가운데 */
.case-detail { max-width: calc(760px + var(--gutter) * 2); margin: 0 auto; padding: 56px var(--gutter) var(--section-y); }
.case-detail .breadcrumb + .chip { margin-top: 16px; }

/* 머리: 분야 칩 → H1 → 사건 정보 줄 */
.case-detail__head { margin-top: 24px; }
.case-detail__title { margin-top: 16px; font-family: var(--font-title); font-weight: 700; font-size: 36px; line-height: 1.4; color: var(--c-title); }
.case-detail__meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 20px; font-size: 15px; }
.case-detail__meta div { display: flex; gap: 8px; }
.case-detail__meta dt { color: var(--c-muted); }
.case-detail__meta dd { color: var(--c-title); font-weight: 700; }

/* 본문 섹션: h2와 문단 */
.case-detail__section > h2,
.case-reasons > h2 { margin: 64px 0 24px; padding-bottom: 12px; border-bottom: 2px solid var(--c-title); font-family: var(--font-title); font-weight: 700; font-size: 28px; line-height: 1.4; color: var(--c-title); }
.case-detail__section > p { margin-bottom: 28px; font-size: 17px; line-height: 1.85; }
.case-detail__section a { color: var(--c-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 2. case-em: 밑줄 강조 (결과·핵심 개념·행동 문구에만, 페이지당 8회 이내) ---------- */
.case-detail .case-em {
  font-weight: 600; color: var(--c-title);
  text-decoration-line: underline; text-decoration-color: var(--c-accent); /* accent는 밑줄(장식)에만 */
  text-decoration-thickness: .12em; text-underline-offset: .18em;
  text-decoration-skip-ink: none; /* 한글 받침에서 밑줄이 끊기지 않게 */
  word-break: keep-all;
}

/* ---------- 3. case-result: 처분 결과 박스 ---------- */
.case-result { margin-top: 32px; padding: 28px 32px; background: var(--c-bg-alt); border-top: 3px solid var(--c-primary); border-radius: var(--radius-sm); }
.case-result dt { font-size: 13px; font-weight: 700; color: var(--c-primary); }
.case-result dd { margin-top: 8px; font-size: 19px; font-weight: 600; line-height: 1.6; color: var(--c-title); }

/* ---------- 4. case-notice: 결과 비보장 고지 ---------- */
.case-notice { margin-top: 12px; font-size: 14px; color: var(--c-muted); }

/* ---------- 5. case-toc: 목차 (첫 줄은 간단 요약 바로가기) ---------- */
.case-toc { margin: 32px 0 56px; padding: 24px 28px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); }
.case-toc li + li { border-top: 1px solid var(--c-line); }
.case-toc a { display: flex; align-items: center; min-height: 44px; padding: 6px 0; font-size: 15px; }
.case-toc a:hover { color: var(--c-primary); }
.case-toc li:first-child a { font-weight: 700; color: var(--c-primary); }

/* ---------- 6. case-lead: 도입문 ---------- */
.case-detail .case-lead { margin-bottom: 32px; font-size: 19px; line-height: 2; }

/* ---------- 7. case-stats: 숫자 카드 (3개 이하) ---------- */
.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; }
.case-stats__item { display: flex; flex-direction: column; align-items: center; padding: 28px 20px; border-top: 1px solid var(--c-title); text-align: center; }
.case-stats__item strong { font-family: var(--font-title); font-size: 28px; font-weight: 700; line-height: 1.3; color: var(--c-title); }
.case-stats__item span { margin-top: 6px; font-size: 13px; color: var(--c-muted); }

/* ---------- 8. case-box: 개념 박스 (2개 이하) ---------- */
.case-box { margin: 32px 0; padding: 28px 32px; background: var(--c-bg-alt); border-radius: var(--radius-sm); }
.case-box > p:first-child { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.case-box > h3 { margin-top: 4px; font-size: 17px; font-weight: 700; color: var(--c-title); }
.case-box > h3 + p { margin-top: 10px; font-size: 15px; line-height: 1.8; color: var(--c-muted); }
.case-box a { color: var(--c-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 9. case-steps: 대응 단계 (번호 | 내용) ---------- */
.case-steps { margin: 32px 0; counter-reset: case-step; }
.case-steps__item { display: grid; grid-template-columns: 56px 1fr; column-gap: 16px; padding: 20px 0; counter-increment: case-step; }
.case-steps__item + .case-steps__item { border-top: 1px solid var(--c-line); }
.case-steps__item::before { content: counter(case-step); grid-row: 1 / 3; font-family: var(--font-title); font-size: 36px; font-weight: 700; line-height: 1; color: var(--c-primary); }
.case-steps__item h3 { font-size: 17px; font-weight: 700; color: var(--c-title); }
.case-steps__item p { margin-top: 4px; font-size: 16px; }

/* ---------- 10. case-table: 표 (래퍼가 테두리·가로 스크롤 담당) ---------- */
.case-table { margin: 32px 0 0; overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius-sm); }
.case-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.case-table th, .case-table td { padding: 14px 20px; text-align: left; white-space: nowrap; }
.case-table th { background: var(--c-bg-alt); font-size: 13px; font-weight: 700; color: var(--c-title); }
.case-table td { border-top: 1px solid var(--c-line); }
.case-table__row--hi td { background: var(--c-bg-alt); font-weight: 700; color: var(--c-title); }
.case-table + .case-notice { margin-bottom: 32px; }

/* ---------- 11. case-checklist: 체크리스트 (1개, 항목 3~4개) ---------- */
.case-checklist { margin: 32px 0; }
.case-checklist > h3 { font-size: 17px; font-weight: 700; color: var(--c-title); }
.case-checklist li { position: relative; padding: 14px 0 14px 36px; border-bottom: 1px solid var(--c-line); font-size: 16px; }
.case-checklist li::before { content: ""; position: absolute; left: 0; top: 17px; width: 22px; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F5D4A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 20px no-repeat; } /* 기존 라인 아이콘 스타일, --c-primary */
.case-checklist strong { color: var(--c-title); }
.case-checklist > h3 + ul { margin-top: 8px; }

/* ---------- 12. case-faq: FAQ (<details>, 3개 이하, JS 없음) ---------- */
.case-faq { margin: 48px 0 0; }
.case-faq > h3 { margin-bottom: 8px; font-size: 17px; font-weight: 700; color: var(--c-title); }
.case-faq__item { border-top: 1px solid var(--c-line); }
.case-faq__item:last-child { border-bottom: 1px solid var(--c-line); }
.case-faq__item summary { position: relative; display: flex; align-items: center; min-height: 44px; padding: 24px 40px 24px 0; list-style: none; cursor: pointer; font-size: 17px; font-weight: 800; line-height: 1.5; color: var(--c-title); }
.case-faq__item summary::-webkit-details-marker { display: none; }
.case-faq__item summary::after { content: "+"; position: absolute; right: 8px; font-size: 24px; font-weight: 400; color: var(--c-primary); }
.case-faq__item[open] summary::after { content: "−"; }
.case-faq__item p { padding-bottom: 24px; font-size: 16px; line-height: 1.9; color: var(--c-muted); }

/* ---------- 13. case-summary: 간단 요약 (진한 그린 박스) ---------- */
.case-summary { margin-top: 64px; padding: 40px; background: var(--c-title); border-radius: var(--radius-lg); color: var(--c-bg); }
.case-summary > h2 { font-family: var(--font-title); font-size: 24px; font-weight: 700; line-height: 1.4; }
.case-summary dl { display: grid; gap: 16px; margin-top: 24px; }
.case-summary dl div { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 16px; }
.case-summary dd { font-size: 17px; line-height: 1.7; }

/* ---------- 14. case-reasons: 든솔을 선택해야 할 이유 (카드 3개) ---------- */
.case-reasons ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: case-reason; }
.case-reasons .card { padding: 28px 24px; counter-increment: case-reason; }
.case-reasons .card::before { content: "0" counter(case-reason); font-family: var(--font-title); font-size: 18px; font-weight: 700; line-height: 1; color: var(--c-primary); }
.case-reasons h3 { margin-top: 14px; font-family: var(--font-title); font-size: 19px; font-weight: 700; line-height: 1.4; color: var(--c-title); }
.case-reasons h3 + p { margin-top: 8px; font-size: 16px; }

/* ---------- 15. case-list: 허브·목록 페이지 사례 카드 (.case-detail 밖에서 사용) ---------- */
/* 목록 ul은 .crosslink-list(최대 1040px, 간격), 카드는 .card.crosslink.crosslink--card를 재사용 */
/* 2열, 카드가 적을 때는 가운데 정렬 — 빈 칸이 남지 않게 (README 13장 DR-04) */
.case-list { display: flex; flex-wrap: wrap; justify-content: center; }
.case-list > li { flex: 0 1 calc(50% - 16px); }
/* 사례 카드의 처분 결과 줄은 본문색·600으로 낮춤 — 굵은 초록은 한 줄 카피에만 (README 13장 DR-08) */
.case-list .crosslink__lead { font-weight: 600; color: var(--c-text); }
/* 카드 전체 클릭: '사례 자세히 보기' 링크의 클릭 영역을 카드 전체로 확장 */
.case-list .crosslink--card { position: relative; cursor: pointer; }
.case-list .link-more::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.case-list .crosslink--card:hover .link-more { text-decoration: underline; text-underline-offset: 4px; }
.case-list .chips + .crosslink__name { margin-top: 14px; }
.case-list__date { margin-top: 8px; font-size: 14px; color: var(--c-muted); }
.case-list + .btn-group { margin-top: 40px; } /* 허브 '더 보기' */
.case-list:first-child { margin-top: 0; } /* 목록 페이지: 섹션 제목 없이 바로 카드 */
.case-list ~ .case-notice { text-align: center; }
.case-list ~ .btn-group + .case-notice { margin-top: 32px; } /* 허브: '더 보기' 아래 고지 */
/* 허브: 분야별 사례 1건씩 PC에서 3열 가로 배치 (태블릿은 기본 2열, 모바일 1열) */
@media (min-width: 1201px) {
  .case-list--row { max-width: none; }
  .case-list--row > li { flex: 1 1 0; }
}
.case-list--row ~ .case-notice { margin-top: 32px; }
.page-hero .breadcrumb + .chip { margin-top: 16px; } /* 상단 '샘플 콘텐츠' 표시 */

/* =========================================================
   Tablet (≤1200px) — 본문 열이 760px이라 별도 조정 없음
   ========================================================= */

/* =========================================================
   Mobile (≤767px)
   ========================================================= */
@media (max-width: 767px) {
  .case-detail { padding-top: 32px; }
  .case-detail__title { font-size: 28px; }
  .case-detail__meta { flex-direction: column; font-size: 14px; }

  .case-detail__section > h2,
  .case-reasons > h2 { margin-top: 48px; font-size: 24px; }
  .case-detail__section > p { margin-bottom: 24px; font-size: 16px; line-height: 1.8; }

  .case-result { padding: 22px 20px; }
  .case-detail .case-lead { font-size: 17px; }
  .case-toc { margin-bottom: 40px; padding: 16px 20px; }

  .case-stats { gap: 8px; } /* 3열 유지, 숫자만 축소 (README 13장 DR-10, 12.5 변경) */
  .case-stats__item { padding: 18px 4px; }
  .case-stats__item strong { font-size: 20px; text-wrap: balance; } /* '1억 5천만 원'에서 '원'만 남지 않게 */
  .case-stats__item span { font-size: 12px; }
  .case-box { padding: 24px 20px; }
  .case-steps__item { grid-template-columns: 44px 1fr; column-gap: 12px; }
  .case-table table { min-width: 480px; } /* 좁은 화면은 가로 스크롤 */
  .case-table th, .case-table td { padding: 12px 16px; }

  .case-summary { margin-top: 48px; padding: 28px 22px; }
  .case-summary dl div { grid-template-columns: 1fr; gap: 8px; }
  .case-summary .chip { justify-self: start; }
  .case-summary dd { font-size: 16px; }

  .case-reasons ol { grid-template-columns: 1fr; }

  .case-list > li { flex-basis: 100%; }
  .case-list ~ .case-notice { text-align: left; }
}
