/* 베스트밸류 — 올리브 + 회녹색 바탕, 잡지형 */
:root {
  --olive: #3f4a1d;
  --olive-dark: #2c3414;
  --olive-soft: #e6e9dc;
  --ink: #1f2119;
  --muted: #565a4c;
  --line: #d6d9cc;
  --bg: #f4f4ef;
  --white: #ffffff;
  --radius: 6px;
  --wrap: 1100px;
  --serif: "Gowun Batang", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Nanum Gothic", system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: 17px; line-height: 1.85; color: var(--ink); background: var(--bg); word-break: keep-all; overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--olive); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .6em; }
h1, h2, .serif-head { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(32px, 5vw, 56px); }
h2 { font-size: clamp(23px, 2.6vw, 31px); }
h3 { font-size: 19px; font-weight: 800; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section { padding: 60px 0; }
.section.tone { background: var(--white); }
.note { color: var(--muted); font-size: 15.5px; margin-top: 18px; }
.more { font-weight: 800; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: var(--radius); font: inherit; font-weight: 800; font-size: 16px; text-decoration: none; border: 2px solid var(--olive); white-space: nowrap; }
.btn-main { background: var(--olive); color: #fff; }
.btn-main:hover { background: var(--olive-dark); border-color: var(--olive-dark); color: #fff; }
.btn-line { background: transparent; color: var(--olive); }
.btn-line:hover { background: var(--olive-soft); }
.btn-sm { min-height: 40px; font-size: 15px; padding: 0 14px; }
.kcode { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--olive-dark); background: var(--olive-soft); padding: 1px 7px; border-radius: 4px; }

/* 머리말 */
.site-header { background: var(--bg); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo-mark { width: 30px; height: 30px; }
.logo-mark path { fill: var(--olive); }
.logo-mark .lm-vein { fill: none; stroke: var(--bg); stroke-width: 2.2; stroke-linecap: round; }
.logo-text { font-family: var(--serif); font-weight: 700; font-size: 23px; }
.main-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.main-nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; font-weight: 700; font-size: 16px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--olive); text-decoration: underline; text-decoration-thickness: 2px; }
.main-nav .nav-cta { border: 2px solid var(--olive); border-radius: var(--radius); color: var(--olive); margin-left: 6px; }
.main-nav .nav-cta:hover { background: var(--olive); color: #fff; text-decoration: none; }
.menu-toggle { display: none; align-items: center; gap: 6px; margin-left: auto; height: 40px; padding: 0 12px; border: 2px solid var(--ink); background: transparent; border-radius: var(--radius); font: inherit; font-weight: 800; font-size: 15px; color: var(--ink); cursor: pointer; }
.ico svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; display: block; }

/* 첫 화면 */
.hero { padding: 52px 0 60px; }
.hero-in { display: grid; grid-template-columns: .95fr 1.05fr; gap: 52px; align-items: end; }
.eyebrow { font-family: var(--serif); font-size: 18px; color: var(--olive); border-bottom: 2px solid var(--ink); display: inline-block; padding-bottom: 2px; }
.hero h1 { white-space: nowrap; font-size: clamp(36px, 6.4vw, 72px); line-height: 1.1; margin-top: 10px; }
.hero-lead { font-size: 18.5px; color: var(--muted); }
.hero-photo { margin: 0; max-height: 520px; overflow: hidden; border-radius: var(--radius); }
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* 추천템 목록 */
.picks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; border-top: 2px solid var(--ink); }
.picks li { display: grid; grid-template-columns: 54px 1fr; gap: 14px; padding: 22px 0; border-bottom: 2px solid var(--line); }
.pk-no { font-family: var(--serif); font-size: 30px; color: var(--olive); line-height: 1.1; }
.pk-body h3 { font-family: var(--serif); font-size: 23px; margin-bottom: 2px; }
.pk-body h3 a { color: var(--ink); }
.pk-item { color: var(--muted); margin-bottom: 8px; }
.pk-body dl { margin: 0; font-size: 15.5px; }
.pk-body dl div { display: flex; gap: 10px; }
.pk-body dt { font-weight: 800; min-width: 7.5em; color: var(--olive-dark); }
.pk-body dd { margin: 0; }

.how { padding-left: 1.3em; }
.how li { margin-bottom: .7em; }
.before { list-style: none; padding: 0; margin: 0; }
.before li { padding: 14px 0; border-bottom: 2px solid var(--line); }
.before strong { display: block; font-family: var(--serif); font-size: 19px; }

/* 코드 카드 (잡지형) */
.code-cards.mag { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 40px; }
.mag .code-card { display: flex; flex-direction: column; }
.mag .cc-photo img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.mag .cc-body { padding-top: 14px; border-top: 0; display: flex; flex-direction: column; flex: 1; }
.cc-body h3 { font-family: var(--serif); font-size: 23px; margin-bottom: 2px; }
.cc-body h3 a { color: var(--ink); text-decoration: none; }
.cc-body h3 a:hover { text-decoration: underline; }
.cc-rate { font-weight: 800; color: var(--olive); margin: 0 0 2px; }
.cc-brief { color: var(--muted); font-size: 15.5px; flex: 1; }
.mag .btn { align-self: flex-start; }
.code-rows { list-style: none; padding: 0; margin: 0; }
.code-rows li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 2px solid var(--line); }
.cr-no { font-family: var(--serif); font-size: 26px; color: var(--olive); width: 28px; }
.cr-body { flex: 1; }
.cr-body h3 { margin: 0; }
.cr-body h3 a { color: var(--ink); }
.cr-rate, .cr-brief { margin: 0; font-size: 16px; }
.cr-brief { color: var(--muted); }

