/* =====================================================================
   blog-theme.css — Lucky Blog 공용 디자인 토큰 (라이트 종이/매거진)
   ---------------------------------------------------------------------
   목적: 블로그(인덱스 + 개별 글 + chrome)의 색·타이포·간격을 한 파일에
   모아 "한 사이트로 보이는" 일관된 읽기 경험을 만든다. 게임(홈)의 우주·
   네온 다크 테마와는 의도적으로 분리된 "Read" 모드.

   설계 기준 (사용자 요청: "세련되고 전세계 남녀노소가 편하게")
   - 라이트 베이스: 웜 오프화이트 종이 톤. 신문·매거진처럼 눈이 편하고
     국적·연령 불문 신뢰감. (앤트로픽 시리즈의 베이지 책 테마를 정제·승격)
   - 차분한 잉크 액센트: 네온 대신 딥 그린·블루. 카테고리 색은 라이트
     배경에서 텍스트로 읽히는 어두운 톤으로 재조정.
   - 제목 serif + 본문 sans: 권위 있는 헤드라인 + 가독성 높은 본문.
   - measure 70~75자: 장문 분석 글이 편하게 읽히는 단 폭.

   사용법
   - 토큰(변수)만 정의한다. 컴포넌트 규칙은 각 페이지/override 시트에서
     이 변수를 var() 로 참조한다. (daily.css 가 :root 를 덮는 패턴과 동일)
   - 색을 바꾸려면 이 파일의 변수 한 곳만 고치면 전 페이지에 반영된다.
   - 다크모드: 라이트가 기본. prefers-color-scheme:dark 일 때 surface/ink
     계열만 뒤집어 자동 대응(액센트 색조는 유지). color-scheme inject 로
     light 고정된 글에는 영향 없음.
   ===================================================================== */

:root {
  /* ---------- 표면 (밝은 → 어두운) ---------- */
  --lb-bg:          #FBFAF6;  /* 페이지 배경 — 웜 오프화이트 */
  --lb-surface:     #FFFFFF;  /* 카드·인용 박스 배경 */
  --lb-surface-2:   #F4F1E9;  /* 보조 표면(테이블 헤더·사이드바) */
  --lb-tint:        #F7F4EC;  /* 강조 박스 옅은 종이 틴트 */

  /* ---------- 텍스트 (진한 → 옅은) ---------- */
  --lb-ink:         #20242B;  /* 본문 — 부드러운 near-black */
  --lb-ink-soft:    #434A54;  /* 부제·리드 */
  --lb-ink-dim:     #6B727D;  /* 메타·캡션·출처 */
  --lb-ink-faint:   #99A0AB;  /* 비활성·플레이스홀더 */

  /* ---------- 선 ---------- */
  --lb-line:        #E7E2D6;  /* 기본 구분선·hairline */
  --lb-line-soft:   #EFEADF;  /* 옅은 구분선 */
  --lb-line-strong: #D8D2C4;  /* 강조 테두리 */

  /* ---------- 액센트 (차분한 잉크 톤) ---------- */
  --lb-accent:      #1A6E55;  /* 메인 — 딥 그린(차분·신뢰). CTA·읽기링크 */
  --lb-accent-ink:  #12503D;  /* 액센트 텍스트(짙은) */
  --lb-accent-soft: #E5F0EA;  /* 액센트 옅은 배경 */
  --lb-link:        #185FA5;  /* 본문 인라인 링크 — 클래식 블루 */
  --lb-link-hover:  #0C447C;

  /* ---------- 타이포 ---------- */
  /* 제목: serif — 권위 있는 헤드라인. 본문: sans — 다국어 가독성. */
  --lb-serif: 'Noto Serif KR','Source Serif 4','Source Serif Pro',Georgia,'Times New Roman',serif;
  --lb-sans:  -apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo','Pretendard Variable','Pretendard','Inter','Noto Sans KR','Noto Sans JP','Noto Sans SC',sans-serif;
  --lb-mono:  'JetBrains Mono',ui-monospace,'SFMono-Regular',Menlo,monospace;

  /* 본문 리듬 */
  --lb-fs-body:   16.5px;     /* 본문 기본 크기 */
  --lb-lh-body:   1.78;       /* 본문 행간 */
  --lb-measure:   720px;      /* 단 최대 폭(읽기 영역) */

  /* ---------- 반경 ---------- */
  --lb-r-sm: 8px;
  --lb-r-md: 12px;
  --lb-r-lg: 16px;

  /* ---------- 카테고리 색 (라이트 배경용 — 텍스트로 읽히는 어두운 톤) ----------
     각 카테고리: 메인(텍스트/좌측바), -soft(배경 틴트), -line(테두리).
     게임 홈/인덱스 다크판의 형광 색을 라이트 배경 대비 4.5:1 이상으로 재조정. */
  --cat-space-tech:      #1F6FB2;  --cat-space-tech-soft:      #E7F0F9;  --cat-space-tech-line:      #C4DCF0;
  --cat-robotics:        #C2540C;  --cat-robotics-soft:        #FBEDE2;  --cat-robotics-line:        #F0D3BD;
  --cat-ai-tech:         #A8316B;  --cat-ai-tech-soft:         #FAEAF1;  --cat-ai-tech-line:         #F0C9DA;
  --cat-stocks:          #1A6E55;  --cat-stocks-soft:          #E5F0EA;  --cat-stocks-line:          #C3E0D2;
  --cat-industry:        #92590F;  --cat-industry-soft:        #F7EFDD;  --cat-industry-line:        #E8D5AE;
  --cat-football:        #5B4AB7;  --cat-football-soft:        #ECEAF8;  --cat-football-line:        #D2CBEF;
  --cat-baseball:        #B23046;  --cat-baseball-soft:        #FAE9EC;  --cat-baseball-line:        #F0C7CF;
  --cat-gaming-history:  #8A6D12;  --cat-gaming-history-soft:  #F7F1DC;  --cat-gaming-history-line:  #E7DAAB;
}

