/* ===========================================================================
   블랙잭 베이직 스트래티지 — 공용 스타일
   계산기(index.html)와 읽을거리 페이지가 같은 디자인 토큰을 공유합니다.
   =========================================================================== */

:root {
  --bg:        #EDF0EF;
  --surface:   #FFFFFF;
  --surface-2: #E3E8E6;
  --ink:       #14201E;
  --ink-2:     #3D4B48;
  --muted:     #5C6B68;
  --rule:      #CBD5D2;
  --rule-2:    #DDE4E2;

  --house:       #1B2A27;
  --house-2:     #24352F;
  --house-ink:   #EDF0EF;
  --house-muted: #9BAFA9;
  --house-rule:  #3A4D46;

  --a-stand:  #2F7D5B;
  --a-hit:    #B8453A;
  --a-double: #2C6E9B;
  --a-split:  #96700D;
  --a-surr:   #6E7A86;
  --on-action:#FFFFFF;

  --focus: #2C6E9B;
  color-scheme: light;

  --sans: "IBM Plex Sans KR", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans KR", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--2: clamp(.62rem, .60rem + .08vw, .68rem);
  --step--1: clamp(.72rem, .70rem + .1vw, .78rem);
  --step-0:  clamp(.92rem, .89rem + .15vw, 1rem);
  --step-1:  clamp(1.06rem, 1rem + .3vw, 1.2rem);
  --step-2:  clamp(1.3rem, 1.18rem + .6vw, 1.6rem);
  --step-3:  clamp(1.7rem, 1.4rem + 1.4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #0E1917;
    --surface:   #1B2C27;
    --surface-2: #24352F;
    --ink:       #E9EEEC;
    --ink-2:     #C0CCC8;
    --muted:     #92A3A0;
    --rule:      #33443E;
    --rule-2:    #2A3A34;

    --house:       #060C0B;
    --house-2:     #101B18;
    --house-ink:   #E9EEEC;
    --house-muted: #8496A0;
    --house-rule:  #23332E;

    --a-stand:  #4FB083;
    --a-hit:    #E0736A;
    --a-double: #5BA3D0;
    --a-split:  #D6A83A;
    --a-surr:   #94A2AD;
    --on-action:#0E1917;

    --focus: #5BA3D0;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0E1917;
  --surface:   #1B2C27;
  --surface-2: #24352F;
  --ink:       #E9EEEC;
  --ink-2:     #C0CCC8;
  --muted:     #92A3A0;
  --rule:      #33443E;
  --rule-2:    #2A3A34;

  --house:       #060C0B;
  --house-2:     #101B18;
  --house-ink:   #E9EEEC;
  --house-muted: #8496A0;
  --house-rule:  #23332E;

  --a-stand:  #4FB083;
  --a-hit:    #E0736A;
  --a-double: #5BA3D0;
  --a-split:  #D6A83A;
  --a-surr:   #94A2AD;
  --on-action:#0E1917;

  --focus: #5BA3D0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- 사이트 네비게이션 ---------- */
.sitebar {
  background: var(--house);
  color: var(--house-ink);
  border-bottom: 1px solid var(--house-rule);
}
.sitebar-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}
.brand {
  font-size: var(--step-0);
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--house-ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand b { font-weight: 700; }
.sitebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.sitebar nav a {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--house-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 3px;
  white-space: nowrap;
}
.sitebar nav a:hover { background: var(--house-2); color: var(--house-ink); }
.sitebar nav a[aria-current="page"] {
  background: var(--house-ink);
  color: var(--house);
  font-weight: 600;
}

/* ---------- 본문 레이아웃 ---------- */
.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 20px;
  padding-block: 36px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.article { max-width: 68ch; }

.pagehead { border-bottom: 1.5px solid var(--ink); padding-bottom: 18px; }
.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.pagehead h1 {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.08;
  text-wrap: balance;
}
.pagehead .lede {
  margin: 10px 0 0;
  font-size: var(--step-1);
  color: var(--muted);
  letter-spacing: -.005em;
  max-width: 52ch;
}

.article h2 {
  margin: 38px 0 12px;
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-wrap: balance;
}
.article h3 {
  margin: 26px 0 8px;
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -.01em;
}
.article p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.7; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 1.3em; }
.article li { margin-bottom: 7px; color: var(--ink-2); line-height: 1.65; }
.article strong { color: var(--ink); font-weight: 600; }
.article a { color: var(--a-double); text-underline-offset: 2px; }

code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 2px;
}

/* 용어 정의 목록 */
.terms {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 1px;
  background: var(--rule-2);
  border: 1px solid var(--rule-2);
  margin: 0 0 20px;
}
.terms dt, .terms dd {
  background: var(--surface);
  margin: 0;
  padding: 11px 14px;
  line-height: 1.6;
}
.terms dt { font-weight: 600; color: var(--ink); }
.terms dd { color: var(--ink-2); }
@media (max-width: 560px) {
  .terms { grid-template-columns: 1fr; }
  .terms dt { padding-bottom: 2px; }
  .terms dd { padding-top: 2px; }
}

