/* MBTI 공용 스타일 (궁합·테스트·글 공유). 루트 /style.css 또는 /css/style.css 위에 로드 */
/* 글(/posts, /css/style.css)에는 없는 변수 보강 — primary·bg·text는 각 페이지 테마를 따름 */
:root { --border: #e3e7ef; --card: #ffffff; --muted: #6c757d; }
.mbti-wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
.mbti-tabs { display: flex; flex-wrap: wrap; gap: 8px; max-width: 760px; margin: 0 auto 16px; padding: 0 16px; }
.mbti-tab { flex: 1 1 auto; text-align: center; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; }
.mbti-tab:hover { border-color: var(--primary); color: var(--primary); }
.mbti-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.pick-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.pick-row .vs { font-weight: 800; color: var(--muted); padding-bottom: 11px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }

/* 결과 */
.score-hero { text-align: center; padding: 8px 0 2px; }
.score-hero .num { font-size: 3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.score-hero .num small { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.05rem; padding: 6px 16px; border-radius: 999px; margin-top: 8px; }
.gr-best { background: #e4f6ec; color: #1f9d57; } .gr-good { background: #e7efff; color: #1a4fd0; }
.gr-soso { background: #fcf6e0; color: #a9800c; } .gr-learn { background: #fdeee0; color: #c2680c; }
.score3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 4px; }
.score3 .s { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.score3 .s .k { font-size: .8rem; color: var(--muted); } .score3 .s .v { font-size: 1.5rem; font-weight: 800; }
.score3 .s .bar { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.score3 .s .bar > div { height: 100%; background: var(--primary); }
.axis-list { list-style: none; padding: 0; margin: 10px 0; }
.axis-list li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.axis-list li:first-child { border-top: none; }
.axis-list .ax { flex: 0 0 auto; font-weight: 800; color: var(--primary); width: 34px; }
.axis-list .eq { flex: 0 0 auto; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; height: fit-content; }
.axis-list .eq.same { background: #e7efff; color: #1a4fd0; } .axis-list .eq.diff { background: #fdeee0; color: #c2680c; }
.tip-box { background: #f6f9ff; border: 1px solid #dfe6ff; border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.tip-box p { margin: 4px 0; font-size: .92rem; }
.type-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.type-links a { flex: 1; min-width: 140px; text-align: center; text-decoration: none; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px; color: var(--text); font-weight: 600; }
.type-links a:hover { border-color: var(--primary); color: var(--primary); }

/* 16x16 매트릭스 */
.matrix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 6px; }
table.matrix { border-collapse: collapse; font-size: .62rem; }
table.matrix th, table.matrix td { width: 30px; height: 30px; text-align: center; border: 1px solid var(--border); }
table.matrix thead th { position: sticky; top: 0; background: var(--card); font-weight: 700; z-index: 1; }
table.matrix tbody th { position: sticky; left: 0; background: var(--card); font-weight: 700; z-index: 1; }
table.matrix td { cursor: pointer; color: #333; font-weight: 700; }
table.matrix td.gr-best { background: #bfe9cf; } table.matrix td.gr-good { background: #cfe0ff; }
table.matrix td.gr-soso { background: #fbeeba; } table.matrix td.gr-learn { background: #fad8bb; }
table.matrix td.me { outline: 2px solid var(--primary); outline-offset: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .78rem; margin-top: 8px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; } .legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }

/* 유형 글 안의 궁합 위젯 */
.compat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compat-grid h4 { margin: 0 0 6px; font-size: .95rem; }
.compat-grid .ci { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: .9rem; }
.compat-grid .ci:first-of-type { border-top: none; }
.compat-grid a { text-decoration: none; color: var(--text); font-weight: 600; }
.disclaimer-box { font-size: .82rem; color: var(--muted); background: #f8f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 14px; }

/* ── 테스트 페이지 ── */
.intro-facts { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.intro-facts li { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: .86rem; font-weight: 600; color: var(--text); }
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pbar { flex: 1; height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.pbar > #pbarFill { height: 100%; background: var(--primary); width: 0; transition: width .25s ease; }
.pcount { font-size: .86rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.pcount b { color: var(--primary); font-size: 1.05rem; }
.q-item { padding: 16px 0; border-top: 1px solid var(--border); }
.q-item:first-child { border-top: none; padding-top: 2px; }
.q-text { margin: 0 0 12px; font-size: 1rem; line-height: 1.55; }
.q-text b { color: var(--primary); margin-right: 3px; }
.opt-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.opt-row .end { font-size: .7rem; color: var(--muted); line-height: 1.15; text-align: center; flex: 0 0 auto; width: 34px; }
.opt-row .end.d { text-align: right; } .opt-row .end.a { text-align: left; }
.opt { -webkit-appearance: none; appearance: none; background: #fff; border: 2px solid var(--border); border-radius: 50%; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: transform .1s, border-color .1s, background .1s; }
.opt > span { display: block; border-radius: 50%; }
.opt-s2 { width: 44px; height: 44px; } .opt-s1 { width: 36px; height: 36px; } .opt-s0 { width: 30px; height: 30px; }
.opt.side-d { border-color: #e59aa6; } .opt.side-a { border-color: #8fc6a3; } .opt.side-n { border-color: #c3c8d4; }
.opt:hover { transform: scale(1.08); }
.opt.is-on.side-d { background: #e05a74; border-color: #e05a74; }
.opt.is-on.side-a { background: #35a56e; border-color: #35a56e; }
.opt.is-on.side-n { background: #8b93a7; border-color: #8b93a7; }
.opt.is-on > span { width: 38%; height: 38%; background: #fff; }
.quiz-nav { display: flex; gap: 10px; margin-top: 18px; }
.quiz-nav .btn-ghost { flex: 0 0 auto; min-width: 96px; }
.quiz-nav .btn-primary { flex: 1; }
.scale-legend { text-align: center; font-size: .78rem; margin: 10px 0 0; }

/* 결과 */
.rt-code { font-size: 2.8rem; font-weight: 800; letter-spacing: 2px; color: var(--primary); line-height: 1; }
.rt-nick { font-size: 1.15rem; font-weight: 700; margin-top: 4px; }
.rt-h { font-size: 1rem; margin: 18px 0 8px; }
.axis-bars { list-style: none; padding: 0; margin: 0; }
.axis-bars li { padding: 8px 0; }
.ab-row { display: flex; justify-content: space-between; font-size: .84rem; margin-bottom: 5px; color: var(--muted); }
.ab-row .win { color: var(--primary); font-weight: 800; }
.ab-bar { height: 10px; background: #8fc6a3; border-radius: 999px; overflow: hidden; }
.ab-fill { height: 100%; background: #6c8cff; }
.rt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.rt-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.rt-box h4 { margin: 0 0 8px; font-size: .92rem; }
.rt-box ul { margin: 0; padding-left: 18px; } .rt-box li { font-size: .9rem; line-height: 1.5; margin: 4px 0; }
.rt-box.up { background: #f1f8f4; border-color: #cfe8d9; }
.rt-box.care { background: #fbf6ef; border-color: #ecdcc4; }

/* ── 유형 글(/posts/mbti-*.html) ── */
.mbti-article .mbti-tabs { padding: 0; margin: 14px 0 18px; }
/* /css/style.css 에 없는 버튼·광고 보강 */
.mbti-article .btn-primary, .mbti-article .btn-ghost { display: inline-block; text-decoration: none; text-align: center; font-weight: 700; border-radius: 10px; padding: 11px 18px; font-size: .95rem; cursor: pointer; border: 1px solid transparent; }
.mbti-article .btn-primary { background: var(--primary); color: #fff; }
.mbti-article .btn-ghost { background: var(--card); color: var(--primary); border-color: var(--primary); }
.mbti-article .ad-container { margin: 18px 0; text-align: center; min-height: 1px; }
.glance-box { background: #f6f8ff; border: 1px solid #dfe6ff; border-radius: 14px; padding: 16px 18px; margin: 4px 0 16px; }
.glance-box .gb-h { font-size: 1rem; margin: 0 0 10px; color: var(--primary); }
.gb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.gb-grid > div { margin: 0; }
.gb-grid dt { font-size: .76rem; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.gb-grid dd { margin: 0; font-size: .92rem; font-weight: 600; line-height: 1.4; }
.toc-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px 12px 18px; margin: 0 0 16px; }
.toc-box > b { font-size: .9rem; }
.toc-box ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 20px; }
.toc-box li { font-size: .88rem; margin: 3px 0; } .toc-box a { color: var(--text); text-decoration: none; }
.toc-box a:hover { color: var(--primary); text-decoration: underline; }
.mini-tbl { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: .9rem; }
.mini-tbl th, .mini-tbl td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.mini-tbl thead th { background: var(--bg); font-size: .85rem; }
.mini-tbl td:first-child { white-space: nowrap; font-weight: 600; }
.job-tbl td:first-child { color: var(--primary); }
.shadow-tag { font-size: .68rem; font-weight: 700; color: #c2680c; background: #fdeee0; border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.sw-tbl { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .9rem; }
.sw-tbl th, .sw-tbl td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; width: 50%; }
.sw-tbl thead th { background: var(--bg); } .sw-tbl .tip { display: block; color: var(--primary); font-size: .82rem; margin-top: 3px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.two-col .tc { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.two-col .tc b { display: block; margin-bottom: 6px; font-size: .92rem; }
.two-col .tc ul { margin: 0; padding-left: 18px; } .two-col .tc li { font-size: .88rem; margin: 4px 0; }
.two-col .tc.up { background: #f1f8f4; border-color: #cfe8d9; } .two-col .tc.care { background: #fbf6ef; border-color: #ecdcc4; }
ul.recover { padding-left: 0; list-style: none; } ul.recover li { padding: 8px 0; border-top: 1px dashed var(--border); font-size: .92rem; line-height: 1.55; }
ul.recover li:first-child { border-top: none; }
ol.grow { padding-left: 22px; } ol.grow li { margin: 10px 0; line-height: 1.6; }
.compat-grid .ci { align-items: center; } .compat-grid .ci-s { margin-left: auto; }
.compat-grid .badge { font-size: .82rem; padding: 3px 10px; }
.compat-grid .ci-why { font-size: .86rem; color: var(--muted); margin: 0 0 8px; line-height: 1.5; }
.cta-box { background: linear-gradient(135deg,#eef3ff,#f7f0ff); border: 1px solid #dfe6ff; border-radius: 14px; padding: 18px; text-align: center; margin: 22px 0; }
.cta-box > p { margin: 0 0 12px; font-size: 1.02rem; }
.cta-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sib-h { font-size: 1rem; margin: 20px 0 10px; }
.sib-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sib-card { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 6px; color: var(--text); }
.sib-card b { color: var(--primary); font-size: 1rem; } .sib-card span { font-size: .74rem; color: var(--muted); text-align: center; }
.sib-card:hover { border-color: var(--primary); } .sib-card.hub b { color: #a9800c; }
.hub-group { margin: 14px 0; } .hub-group h3 { font-size: 1rem; margin: 0 0 8px; }
.hub-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hub-types a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 6px; color: var(--text); }
.hub-types a b { color: var(--primary); } .hub-types a span { font-size: .74rem; color: var(--muted); text-align: center; }
.hub-types a:hover { border-color: var(--primary); }
.mbti-article .faq-section h3 { font-size: .98rem; margin: 14px 0 4px; }
.mbti-article .disclaimer-box { margin-top: 20px; }

@media (max-width: 560px) {
  .score3 { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .compat-grid { grid-template-columns: 1fr; }
  .mbti-tab { flex-basis: calc(50% - 8px); }
  .score-hero .num { font-size: 2.4rem; }
  .opt-row { gap: 6px; }
  .opt-s2 { width: 40px; height: 40px; } .opt-s1 { width: 33px; height: 33px; } .opt-s0 { width: 28px; height: 28px; }
  .opt-row .end { width: 28px; font-size: .64rem; }
  .rt-two { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .sib-grid, .hub-types { grid-template-columns: repeat(2, 1fr); }
  .toc-box ol { columns: 1; }
  .gb-grid { grid-template-columns: 1fr; }
}