/* =====================================================================
   다크모드 — opt-in 만. (자동 prefers-color-scheme 반전 금지)
   ---------------------------------------------------------------------
   블로그 정체성은 "라이트 종이/매거진"이다. OS 다크모드에 따라 자동으로
   배경이 뒤집히면 의도한 종이 톤이 깨지고, 글마다 light 고정한 글과 안 한
   글이 섞여 비일관해진다(CLAUDE.md 의 force-dark 사고와 같은 함정).
   그래서 다크는 <html class="lb-dark"> 로 명시 선택했을 때만 적용한다.
   기본 토큰(위 :root)이 곧 라이트이며, OS 설정과 무관하게 항상 라이트다.
   ===================================================================== */
:root.lb-dark {
    --lb-bg:          #14161B;
    --lb-surface:     #1B1E25;
    --lb-surface-2:   #23272F;
    --lb-tint:        #1E222A;

    --lb-ink:         #E8EAEE;
    --lb-ink-soft:    #B6BCC6;
    --lb-ink-dim:     #8A919C;
    --lb-ink-faint:   #636A75;

    --lb-line:        #2A2F38;
    --lb-line-soft:   #232830;
    --lb-line-strong: #3A404B;

    /* 액센트는 어두운 배경에서 한 톤 밝게 */
    --lb-accent:      #4FC79C;
    --lb-accent-ink:  #8FE0C2;
    --lb-accent-soft: #16302A;
    --lb-link:        #5FA8E8;
    --lb-link-hover:  #8AC2F0;

    /* 카테고리 색 — 다크 배경에서 밝게(원래 형광 톤에 가깝게) */
    --cat-space-tech:      #5DC1FF;  --cat-space-tech-soft:      #14222F;  --cat-space-tech-line:      #1E3A52;
    --cat-robotics:        #FF8C42;  --cat-robotics-soft:        #2A1C12;  --cat-robotics-line:        #4A301B;
    --cat-ai-tech:         #FF66CC;  --cat-ai-tech-soft:         #2A1422;  --cat-ai-tech-line:         #4A2240;
    --cat-stocks:          #3DD68C;  --cat-stocks-soft:          #122A20;  --cat-stocks-line:          #1E4A36;
    --cat-industry:        #E0A33E;  --cat-industry-soft:        #2A2212;  --cat-industry-line:        #4A3B1B;
    --cat-football:        #A78BFA;  --cat-football-soft:        #1E1A2E;  --cat-football-line:        #352D52;
    --cat-baseball:        #F43F5E;  --cat-baseball-soft:        #2A1218;  --cat-baseball-line:        #4A1E2A;
    --cat-gaming-history:  #FFE066;  --cat-gaming-history-soft:  #2A2612;  --cat-gaming-history-line:  #4A431B;
}

