/* =====================================================================
   크래빗 아카데미 - 인사이트/자료 아티클 표준 레이아웃 (2026-09 확정 예정)

   원칙: 흰 배경에 글이 주인공. 회색 배경 위 흰 카드, 그림자, 테두리 상자를 쓰지 않는다.
   쓰는 도구는 네 가지뿐입니다.
     1) 헤더: .a-label(작은 핑크 라벨) + h2, 필요하면 h3
     2) 토글: <details class="a-toggle"> 자세한 설명을 접어 두는 곳
     3) 콜아웃: .a-callout(연회색), .a-callout.pink(연핑크) 요약, 할 일, 안내
     4) 표: .a-table 선만 얇게
   오른쪽 목차(.toc)는 넓은 화면(1160px 이상)에서만 보입니다.
   왼쪽 색 막대, 테두리 태그, 카드 테두리는 금지(크래빗 디자인 규칙).
   ===================================================================== */
:root {
  --bg: #FFFFFF;
  --soft: #F9FAFC;
  --ink: #16192A;
  --muted: rgba(22, 25, 42, 0.55);
  --faint: rgba(22, 25, 42, 0.32);
  --line: #E8E8E8;
  --pink: #FB75BB;
  --tint: #FEF1F8;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.75; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word;
}
.a-wrap { max-width: 700px; margin: 0 auto; padding: 0 22px; }

