/*
 * Foxgori Board 테마: 글·페이지 본문 모양. 보드 CSS(styles.css)의 토큰(--cb-*)을 쓰고, 보드 CSS가 없을 때도 읽히게 대체 값을 둔다.
 * 본문(.cb-article)은 어두운 화면에서도 밝은 종이 위에 그린다. 기존 글 198편이 `color:#18181b`·`background:#fafafa` 같은 인라인 색을
 * 가진 채 발행돼 있어, 종이를 어둡게 바꾸면 인라인 글자색이 바탕에 묻히기 때문이다.
 * 광고(ins.adsbygoogle)·AICP·관련 글(.gjc-related-v8)은 그대로 두고 모양만 본문 폭에 맞춘다.
 */

.cb-main--wp { max-width: 100%; }
.cb-main--wp > .cb-single,
.cb-main--wp > .cb-masthead,
.cb-main--wp > .cb-crumbs,
.cb-main--wp > .cb-search-form,
.cb-main--wp > .cb-result-count { max-width: 1000px; }
.cb-main--wp > .cb-posts { max-width: 1100px; }

/* ---------- 글 머리 ---------- */
.cb-single { max-width: 860px; margin: 0 auto; }
.cb-article-head {
  margin: 0 0 var(--sp-4, 16px); padding: 14px 24px 20px;
  border: 1px solid var(--cb-line, #e4e4e7); border-radius: var(--cb-radius, 14px);
  background: var(--cb-surface, #fff); box-shadow: var(--cb-shadow, none);
}
.cb-article-title { margin: 0 0 8px; font-size: var(--fs-2xl, 30px); line-height: 1.3; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.cb-article-meta { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 0; font-size: var(--fs-sm, 13.5px); color: var(--cb-muted, #63636c); font-variant-numeric: tabular-nums; }
.cb-article-head .cb-badges a.cb-tag { text-decoration: none; }
.cb-article-head .cb-badges a.cb-tag:hover { background: var(--cb-current, #e6eefa); color: var(--cb-on-current, #2f4468); }

/* ---------- 본문: 어두운 화면에서도 밝은 종이 ---------- */
.cb-article {
  --cb-surface: #ffffff; --cb-surface-muted: #f4f4f5; --cb-ink: #100b14; --cb-text: #212121; --cb-muted: #63636c;
  --cb-line: #e4e4e7; --cb-line-strong: #8b8b94; --cb-link: #1261b2; --cb-link-hover: #2f4468; --cb-brand: #2f4468;
  --cb-on-brand: #ffffff; --cb-current: #e6eefa; --cb-on-current: #2f4468; --cb-bg: #ffffff;
  padding: 28px 36px 32px;
  border: 1px solid #e4e4e7; border-radius: var(--cb-radius, 14px);
  background: #ffffff; color: #212121;
  box-shadow: var(--cb-shadow, none);
  font-size: 17px; line-height: 1.85; letter-spacing: -0.01em;
  overflow-wrap: break-word; word-break: keep-all; text-wrap: pretty;
}
.cb-article > :first-child { margin-top: 0; }
.cb-article > :last-child { margin-bottom: 0; }
.cb-article p { margin: 0 0 1.25em; max-width: none; }
.cb-article > p:first-child:not([style]) {
  padding: 16px 18px; border-left: 4px solid #2f4468; border-radius: 10px; background: #f4f4f5; color: #100b14; font-size: 17.5px;
}
.cb-article h2 {
  margin: 2.4em 0 0.8em; padding: 0 0 0 12px; border-left: 4px solid #2f4468;
  color: #100b14; font-size: clamp(22px, 2.6vw, 26px); font-weight: 800; line-height: 1.4; letter-spacing: -0.025em;
}
.cb-article h3 { margin: 1.9em 0 0.6em; color: #100b14; font-size: 20px; font-weight: 800; line-height: 1.45; letter-spacing: -0.02em; }
.cb-article h4 { margin: 1.6em 0 0.5em; color: #212121; font-size: 17px; font-weight: 800; }
.cb-article ul, .cb-article ol { margin: 0 0 1.4em; padding: 0 0 0 1.4em; }
.cb-article li { margin: 0.35em 0; padding-left: 0.1em; }
.cb-article li::marker { color: #2f4468; font-weight: 800; }
.cb-article a:not([class]) { color: #1261b2; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cb-article a:not([class]):hover { color: #2f4468; text-decoration-thickness: 2px; }
.cb-article strong { color: #100b14; }
.cb-article hr { margin: 2.2em 0; border: 0; border-top: 1px solid #e4e4e7; }
.cb-article blockquote {
  margin: 1.6em 0; padding: 14px 18px; border: 0; border-left: 4px solid #1261b2; border-radius: 10px;
  background: #eef5fd; color: #212121; font-style: normal;
}
.cb-article blockquote p:last-child { margin-bottom: 0; }
.cb-article code { padding: 1px 6px; border-radius: 6px; background: #f4f4f5; font-size: 0.92em; }
.cb-article pre { overflow-x: auto; margin: 1.4em 0; padding: 14px 16px; border-radius: 10px; background: #f4f4f5; font-size: 14px; line-height: 1.6; }
.cb-article pre code { padding: 0; background: transparent; }

/* 표: 인라인 스타일이 있는 표(한눈에 보기 등)도 같은 모양으로 맞춘다 */
.cb-article table {
  width: 100%; margin: 1.4em 0 1.8em; border: 1px solid #d4d4d8 !important; border-collapse: separate !important; border-spacing: 0;
  border-radius: 10px; overflow: hidden; background: #ffffff; font-size: 15.5px; line-height: 1.65; font-variant-numeric: tabular-nums;
}
.cb-article th, .cb-article td { padding: 11px 14px !important; border-color: #e4e4e7 !important; vertical-align: top; }
.cb-article th { background: #f4f4f5 !important; color: #100b14 !important; font-weight: 800 !important; text-align: left; }
.cb-article td { color: #212121; background: #ffffff; }
.cb-article tr:nth-child(even) td { background: #fafafa; }
.cb-article caption { padding: 0 0 8px; color: #63636c; font-size: 13px; text-align: left; caption-side: top; }
.cb-article .gjc-vb-sum { margin: 1.6em 0 !important; padding: 16px 18px !important; border-radius: 12px !important; background: #fafafa !important; }
.cb-article .gjc-vb-sum table { margin: 0; border: 0 !important; border-radius: 0; }
.cb-article .gjc-vb-sum th, .cb-article .gjc-vb-sum td { background: transparent !important; }

/* 그림·영상 */
.cb-article img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; }
.cb-article figure { margin: 1.6em 0; padding: 0; }
.cb-article figcaption, .cb-article .wp-caption-text { margin: 8px 2px 0; color: #63636c; font-size: 13px; line-height: 1.6; text-align: left; }
.cb-article iframe, .cb-article video { max-width: 100%; }
.cb-article .alignleft, .cb-article .alignright, .cb-article .aligncenter { float: none; display: block; margin: 1.4em auto; }
.cb-article .lwptoc { margin: 1.4em 0 2em; border: 1px solid #e4e4e7; border-radius: 10px; background: #fafafa; }

/* 쇼핑 카드(.sc-card)와 단추(.sc-cta)는 글이 가진 자체 스타일을 그대로 쓰고 링크 밑줄만 뺀다 */
.cb-article .sc-card a, .cb-article a.sc-cta { text-decoration: none; }

/* 관련 글(mu-plugin): 목록 모양만 본문 규칙에서 빼낸다 */
.cb-article .gjc-related-v8 { margin: 2.4em 0 0; }
.cb-article .gjc-related-v8 ul { margin: 0; padding: 0; border: 0; background: transparent; list-style: none; }
.cb-article .gjc-related-v8 li { margin: 0; padding: 0; }
.cb-article .gjc-related-v8 a { text-decoration: none; color: inherit; }

/* 광고 단위: 본문 폭을 넘지 않게만 한다(내용·표시 여부는 건드리지 않는다) */
.cb-article ins.adsbygoogle { max-width: 100%; }

/*
 * 광고 자리(mu-plugin이 본문 사이에 넣는 `.aicp.xq7-ad` 안의 ins.adsbygoogle): 아래 규칙은 광고가 켜졌을 때만 적용된다.
 * body에 `fb-ads-on`이 붙는 조건은 functions.php(GJC_ADSENSE_SAFETY_PAUSED가 true가 아닐 때). 중지 상태에서는 아무 규칙도
 * 적용되지 않아 글 화면이 예전과 같다. 켤 때 바꿀 곳은 mu-plugin 상수 하나뿐이다(README 「광고 켜기 절차」).
 */
body.fb-ads-on .cb-article .xq7-ad {
  position: relative; max-width: 100%; min-height: 120px; margin: 40px auto 32px !important; text-align: center;
}
body.fb-ads-on .cb-article .xq7-ad:has(ins.adsbygoogle[data-ad-status="filled"])::before {
  content: "광고"; display: block; margin: 0 0 4px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.4; color: #63636c;
}
body.fb-ads-on .cb-article .xq7-ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
body.fb-ads-on .cb-article ins.adsbygoogle { display: block; width: 100%; }
@media (max-width: 767px) { body.fb-ads-on .cb-article .xq7-ad { min-height: 250px; } }
/* 예전 테마가 가리던 자동 광고 조각은 새 본문에서도 가린다 */
.cb-article .google-auto-placed, .cb-article .google-aiuf, .cb-article .google-anno-sc, #google-anno-sa,
.cb-nav .google-auto-placed, .cb-nav .google-aiuf, .cb-nav .adsbygoogle, .cb-topbar .adsbygoogle { display: none !important; visibility: hidden !important; }

/* ---------- 이전·다음 글 ---------- */
.cb-post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3, 12px); margin: var(--sp-4, 16px) 0 0; }
.cb-post-nav:empty { display: none; }
.cb-post-nav-item {
  min-width: 0; padding: 12px 16px; border: 1px solid var(--cb-line, #e4e4e7); border-radius: var(--cb-radius, 14px);
  background: var(--cb-surface, #fff); box-shadow: var(--cb-shadow, none);
}
.cb-post-nav-next { grid-column: 2; text-align: right; }
.cb-post-nav-prev { grid-column: 1; }
.cb-post-nav-item span { display: block; font-size: var(--fs-xs, 12px); font-weight: 800; letter-spacing: 0.04em; color: var(--cb-muted, #63636c); }
.cb-post-nav-item a { display: block; font-weight: 800; color: var(--cb-ink, #100b14); text-decoration: none; overflow-wrap: anywhere; }
.cb-post-nav-item a:hover { text-decoration: underline; }
.page-links { margin: 1.5em 0 0; font-weight: 700; }

/* ---------- 목록·검색 ---------- */
.cb-main--wp .cb-search-form { margin: 0 0 var(--sp-4, 16px); }
.cb-pager--wp ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.cb-pager--wp .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--cb-line-strong, #8b8b94); border-radius: 8px; color: var(--cb-text, #212121); text-decoration: none; font-weight: 700;
}
.cb-pager--wp a.page-numbers:hover { border-color: var(--cb-brand, #2f4468); background: var(--cb-surface-muted, #f4f4f5); }
.cb-pager--wp .page-numbers.current { background: var(--cb-brand, #2f4468); border-color: var(--cb-brand, #2f4468); color: var(--cb-on-brand, #fff); }
.cb-pager--wp .page-numbers.dots { border-color: transparent; }
.cb-post.hentry { margin: 0; }
.cb-main--wp .cb-post-title a { color: var(--cb-ink, #100b14); }

@media (max-width: 767px) {
  .cb-article-head { padding: 10px 18px 18px; }
  .cb-article-title { font-size: 26px; }
  .cb-article { padding: 20px 18px 24px; font-size: 16.5px; }
  .cb-article table { display: block; overflow-x: auto; }
  .cb-post-nav { grid-template-columns: minmax(0, 1fr); }
  .cb-post-nav-next, .cb-post-nav-prev { grid-column: 1; text-align: left; }
}

/* 검색·목록 머리 간격 */
.cb-main--wp > .cb-masthead { margin-bottom: 20px; }
.cb-main--wp > .cb-masthead .cb-lead { margin-top: 4px; }
.cb-main--wp > .cb-crumbs ol { margin-bottom: 4px; }

/* mu-plugin의 404 복구 링크(wp_footer 뒤에 붙음): 지우지 않고 본문 칸 아래에 맞춰 읽히게만 한다 */
.gjc-404-recovery { max-width: 860px; margin: 0 auto; padding: 8px 16px 48px; color: var(--cb-muted, #63636c); font-size: 13.5px; line-height: 1.7; }
.gjc-404-recovery h2 { margin: 0 0 4px; font-size: 15px; color: var(--cb-ink, #100b14); }
.gjc-404-recovery ul { margin: 8px 0 0; padding-left: 1.2em; }
@media (min-width: 1024px) { body.fb-shell-on .gjc-404-recovery { margin: 0 0 0 232px; padding: 8px 40px 48px 36px; max-width: none; } }

@media (max-width: 767px) {
  .cb-article-head .cb-crumbs li[aria-current] { display: none; }
}