/* =====================================================================
   공용 푸터(siteFooter.js) 라이트 override
   ---------------------------------------------------------------------
   siteFooter.js 는 게임(다크)과 공유되는 모듈이라 흰 텍스트가 기본값이다.
   이 시트(blog-theme.css)는 블로그 페이지에만 로드되므로 여기서 푸터를
   라이트로 덮어도 게임 푸터에는 영향이 없다. siteFooter 의 동적 주입
   <style> 가 나중에 로드돼 같은 specificity 를 이기므로 !important 로 확정.
   ===================================================================== */
.lp-site-footer{ color:var(--lb-ink-dim) !important; }
.lp-site-footer a{ color:var(--lb-accent) !important; }
.lp-site-footer a:hover{ color:var(--lb-accent-ink) !important; background:var(--lb-accent-soft) !important; }
.lp-site-footer .sep{ color:var(--lb-ink-faint) !important; }
.lp-site-footer .copy{ color:var(--lb-ink-faint) !important; }
.lp-stat-row{ color:var(--lb-ink-dim) !important; }
.lp-stat-label{ color:var(--lb-ink-dim) !important; }
.lp-digits,.lp-digit{ color:var(--lb-ink-soft) !important; border-color:var(--lb-line) !important; }

/* =====================================================================
   본문 인포그래픽 (HTML 기반) — SVG 대신 HTML 로 그려 폰트가 px 로 고정,
   모바일에서 축소돼 안 보이는 문제 해결. blog 글들이 공유.
   ===================================================================== */