.table-scroll { overflow-x: auto; margin: 0 0 1em; }
.info-table, .code-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.info-table thead th, .code-table thead th { text-align: left; padding: 10px 12px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-weight: 800; white-space: nowrap; }
.info-table td, .info-table tbody th, .code-table td, .code-table tbody th { padding: 12px; border-bottom: 2px solid var(--line); text-align: left; }
.info-table tbody th { font-weight: 800; }
.spec-table tbody th { width: 9em; color: var(--muted); white-space: nowrap; }

.steps, .checklist { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 2px solid var(--line); }
.step-no { font-family: var(--serif); font-size: 26px; color: var(--olive); min-width: 28px; line-height: 1.2; }
.steps h3 { margin: 0 0 2px; }
.steps p, .checklist p { margin: 0; color: var(--muted); }
.checklist li { padding: 14px 0; border-bottom: 2px solid var(--line); }
.checklist h3 { margin: 0 0 2px; }
.faq { border-bottom: 2px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-family: var(--serif); font-size: 19px; }
.faq[open] .ico { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 0 18px; color: var(--muted); }
.digest-item { padding: 12px 0; border-bottom: 2px solid var(--line); }
.digest-item h3 span { color: var(--olive); font-size: 16px; margin-left: 6px; }
.digest-item p { margin: 0; color: var(--muted); }
.directory { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; border-top: 2px solid var(--ink); }
.directory li { padding: 14px 0; border-bottom: 2px solid var(--line); }
.directory a { font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--ink); }
.directory p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }

/* 안쪽 페이지 */
.breadcrumb { font-size: 15px; color: var(--muted); padding-top: 18px; }
.breadcrumb a { color: var(--muted); }
.page-head { padding: 22px 0 40px; border-bottom: 2px solid var(--ink); }
.page-head.has-photo .page-head-in, .detail-head-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: end; }
.page-lead { font-size: 18.5px; color: var(--muted); }
.page-head-photo, .detail-photo, .text-photo { margin: 0; border-radius: var(--radius); overflow: hidden; }
.detail-rate { font-size: 22px; font-weight: 800; color: var(--olive); }
.text-block { margin-bottom: 40px; }
.text-block h2 { border-top: 2px solid var(--ink); padding-top: 14px; }
.plain-list, .num-list { padding-left: 1.3em; }
.plain-list li, .num-list li { margin-bottom: .55em; }
.cta-strip { background: var(--olive); color: #fff; }
.cta-strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cta-strip p { margin: 0; font-weight: 800; }
.cta-strip .btn-main { background: #fff; color: var(--olive-dark); border-color: #fff; }
.more-menu ul, .related-list { list-style: none; padding: 0; margin: 0; }
.more-menu ul { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.more-menu a { font-weight: 700; }
.related-list li { padding: 8px 0; border-bottom: 2px solid var(--line); }
.related-list span { color: var(--muted); font-size: 15px; }
.back-link { margin-top: 18px; font-weight: 800; }
.notfound { text-align: center; padding: 90px 0; }

/* 꼬리말 */
.site-footer { background: var(--olive-dark); color: #dfe3d2; padding: 48px 0 30px; }
.site-footer a { color: #fff; }
.footer-name { font-family: var(--serif); font-size: 26px; font-weight: 700; color: #fff; margin: 0; }
.footer-tag { max-width: 40em; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 24px 0; padding-top: 20px; border-top: 2px solid #4b5530; }
.footer-cols nav { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.footer-cols .strong { font-weight: 800; }
.footer-title { font-weight: 800; color: #fff; margin: 0 0 4px; }
.disclaimer { font-size: 15px; color: #c7cdb6; }
.to-top { font-weight: 800; }

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); flex-direction: column; align-items: stretch; padding: 8px 20px 16px; border-bottom: 2px solid var(--ink); }
  .nav-open .main-nav { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 2px solid var(--line); }
  .main-nav .nav-cta { margin: 10px 0 0; text-align: center; }
  .hero-in, .page-head.has-photo .page-head-in, .detail-head-in { grid-template-columns: 1fr; }
  .picks { grid-template-columns: 1fr; }
  .directory { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .section { padding: 42px 0; }
  .hero { padding: 30px 0 36px; }
  .hero h1 { font-size: clamp(32px, 11vw, 46px); }
  .hero-photo { max-height: 300px; }
  .code-cards.mag { grid-template-columns: 1fr; }
  .mag .btn { align-self: stretch; }
  .pk-body dl div { flex-direction: column; gap: 0; }
  .directory { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  .code-rows li { flex-wrap: wrap; }
  .code-rows .btn { width: 100%; }
}

/* 그리드 칸이 표·버튼 때문에 넘치지 않게 */
.hero-in > *, .split-in > *, .two-col > *, .two > *, .page-head-in > *, .detail-head-in > *, .code-cards > *, .code-card > *, .footer-top > *, .footer-row > *, .footer-grid > *, .footer-cols > * { min-width: 0; }
@media (max-width: 560px) { .btn { white-space: normal; text-align: center; max-width: 100%; } }