/* 표 */
.scroller { overflow-x: auto; margin: 0 0 20px; }
.data {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
  font-variant-numeric: tabular-nums;
}
.data caption {
  caption-side: top;
  text-align: left;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
}
.data th, .data td {
  border: 1px solid var(--rule-2);
  padding: 9px 12px;
  text-align: left;
  font-size: var(--step--1);
  line-height: 1.5;
}
.data thead th {
  background: var(--house);
  color: var(--house-ink);
  font-weight: 600;
}
.data tbody th { background: var(--surface-2); font-weight: 600; color: var(--ink); }
.data td { background: var(--surface); color: var(--ink-2); }
.data .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.data .good { color: var(--a-stand); font-weight: 600; }
.data .bad  { color: var(--a-hit);   font-weight: 600; }

/* 콜아웃 */
.callout {
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent, var(--muted));
}
.callout--warn { --accent: var(--a-hit); }
.callout--key  { --accent: var(--a-double); }
.callout--good { --accent: var(--a-stand); }
.callout h3 {
  margin: 0 0 6px;
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--accent, var(--ink));
  letter-spacing: 0;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

/* 액션 색 칩 */
.chip-act {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  color: var(--on-action);
  vertical-align: -4px;
}
.chip-act.S { background: var(--a-stand); }
.chip-act.H { background: var(--a-hit); }
.chip-act.D { background: var(--a-double); }
.chip-act.P { background: var(--a-split); }
.chip-act.R { background: var(--a-surr); }

/* 다음 읽을거리 */
.nextup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1.5px solid var(--ink);
}
.nextup a {
  display: block;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}
.nextup a:hover { border-color: var(--ink); }
.nextup .k {
  display: block;
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.nextup .t { display: block; font-weight: 600; margin-bottom: 4px; }
.nextup .d { display: block; font-size: var(--step--1); color: var(--muted); line-height: 1.5; }

/* ---------- 푸터 ---------- */
.sitefoot {
  background: var(--house);
  color: var(--house-muted);
  border-top: 1px solid var(--house-rule);
}
.sitefoot-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sitefoot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sitefoot nav a {
  color: var(--house-ink);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 500;
}
.sitefoot nav a:hover { text-decoration: underline; }
.sitefoot p {
  margin: 0;
  font-size: var(--step--1);
  line-height: 1.65;
  max-width: 70ch;
}
.sitefoot .fineprint { color: var(--house-muted); }

/* ---------- 광고 자리 (계산기와 동일한 3모드) ---------- */
.adslot { display: grid; place-items: center; overflow: hidden; }
.adslot > * { max-width: 100%; }
.adslot-ph { display: none; }
.ads-preview .adslot-ph {
  display: grid; gap: 3px; place-items: center; text-align: center;
}
.ads-preview .adslot {
  padding: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--rule);
  color: var(--muted);
}
.ads-review .adslot { display: none; }
.adslot-tag {
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.adslot-size {
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--rule);
  letter-spacing: .06em;
}
.adslot--leader { min-height: 90px; }
@media (max-width: 760px) { .adslot--leader { min-height: 100px; } }
.adslot--inline { min-height: 110px; }
.adslot--footer { min-height: 90px; }
@media (max-width: 760px) { .adslot--footer { min-height: 100px; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 언어 전환 ---------- */
.langbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: auto;
}
.langbar a {
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: .04em;
  color: var(--house-muted);
  text-decoration: none;
  padding: 5px 8px;
  border: 1px solid var(--house-rule);
  border-radius: 2px;
  white-space: nowrap;
}
.langbar a:hover { background: var(--house-2); color: var(--house-ink); }
.langbar a[aria-current="true"] {
  background: var(--house-ink);
  color: var(--house);
  border-color: var(--house-ink);
  font-weight: 600;
}
@media (max-width: 620px) { .langbar { margin-left: 0; } }

/* ---------- 계산기 딥링크 박스 ---------- */
.trybox {
  display: block;
  margin: 0 0 22px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--ink);
  text-decoration: none;
  color: var(--ink);
}
.trybox:hover { background: var(--surface-2); }
.trybox .k {
  display: block;
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.trybox .hand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--step-1);
  font-weight: 600;
  margin-bottom: 6px;
}
.trybox .hand .vs { color: var(--muted); font-weight: 400; }
.trybox .hand .house {
  background: var(--house);
  color: var(--house-ink);
  padding: 2px 8px;
  border-radius: 2px;
}
.trybox .go { display: block; font-size: var(--step--1); color: var(--a-double); font-weight: 600; }

/* 한눈에 보는 답 */
.answer {
  margin: 0 0 22px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--act, var(--a-double));
}
.answer .q {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.answer p { margin: 0; font-size: var(--step-1); font-weight: 600; line-height: 1.5; color: var(--ink); }
.answer p + p { margin-top: 8px; font-size: var(--step-0); font-weight: 400; color: var(--ink-2); }
.answer--stand { --act: var(--a-stand); }
.answer--hit   { --act: var(--a-hit); }
.answer--surr  { --act: var(--a-surr); }
.answer--split { --act: var(--a-split); }
