/* ==========================================================================
   AGPTEDU 전용 디자인 (2026-10 개편)
   - 색: 먹색 3단계 + 강조 파랑 하나. 그라데이션·글래스·그림자 없음
   - 구조: 카드 대신 1px 구분선과 여백, 둥근 모서리는 사진에만
   - 모바일 우선: 좌우 여백 20px, 본문 17px
   ========================================================================== */

:root {
  --ink: #16181d;
  --body: #33363d;
  --muted: #6b7079;
  --line: #e6e7ea;
  --soft: #f6f7f8;
  --accent: #0b5fd1;

  /* 공용 테마 변수를 같은 팔레트로 덮어씀 */
  --bg-base: #fff;
  --bg-surface: #fff;
  --bg-surface-glass: #fff;
  --bg-card: #fff;
  --border-color: var(--line);
  --text-main: var(--ink);
  --text-muted: var(--muted);
  --primary-color: var(--accent);
  --primary-hover: #094ca8;
  --primary-glow: transparent;
  --accent-color: var(--accent);
  --accent-glow: transparent;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --radius-sm: 6px;
  --radius-md: 6px;
  --radius-lg: 6px;
  --header-height: 56px;
  --font-sans: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

html, body { overflow-x: hidden; overflow-x: clip; max-width: 100vw; }
body { background: #fff; color: var(--body); padding-bottom: 0; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
a:hover { color: var(--accent); }
.glass { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.container { max-width: 1120px; padding-left: 20px; padding-right: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 헤더 · 분류 탭 ---------- */
.header { height: var(--header-height); background: #fff; border-bottom: 1px solid var(--line); }
@media (max-width: 1023px) { .header { position: relative; } }
.logo { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.search-link { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: -9px; color: var(--ink); }
.nav-cats .nav-link { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.nav-cats .nav-link.active, .nav-cats .nav-link:hover { color: var(--ink); }
.nav-cats .nav-link::after { background: var(--ink) !important; }
@media (min-width: 1024px) { .header-container { gap: 28px; } .nav-cats { margin-right: auto; } }

.cat-tabs { display: flex; gap: 18px; overflow-x: auto; padding: 0 20px; border-bottom: 1px solid var(--line); background: #fff; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a { flex: none; padding: 12px 0 10px; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.cat-tabs a.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }

/* ---------- 글 목록 (홈·분류·태그·관련 글) ---------- */
.sec-label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; margin: 28px 0 4px; }
.post-list { list-style: none; margin: 0; padding: 0; }
.pl-item { border-bottom: 1px solid var(--line); }
.pl-link { display: flex; gap: 14px; padding: 14px 0; color: inherit; }
.pl-text { flex: 1; min-width: 0; }
.pl-title { font-size: 16px; line-height: 1.45; font-weight: 600; color: var(--ink); margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-link:hover .pl-title { color: var(--accent); }
.pl-meta { font-size: 13px; color: var(--muted); margin: 0; }
.pl-meta b { color: var(--accent); font-weight: 600; }
.pl-thumb { width: 88px; height: 66px; object-fit: cover; border-radius: 4px; flex: none; background: var(--soft); }
@media (min-width: 768px) {
  .pl-title { font-size: 17px; }
  .pl-thumb { width: 132px; height: 88px; }
}

/* 홈 */
.home-lead { padding: 20px 0 4px; }
.home-lead a { display: block; color: inherit; }
.home-lead-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 6px; background: var(--soft); }
.home-lead .pl-meta { margin: 12px 0 4px; }
.home-lead-title { font-size: 20px; line-height: 1.4; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 6px; font-weight: 700; }
.home-lead a:hover .home-lead-title { color: var(--accent); }
.home-lead-sum { font-size: 15px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank-list li { counter-increment: r; display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.rank-list li::before { content: counter(r); font-weight: 800; color: var(--accent); width: 14px; flex: none; }
.rank-list a { color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home { padding-bottom: 24px; }
@media (min-width: 1024px) {
  .home-lead { display: block; max-width: 760px; padding-top: 32px; }
  .home-lead-title { font-size: 26px; }
  .home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
  .home-side { position: sticky; top: calc(var(--header-height) + 20px); }
}

/* 분류·태그 머리 */
.list-head { padding: 24px 0 4px; border-bottom: 1px solid var(--line); }
.list-head h1 { font-size: 22px; line-height: 1.35; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 6px; }
.list-head p { font-size: 14.5px; color: var(--muted); margin: 0 0 14px; }
.list-kicker { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.list-page { max-width: 800px; padding-bottom: 24px; }
.list-empty { padding: 60px 0; color: var(--muted); text-align: center; }

/* 페이지 번호 */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 32px 0; }
.pagination .page-btn { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--body); font-size: 15px; font-weight: 600; box-shadow: none; transform: none; }
.pagination .page-btn:hover { border-color: var(--ink); color: var(--ink); background: #fff; }
.pagination .page-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .page-ellipsis { padding: 0 4px; color: var(--muted); }

/* ---------- 글 페이지 ---------- */
.post-layout { padding: 0 0 40px; gap: 0; }
@media (min-width: 1024px) { .post-layout { grid-template-columns: minmax(0, 720px) 300px; justify-content: space-between; gap: 48px; } }
.post-header { margin: 0; padding: 20px 0 0; }
.post-crumb { font-size: 13px; color: var(--accent); font-weight: 600; }
.post-title { font-size: 24px; line-height: 1.38; letter-spacing: -0.025em; font-weight: 800; color: var(--ink); margin: 8px 0 10px; }
.post-byline { font-size: 13px; color: var(--muted); margin: 0; }
@media (min-width: 768px) { .post-title { font-size: 30px; } .post-byline { font-size: 14px; } }

/* 본문 맨 앞 요약 */
.post-body.post-lead { margin: 18px 0; }
.post-body.post-lead blockquote { margin: 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--ink); background: none; border-radius: 0; font-style: normal; color: var(--ink); }
.post-body.post-lead blockquote p { margin: 0 0 6px; font-size: 16px; line-height: 1.7; }
.post-body.post-lead blockquote p:last-child { margin-bottom: 0; }

.post-featured-wrapper { margin: 6px 0 18px; border: 0; border-radius: 0; box-shadow: none; background: none; }
.post-featured-image { width: 100% !important; height: auto !important; display: block; border-radius: 6px; box-shadow: none; margin: 0; background: var(--soft); }

/* 목차 (접힘) */
.post-toc { margin: 4px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-toc summary { padding: 12px 0; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.post-toc summary::-webkit-details-marker { display: none; }
.post-toc summary span { color: var(--muted); font-weight: 600; margin-right: auto; margin-left: 4px; }
.post-toc summary::after { content: "펼치기"; font-size: 13px; font-weight: 500; color: var(--muted); }
.post-toc[open] summary::after { content: "접기"; }
.post-toc .toc-list { padding: 0 0 12px; gap: 0; }
.post-toc .toc-item { font-size: 14.5px; line-height: 1.5; padding: 5px 0; }
.post-toc .toc-item.level-3 { padding-left: 14px; font-size: 14px; }
.post-toc .toc-link, .toc-desktop .toc-link { color: var(--body); border-left: 0; padding-left: 0; }
@media (min-width: 1024px) { .post-toc { display: none; } }
.toc-box { border: 0; border-radius: 0; padding: 0; background: none; }
.toc-desktop { margin-top: 24px; }
.toc-desktop .toc-title { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.toc-desktop .toc-item { font-size: 14px; line-height: 1.5; padding: 4px 0; }
.toc-desktop .toc-link.active { color: var(--accent); }

/* 본문 */
.post-body { font-size: 17px; line-height: 1.78; color: var(--body); }
.post-body p { margin: 0 0 18px; }
.post-body strong { color: var(--ink); }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.post-body h2 { font-size: 20px; line-height: 1.42; letter-spacing: -0.02em; font-weight: 800; color: var(--ink); margin: 40px 0 12px; padding: 0; border: 0; }
.post-body h3 { font-size: 18px; line-height: 1.45; font-weight: 700; color: var(--ink); margin: 28px 0 8px; }
.post-body h4 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 22px 0 6px; }
@media (min-width: 768px) { .post-body h2 { font-size: 23px; } .post-body h3 { font-size: 19px; } }
.post-body ul, .post-body ol { margin: 0 0 18px 1.25em; }
.post-body ul { list-style: disc; } .post-body ol { list-style: decimal; }
.post-body li { margin: 0 0 6px; }
.post-body li::marker { color: var(--muted); }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
/* 강조 박스는 회색 바탕 한 종류 */
.post-body blockquote { margin: 18px 0; padding: 12px 14px; background: var(--soft); border: 0; border-radius: 0; font-style: normal; color: var(--body); font-size: 15.5px; line-height: 1.7; }
.post-body blockquote p { margin: 0 0 8px; }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body img { display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; margin: 20px auto; border: 0; border-radius: 6px; box-shadow: none; object-fit: contain; transform: none !important; }
.post-body img:hover { border-color: transparent; box-shadow: none; }
/* 빌드 때 크기를 아는 이미지(--ar = 가로/세로): 로딩 전에도 자리를 잡아 화면 밀림 방지 */
.post-body img[style*="--ar"] { width: min(100%, calc(520px * var(--ar))); aspect-ratio: var(--ar); }
@media (max-width: 600px) {
  .post-body img { max-height: 360px; margin: 16px auto; }
  .post-body img[style*="--ar"] { width: min(100%, calc(360px * var(--ar))); }
}
.post-body table { font-size: 14.5px; margin: 16px 0 24px; border-top: 2px solid var(--ink); }
.post-body th, .post-body td { border: 0; border-bottom: 1px solid var(--line); padding: 9px 10px; }
.post-body th { background: var(--soft); color: var(--ink); font-weight: 700; }
.post-body tr:nth-child(even) { background: none; }
.post-body code { background: var(--soft); color: var(--ink); border-radius: 3px; }
.post-body pre { background: #1d1f24; border-radius: 4px; }

/* FAQ: 구분선 Q&A */
.faq-section { margin: 40px 0 0; }
.faq-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 4px; }
.faq-list { margin: 0; }
.faq-list dt { font-weight: 700; color: var(--ink); font-size: 16px; line-height: 1.5; padding-top: 14px; border-top: 1px solid var(--line); }
.faq-list dd { margin: 6px 0 14px; font-size: 15.5px; line-height: 1.7; color: var(--body); }

.post-cta { margin: 32px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-cta-title { font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.post-cta p { margin: 0 0 8px; font-size: 15px; }
.post-cta a { color: var(--accent); font-weight: 600; text-decoration: underline; }

.post-disclose { margin: 32px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--muted); }
.post-tags { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 16px 0 0; font-size: 14px; }
.post-tags a { color: var(--muted); }
.post-tags a:hover { color: var(--accent); }

.share-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 0; padding: 14px 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.share-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.share-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--body); font-size: 13.5px; font-weight: 600; box-shadow: none; transform: none !important; }
.share-btn:hover, .share-btn.share-btn-naver:hover, .share-btn.share-btn-facebook:hover, .share-btn.share-btn-x:hover { background: #fff; color: var(--ink); border-color: var(--ink); }

.related-posts-section { margin: 16px 0 0; }

/* 구글 선호 출처 박스 */
.preferred-source-box { border-radius: 0 !important; border: 0 !important; border-top: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; padding: 16px 0 !important; margin: 32px 0 8px !important; background: none !important; }
.preferred-source-text strong { font-size: 15.5px !important; }
.preferred-source-btn { border-radius: 4px !important; box-shadow: none !important; }

/* ---------- 광고: "광고" 표기, 채워지지 않으면 숨김 ---------- */
.adsense-slot { margin: 24px 0; border: 0 !important; background: transparent !important; }
.adsense-slot::before { content: "광고"; display: block; font-size: 11px; color: #9aa0a8; margin-bottom: 4px; letter-spacing: 0.04em; }
.adsense-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.adsense-sidebar::before { text-align: left; }

/* ---------- 푸터 ---------- */
.site-footer { margin-top: 24px; padding: 28px 0 40px; background: var(--soft); font-size: 13px; color: var(--muted); }
.foot-name { font-weight: 800; color: var(--ink); font-size: 15px; margin: 0 0 4px; }
.foot-desc { margin: 0 0 14px; line-height: 1.6; max-width: 640px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--ink); }
.foot-copy { margin: 14px 0 0; }

/* 검색·안내 페이지 등 공용 카드가 남아 있는 화면도 같은 톤으로 */
.card { border-radius: 6px; box-shadow: none !important; transform: none !important; }
.card-badge { display: none; }
.hero { display: none; }