/* 가로 막대 */
.ig-bar{ display:flex; align-items:center; gap:12px; margin:11px 0; }
.ig-bar .lab{ width:124px; flex-shrink:0; font-size:14px; color:var(--lb-ink-soft); text-align:right; line-height:1.3; }
.ig-bar .lab.warn{ color:#b23046; font-weight:600; }
.ig-bar .track{ flex:1; height:32px; background:var(--lb-surface-2); border-radius:6px; position:relative; display:flex; align-items:center; }
.ig-bar .fill{ height:100%; border-radius:6px; min-width:6px; }
.ig-bar .val{ position:absolute; font-family:var(--lb-mono); font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; }
.ig-axis{ display:flex; justify-content:space-between; margin:4px 0 0 136px; font-family:var(--lb-mono); font-size:11.5px; color:var(--lb-ink-faint); }
@media(max-width:560px){ .ig-bar .lab{ width:92px; font-size:12.5px; } .ig-axis{ margin-left:104px; } }

/* 순환출자 흐름 */
.ig-loop{ display:flex; flex-wrap:wrap; align-items:stretch; gap:9px; margin:10px 0 0; }
.ig-loop .node{ flex:1 1 96px; background:#fff; border:1px solid #cdd4dd; border-radius:10px; padding:13px 9px; text-align:center; font-size:15px; font-weight:600; color:#1b2536; line-height:1.35; }
.ig-loop .node b{ display:block; font-size:12.5px; font-weight:400; color:var(--lb-ink-dim); margin-top:3px; }
.ig-loop .node.top{ border-color:#24405f; border-width:1.5px; }
.ig-loop .arr{ display:flex; align-items:center; justify-content:center; font-family:var(--lb-mono); font-size:14px; font-weight:700; color:#c79a2e; flex:0 0 auto; }
.ig-loop-note{ margin-top:12px; text-align:center; font-family:var(--lb-mono); font-size:13px; color:#a98c46; line-height:1.55; }
@media(max-width:560px){ .ig-loop{ flex-direction:column; } .ig-loop .arr{ transform:rotate(90deg); padding:3px 0; } }

/* 가치 도약 */
.ig-jump{ display:flex; align-items:flex-end; gap:18px; margin:12px 0 4px; }
.ig-jump .small{ flex:0 0 auto; text-align:center; }
.ig-jump .small .b{ width:104px; height:22px; background:#cdd2d8; border-radius:4px; margin-bottom:7px; }
.ig-jump .small .c{ font-family:var(--lb-mono); font-size:13px; color:var(--lb-ink-dim); line-height:1.5; }
.ig-jump .mid{ flex:0 0 auto; font-family:var(--lb-mono); font-size:14px; font-weight:700; color:#8a6a18; text-align:center; padding-bottom:34px; }
.ig-jump .big{ flex:1; max-width:240px; text-align:center; }
.ig-jump .big .box{ border:1px solid #e2d09a; border-radius:8px; overflow:hidden; }
.ig-jump .big .gold{ background:#c79a2e; color:#fff; padding:13px 8px; font-weight:700; font-size:15px; line-height:1.3; }
.ig-jump .big .grp{ background:#f5ecd6; color:#8a7530; padding:20px 8px; font-size:14px; }
.ig-jump .big .c{ font-family:var(--lb-mono); font-size:13px; color:var(--lb-ink-dim); margin-top:7px; }
@media(max-width:560px){ .ig-jump{ gap:10px; } .ig-jump .mid{ padding-bottom:0; } .ig-jump .small .b{ width:72px; } }

/* 종목별 손익 방정식 (유리한 주가 방향) */
.ig-pos{ display:flex; align-items:center; gap:12px; padding:13px 2px; border-bottom:1px solid var(--lb-line-soft); }
.ig-pos:last-child{ border-bottom:none; }
.ig-pos .nm{ flex:0 0 auto; width:158px; font-weight:500; font-size:14.5px; color:var(--lb-ink); line-height:1.35; }
.ig-pos .ps{ flex:0 0 auto; width:88px; font-size:12.5px; color:var(--lb-ink-dim); }
.ig-pos .dir{ flex:1; font-size:14px; font-weight:500; text-align:right; line-height:1.35; }
.ig-pos .dir.up{ color:#1a8a6a; }
.ig-pos .dir.down{ color:#b23046; }
.ig-pos .dir.neu{ color:#6b727d; }
@media(max-width:560px){ .ig-pos{ flex-wrap:wrap; gap:3px 10px; padding:11px 2px; } .ig-pos .nm{ width:auto; flex:1 1 100%; } .ig-pos .ps{ width:auto; } .ig-pos .dir{ text-align:left; } }

/* 시나리오 비교 매트릭스 (한눈에 비교되는 금융리포트형 표) */
.scn-matrix{ width:100%; border-collapse:collapse; margin:18px 0 8px; font-size:13px; }
.scn-matrix thead th{ font-family:var(--lb-mono); font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--lb-ink-dim); text-align:left; padding:0 12px 9px; border-bottom:1.5px solid var(--lb-line-strong); }
.scn-matrix tbody td{ padding:13px 12px; border-bottom:1px solid var(--lb-line-soft); vertical-align:top; line-height:1.6; color:var(--lb-ink-soft); }
.scn-matrix tbody tr:last-child td{ border-bottom:none; }
.scn-matrix .sc{ width:40%; }
.scn-matrix .sn{ display:inline-flex; align-items:center; justify-content:center; width:21px; height:21px; border-radius:50%; background:var(--cat-stocks); color:#fff; font-family:var(--lb-mono); font-size:11px; font-weight:700; margin-right:8px; vertical-align:1px; }
.scn-matrix .sc b{ font-family:var(--lb-serif); font-size:14.5px; font-weight:600; color:var(--lb-ink); letter-spacing:-.01em; }
.scn-matrix .sc .sm{ display:block; margin-top:5px; padding-left:29px; font-size:12px; color:var(--lb-ink-dim); line-height:1.5; }
.scn-matrix td.good::before{ content:"✓"; color:#1a8a6a; font-weight:700; margin-right:6px; }
.scn-matrix td.bad::before{ content:"✕"; color:#b23046; font-weight:700; margin-right:6px; }
@media(max-width:560px){
  .scn-matrix, .scn-matrix tbody, .scn-matrix tr, .scn-matrix td{ display:block; width:100%; }
  .scn-matrix thead{ display:none; }
  .scn-matrix tbody tr{ border:1px solid var(--lb-line); border-left:3px solid var(--cat-stocks); border-radius:10px; margin:11px 0; background:var(--lb-surface); overflow:hidden; }
  .scn-matrix tbody td{ border-bottom:1px solid var(--lb-line-soft); padding:10px 14px; }
  .scn-matrix tbody tr td:last-child{ border-bottom:none; }
  .scn-matrix .sc{ width:100%; background:var(--lb-tint); }
  .scn-matrix .sc .sm{ padding-left:29px; }
  .scn-matrix td.good::before{ content:"✓ 유리 "; font-size:11px; }
  .scn-matrix td.bad::before{ content:"✕ 난관 "; font-size:11px; }
}