/* ---------- 상단 헤더(사이트 공통 인라인 헤더 위에 배경만 흰색으로) ---------- */
header.a-top { position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid #F0F0F2; }

/* ---------- 머리말 ---------- */
.a-hero { padding: 36px 0 8px; }
.a-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; background: var(--soft); margin: 0 0 32px; }
.a-eyebrow { display: inline-block; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: var(--pink); margin-bottom: 10px; }
.a-hero h1 {
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  margin: 0 0 16px; font-size: clamp(28px, 5.8vw, 38px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; text-wrap: balance;
}
.a-date { margin: -6px 0 18px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-lead { margin: 0 0 8px; font-size: 17.5px; color: var(--ink); text-wrap: pretty; }
.a-lead strong { font-weight: 700; }
.a-meta { font-size: 14px; color: var(--muted); margin: 14px 0 0; }

/* ---------- 본문 섹션 ---------- */
.a-sec { padding-top: 44px; scroll-margin-top: 84px; }
.a-sec + .a-sec { border-top: 1px solid #F0F0F2; margin-top: 44px; }
.a-label { display: block; font-size: 13.5px; font-weight: 700; color: var(--pink); margin-bottom: 6px; }
.a-sec h2 {
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  margin: 0 0 12px; font-size: 25px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35;
}
.a-sec h3 { margin: 28px 0 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.a-sec p { margin: 0 0 14px; font-size: 16.5px; }
.a-sec p.a-intro { color: var(--ink); margin-bottom: 20px; }
.a-note { font-size: 14px !important; color: var(--muted); margin-top: 10px !important; }
.a-sec ul.a-list { margin: 0 0 14px; padding-left: 20px; }
.a-sec ul.a-list li { font-size: 16.5px; margin-bottom: 8px; }

/* ---------- 토글 ---------- */
.a-toggles { border-top: 1px solid var(--line); }
.a-toggle { border-bottom: 1px solid var(--line); }
.a-toggle > summary {
  list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 4px; font-size: 17px; font-weight: 700; line-height: 1.5;
}
.a-toggle > summary::-webkit-details-marker { display: none; }
.a-toggle > summary .n { flex: none; min-width: 22px; color: var(--pink); }
.a-toggle > summary .t { flex: 1; }
.a-toggle > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin: 8px 4px 0 0;
  border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform 0.15s;
}
.a-toggle[open] > summary::after { transform: rotate(-135deg); margin-top: 12px; }
.a-toggle > summary:hover .t { color: #000; }
.a-toggle .a-body { padding: 0 4px 18px 38px; }
.a-toggle .a-body p { font-size: 16px; margin: 0 0 10px; color: var(--ink); }
.a-toggle .a-body p:last-child { margin-bottom: 0; }
.a-toggle-all { display: inline-block; margin: 0 0 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.a-toggle-all:hover { color: var(--ink); }

/* ---------- 콜아웃 ---------- */
.a-callout { background: var(--soft); border-radius: 14px; padding: 18px 22px; margin: 22px 0 0; }
.a-callout.pink { background: var(--tint); }
.a-callout .c-h { display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.a-callout p { font-size: 16px !important; margin: 0 0 12px !important; }
.a-callout p:last-child { margin-bottom: 0 !important; }
.a-check { list-style: none; margin: 0; padding: 0; }
.a-check li { font-size: 16px; margin-bottom: 8px; }
.a-check li:last-child { margin-bottom: 0; }
/* 누르면 체크되는 할 일 */
.a-check label { position: relative; display: block; padding-left: 30px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.a-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a-check label::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 5px;
  background: var(--bg); box-shadow: inset 0 0 0 1.5px rgba(22, 25, 42, 0.28); transition: background 0.12s, box-shadow 0.12s;
}
.a-check label::after {
  content: ""; position: absolute; left: 6.5px; top: 7px; width: 5px; height: 10px;
  border-right: 2.2px solid #fff; border-bottom: 2.2px solid #fff; transform: rotate(45deg); opacity: 0;
}
.a-check label:has(input:checked)::before { background: var(--pink); box-shadow: none; }
.a-check label:has(input:checked)::after { opacity: 1; }
.a-check label:has(input:checked) span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(22, 25, 42, 0.3); }
.a-check input:focus-visible + span { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 4px; }
.a-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; text-decoration: none;
  background: var(--ink); color: #fff !important; padding: 12px 22px; border-radius: 12px; font-size: 15.5px; font-weight: 700;
}
.a-btn:hover { background: #333333; }
.a-btn .arw { color: var(--pink); }

/* ---------- 표 ---------- */
.a-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 4px 0 0; }
.a-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.a-table th, .a-table td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.a-table thead th { font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.a-table td.num { font-weight: 700; color: var(--pink); width: 44px; }
.a-table td.num a { color: inherit; text-decoration: none; }
.a-table .nowrap { white-space: nowrap; }

/* ---------- 오른쪽 목차 ---------- */
/* 본문 글 오른쪽 끝(50% + 328px)에서 약 60px 띄운다 */
.toc { position: fixed; top: 110px; left: calc(50% + 390px); z-index: 15; display: none; max-width: 210px; }
@media (min-width: 1220px) { .toc { display: block; } }
.toc .toc-h { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; color: rgba(22, 25, 42, 0.4); margin: 0 0 14px 17px; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 17px; display: flex; flex-direction: column; gap: 13px; border-left: 1.5px solid var(--line); }
.toc a { font-size: 14.5px; line-height: 1.4; font-weight: 500; color: rgba(22, 25, 42, 0.45); text-decoration: none; display: block; position: relative; transition: color 0.15s; }
.toc a:hover { color: rgba(22, 25, 42, 0.62); }
.toc a.active { color: var(--pink); font-weight: 700; }
.toc a.active::before { content: ""; position: absolute; left: -18px; top: 3px; width: 2px; height: 16px; background: var(--pink); }

/* ---------- 푸터 ---------- */
footer.a-foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 30px 0 44px; font-size: 13.5px; color: var(--muted); }
footer.a-foot .f-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
footer.a-foot .f-top img { height: 22px; display: block; }
footer.a-foot .f-top a { font-size: 14.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
footer.a-foot p { margin: 0 0 4px; }
footer.a-foot a { color: inherit; }

@media (max-width: 640px) {
  .a-hero { padding-top: 22px; }
  .a-thumb { border-radius: 12px; margin-bottom: 24px; }
  .a-lead { font-size: 16px; text-wrap: wrap; }
  .a-sec { padding-top: 34px; }
  .a-sec + .a-sec { margin-top: 34px; }
  .a-sec h2 { font-size: 22px; }
  .a-sec p, .a-sec ul.a-list li { font-size: 15.5px; }
  .a-toggle > summary { font-size: 16px; padding: 14px 2px; }
  .a-toggle .a-body { padding-left: 34px; }
  .a-toggle .a-body p, .a-callout p, .a-check li { font-size: 15px !important; }
  .a-callout { padding: 16px 18px; }
  /* 표는 좁은 화면에서 칸이 찌그러지니, 한 행을 두 줄 묶음으로 바꾼다
     (1줄: 번호, 원생 수, 전국 위치 / 2줄: 숙제 한 줄) */
  .a-table-wrap { overflow: visible; }
  .a-table, .a-table tbody { display: block; }
  .a-table thead { display: none; }
  .a-table tbody { border-top: 1.5px solid var(--ink); }
  .a-table tr { display: grid; grid-template-columns: 22px auto 1fr; column-gap: 10px; row-gap: 3px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .a-table th, .a-table td { padding: 0; border: 0; }
  .a-table td.num { grid-row: 1 / 3; width: auto; font-size: 15.5px; }
  .a-table td:nth-child(2) { font-size: 15px; font-weight: 700; }
  .a-table td:nth-child(3) { font-size: 13.5px; color: var(--muted); align-self: center; }
  .a-table td:nth-child(4) { grid-column: 2 / 4; font-size: 15px; line-height: 1.55; }
}
/* 제목과 토글 제목의 마지막 단어가 혼자 떨어지지 않게 */
.a-sec h2, .a-sec h3 { text-wrap: balance; }
.a-toggle > summary .t { text-wrap: pretty; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
/* 구간 표: 구간 설명(회색 한 줄) 아래 숙제 */
.a-table .t-desc { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-bottom: 3px; }
