/*
Theme Name: Bichaek
Theme URI: https://law.edownl.com
Author: 생활비책
Description: 생활 법률 해설 사이트 생활비책 전용 테마. 모바일에서 표, 목록, 버튼을 읽기 쉽게 만든 클래식 테마입니다.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: bichaek
*/

:root {
  --paper: #f7f3ea;
  --paper-2: #efe8da;
  --white: #fffdf8;
  --ink: #1c1b19;
  --text: #33302b;
  --muted: #6b655b;
  --rule: #ddd3c1;
  --rule-strong: #c4b69d;
  --wine: #7a1f2b;
  --wine-deep: #5e1520;
  --wine-soft: #f6e9e6;
  --brass: #b08d57;
  --brass-soft: #f3ead8;
  --green: #2f5d50;
  --wrap: 1140px;
  --read: 720px;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Apple SD Gothic Neo", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.4; letter-spacing: -0.02em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.read { max-width: var(--read); margin: 0 auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; width: auto; height: auto; clip: auto; padding: 10px 14px; background: var(--ink); color: #fff; }

/* ---------- 머리 ---------- */
.site-top { background: var(--ink); color: #d9d2c4; font-size: 13px; }
.site-top .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; }
.site-top a { color: #efe6d4; }
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--rule); }
.site-header .bar { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--wine); color: var(--paper); font-family: var(--serif); font-weight: 700; font-size: 19px; border-bottom: 3px solid var(--brass); }
.brand-mark img { width: 34px; height: 34px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: -0.03em; line-height: 1.1; }
.brand-sub { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.head-search { margin-left: auto; }
.head-search form { display: flex; border: 1px solid var(--rule-strong); background: #fff; }
.head-search input { width: 220px; border: 0; padding: 9px 12px; font-size: 15px; background: transparent; min-width: 0; }
.head-search button { border: 0; background: var(--ink); color: #fff; padding: 0 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.cat-nav { border-top: 1px solid var(--rule); background: var(--paper); }
.cat-nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-nav ul::-webkit-scrollbar { display: none; }
.cat-nav a { display: block; padding: 11px 12px; font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; }
.cat-nav a:hover, .cat-nav .current-menu-item > a, .cat-nav .current-cat > a { color: var(--wine); border-bottom-color: var(--wine); }

/* ---------- 첫 화면 ---------- */
.hero { position: relative; background: var(--paper); border-bottom: 1px solid var(--rule); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(247,243,234,0) 30%, rgba(247,243,234,.92) 55%, var(--paper) 70%); }
.hero .wrap { position: relative; z-index: 1; display: flex; justify-content: flex-end; }
.hero-box { width: min(520px, 100%); padding: 64px 0 60px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--wine); border-bottom: 1px solid var(--brass); padding-bottom: 4px; margin-bottom: 18px; }
.hero h1 { font-family: var(--serif); font-size: 38px; line-height: 1.32; font-weight: 700; }
.hero p.lead { margin-top: 16px; font-size: 17px; color: var(--text); }
.hero-search { margin-top: 26px; display: flex; background: #fff; border: 1px solid var(--ink); }
.hero-search input { flex: 1; min-width: 0; border: 0; padding: 15px 16px; font-size: 16px; background: transparent; }
.hero-search button { border: 0; background: var(--wine); color: #fff; padding: 0 22px; font-weight: 700; font-size: 16px; cursor: pointer; }
.hero-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14.5px; }
.hero-tags span { color: var(--muted); }
.hero-tags a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 4px; }

.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.sec-head h2 { font-family: var(--serif); font-size: 25px; }
.sec-head a { font-size: 14.5px; font-weight: 600; }

.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.field { display: block; padding: 22px 20px 20px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--text); text-decoration: none !important; background: var(--white); transition: background .15s; }
.field:hover { background: var(--paper); }
.field-no { font-family: var(--serif); font-size: 13px; color: var(--brass); font-weight: 700; }
.field h3 { margin-top: 6px; font-family: var(--serif); font-size: 19px; }
.field p { margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.field .count { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--wine); }

.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.post-item { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.post-item .cat { font-size: 13px; font-weight: 700; color: var(--wine); }
.post-item h3 { margin-top: 4px; font-size: 18px; line-height: 1.45; font-weight: 700; }
.post-item h3 a { color: var(--ink); }
.post-item p { margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-item .date { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.empty-note { padding: 22px; background: var(--paper); border: 1px solid var(--rule); color: var(--muted); }

.basis-strip { background: var(--ink); color: #e9e1d1; }
.basis-strip .sec-head { border-bottom-color: var(--brass); }
.basis-strip .sec-head h2 { color: #fff; }
.basis-strip .sec-head a { color: #e7c995; }
.basis-cols { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px; }
.basis-cols h3 { color: #fff; font-family: var(--serif); font-size: 18px; }
.basis-cols h3::before { content: "§ "; color: var(--brass); }
.basis-cols p { margin-top: 8px; font-size: 15px; line-height: 1.7; color: #cfc6b5; }

/* ---------- 목록·검색 ---------- */
.archive-head { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 40px 0 32px; }
.archive-head h1 { font-family: var(--serif); font-size: 30px; }
.archive-head p { margin-top: 10px; color: var(--muted); max-width: 680px; }
.pagination { margin: 36px 0 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--rule-strong); color: var(--ink); font-weight: 600; text-decoration: none; padding: 0 10px; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- 글 ---------- */
.crumbs { font-size: 13.5px; color: var(--muted); padding-top: 22px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 6px; color: var(--rule-strong); }
.entry-head { padding: 14px 0 26px; border-bottom: 1px solid var(--rule); }
.entry-cat { display: inline-block; font-size: 13.5px; font-weight: 700; color: var(--wine); }
.entry-title { margin-top: 8px; font-family: var(--serif); font-size: 32px; line-height: 1.38; font-weight: 700; }
.entry-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); }
.entry-meta strong { color: var(--ink); font-weight: 600; }
.entry-thumb { margin: 26px 0 0; }
.entry-thumb img { width: 100%; border: 1px solid var(--rule); }

.toc { margin: 28px 0; border: 1px solid var(--rule-strong); background: var(--paper); }
.toc summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "접기"; font-size: 13px; font-weight: 600; color: var(--muted); }
.toc:not([open]) summary::after { content: "펼치기"; }
.toc ol { margin: 0; padding: 0 18px 16px 18px; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; padding: 7px 0; border-top: 1px dashed var(--rule); font-size: 15.5px; line-height: 1.5; display: flex; gap: 10px; }
.toc li::before { content: counter(t) "."; font-family: var(--serif); font-weight: 700; color: var(--wine); min-width: 18px; }
.toc a { color: var(--text); }
.entry-content .toc ol > li { padding-left: 0; margin-top: 0; counter-increment: t; }
.entry-content .toc ol > li::before { content: counter(t) "."; position: static; width: auto; height: auto; min-width: 18px; display: inline-block; background: none; color: var(--wine); font-family: var(--serif); font-size: 15.5px; font-weight: 700; line-height: 1.5; }

/* 글 화면: 본문 + 옆 목차 */
.post-layout { display: grid; grid-template-columns: minmax(0, var(--read)) 250px; gap: 56px; justify-content: center; align-items: start; }
.post-main { min-width: 0; }
.post-side { position: sticky; top: 128px; margin-top: 140px; max-height: calc(100vh - 150px); overflow-y: auto; }
.toc-side { border-top: 2px solid var(--ink); padding-top: 12px; font-size: 14.5px; line-height: 1.5; }
.toc-title { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.toc-side ol { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.toc-side ol > li { counter-increment: s; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.toc-side ol > li > a { display: grid; grid-template-columns: 22px 1fr; color: var(--ink); font-weight: 600; text-decoration: none; }
.toc-side ol > li > a::before { content: counter(s) "."; font-family: var(--serif); color: var(--wine); }
.toc-side ul { margin: 6px 0 0 22px; padding: 0; list-style: none; }
.toc-side ul li { padding: 3px 0; }
.toc-side ul a { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.toc-side a:hover { color: var(--wine); }
/* 휴대폰·태블릿 목차: 오른쪽 아래 버튼 → 아래에서 올라오는 창 */
.toc-mobile { display: none; }
@media (max-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, var(--read)); }
  .post-side { display: none; }
  .toc-mobile { display: block; }
  .toc-mobile summary { position: fixed; right: 16px; bottom: 18px; z-index: 70; list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 18px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; border-radius: 23px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary::before { content: ""; width: 14px; height: 10px; border-top: 2px solid #fff; border-bottom: 2px solid #fff; background: linear-gradient(#fff, #fff) center / 100% 2px no-repeat; }
  .toc-mobile .t-close, .toc-mobile[open] .t-open { display: none; }
  .toc-mobile[open] .t-close { display: inline; }
  .toc-mobile[open] summary { background: var(--wine); }
  .toc-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; max-height: 72vh; overflow-y: auto; background: var(--white); padding: 20px 20px 84px; border-top: 3px solid var(--ink); box-shadow: 0 -10px 30px rgba(0,0,0,.22); }
  .toc-sheet .toc-side { border-top: 0; padding-top: 0; font-size: 16px; }
  .toc-sheet .toc-side ol > li { padding: 11px 0; }
  .toc-sheet .toc-side ul a { font-size: 15px; }
  .toc-sheet .toc-side ul li { padding: 5px 0; }
}

/* 본문 */
.entry-content { padding: 6px 0 10px; }
.entry-content > * + * { margin-top: 20px; }
.entry-content p { line-height: 1.85; }
.entry-content h2 { margin-top: 56px; padding-top: 18px; border-top: 2px solid var(--ink); font-family: var(--serif); font-size: 25px; line-height: 1.42; }
.entry-content h2::before { content: "§"; display: block; font-size: 15px; color: var(--brass); margin-bottom: 4px; font-weight: 700; }
.entry-content h3 { margin-top: 36px; font-size: 20px; line-height: 1.45; padding-left: 12px; border-left: 4px solid var(--wine); }
.entry-content h4 { margin-top: 28px; font-size: 17.5px; color: var(--wine); }
.entry-content strong { color: var(--ink); font-weight: 700; }
.entry-content mark { background: linear-gradient(transparent 55%, #f2dca8 55%); color: inherit; padding: 0 1px; }
.entry-content a { text-decoration: underline; text-decoration-color: rgba(122,31,43,.35); text-underline-offset: 3px; }
.entry-content img { border: 1px solid var(--rule); }
.entry-content .wp-block-image img { display: block; width: 100%; max-width: 600px; margin: 0 auto; }
.entry-content .wp-block-image figcaption { max-width: 600px; margin-left: auto; margin-right: auto; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { margin-top: 8px; font-size: 13.5px; color: var(--muted); text-align: left; }

/* 목록: 크게, 간격 넉넉히 */
.entry-content ul, .entry-content ol { padding: 0; list-style: none; }
.entry-content ul li, .entry-content ol li { position: relative; padding-left: 26px; line-height: 1.75; }
.entry-content ul li + li, .entry-content ol li + li { margin-top: 10px; }
.entry-content ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 7px; height: 7px; background: var(--wine); }
.entry-content ol { counter-reset: n; }
.entry-content ol > li { counter-increment: n; padding-left: 36px; }
.entry-content ol > li::before { content: counter(n); position: absolute; left: 0; top: .15em; width: 25px; height: 25px; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1; }
.entry-content li ul, .entry-content li ol { margin-top: 10px; }
.entry-content li li::before { background: var(--brass); }

/* 단계형 목록 (블록 스타일: 단계) */
.entry-content ol.is-style-steps { border-left: 2px solid var(--rule-strong); margin-left: 12px; }
.entry-content ol.is-style-steps > li { padding: 0 0 4px 30px; }
.entry-content ol.is-style-steps > li + li { margin-top: 18px; }
.entry-content ol.is-style-steps > li::before { left: -14px; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--wine); }
/* 확인 목록 (블록 스타일: 체크) */
.entry-content ul.is-style-check > li::before { content: "✓"; width: auto; height: auto; background: none; color: var(--green); font-weight: 800; top: 0; left: 2px; }

/* 표: 모바일 기본은 폭 맞춤, 4열 이상은 카드 */
.tbl { margin-top: 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 2px solid var(--ink); }
.entry-content .wp-block-table { margin: 22px 0 0; overflow: visible; }
.entry-content .wp-block-table .tbl { margin-top: 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.6; }
.entry-content table th, .entry-content table td { border: 0; border-bottom: 1px solid var(--rule); padding: 12px 12px; text-align: left; vertical-align: top; }
.entry-content table thead th, .entry-content table tr.th-row td { background: var(--paper); color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--rule-strong); }
.entry-content table td:first-child { font-weight: 600; color: var(--ink); }
.entry-content .wp-block-table thead { border-bottom: 0; }
.entry-content .wp-block-table figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

/* 상자: 핵심 요약 / 주의 / 조문 인용 */
.entry-content .is-style-point { background: var(--brass-soft); border-left: 4px solid var(--brass); padding: 18px 20px; }
.entry-content .is-style-caution { background: var(--wine-soft); border-left: 4px solid var(--wine); padding: 18px 20px; }
.entry-content .is-style-point > * + *, .entry-content .is-style-caution > * + * { margin-top: 10px; }
.entry-content blockquote, .entry-content .wp-block-quote { margin: 24px 0 0; padding: 20px 22px; background: var(--paper); border: 1px solid var(--rule-strong); border-left: 4px solid var(--ink); font-size: 16px; }
.entry-content blockquote p { line-height: 1.8; }
.entry-content blockquote cite, .entry-content .wp-block-quote cite { display: block; margin-top: 10px; font-size: 13.5px; font-style: normal; font-weight: 700; color: var(--wine); }
.entry-content .wp-block-quote.is-style-statute { font-family: var(--serif); background: var(--white); border: 1px solid var(--rule-strong); border-top: 3px double var(--ink); }
.entry-content .wp-block-quote.is-style-statute::before { content: "법령 원문"; display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--brass); margin-bottom: 8px; }

/* 버튼: 손가락으로 누르기 쉽게 */
.entry-content .wp-block-buttons { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.wp-block-button__link, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 14px 24px; background: var(--wine); color: #fff !important; border-radius: 3px; font-size: 17px; font-weight: 700; line-height: 1.35; text-align: center; text-decoration: none !important; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.wp-block-button__link::after, .btn::after { content: "→"; font-weight: 400; }
.wp-block-button__link:hover, .btn:hover { background: var(--wine-deep); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--wine) !important; border: 2px solid var(--wine); box-shadow: none; }

/* 자주 묻는 질문 */
.entry-content .faq-q { margin-top: 18px; padding: 16px 18px 0 48px; border: 1px solid var(--rule-strong); border-bottom: 0; background: var(--white); font-size: 17.5px; position: relative; }
.entry-content .faq-q::before { content: "Q"; position: absolute; left: 16px; top: 13px; font-family: var(--serif); font-size: 20px; color: var(--wine); }
.entry-content .faq-a { margin-top: 0 !important; padding: 8px 18px 16px 48px; border: 1px solid var(--rule-strong); border-top: 0; background: var(--white); }
.entry-content .faq-a.faq-more { padding-top: 0; }

/* 근거 자료 절 */
.entry-content .basis-list { border: 1px solid var(--rule-strong); background: var(--paper); padding: 16px 18px; font-size: 15px; }
.entry-content .basis-list > li::before { content: "§"; width: auto; height: auto; background: none; color: var(--brass); font-weight: 700; top: 0; left: 4px; }

/* 글 끝: 작성 근거 · 필자 · 관련 글 */
.basis-note { margin-top: 48px; border-top: 3px double var(--ink); border-bottom: 1px solid var(--rule); padding: 20px 0; font-size: 15px; }
.basis-note h2 { font-family: var(--serif); font-size: 17px; }
.basis-note dl { margin: 12px 0 0; display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; }
.basis-note dt { font-weight: 700; color: var(--ink); }
.basis-note dd { margin: 0; color: var(--text); }
.author-box { margin-top: 24px; display: flex; gap: 16px; padding: 20px; background: var(--paper); border: 1px solid var(--rule); }
.author-box .brand-mark { width: 48px; height: 48px; font-size: 24px; }
.author-box .brand-mark img { width: 48px; height: 48px; }
.author-box strong { display: block; color: var(--ink); font-size: 16px; }
.author-box p { margin-top: 6px; font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.related { margin-top: 48px; }
.related h2 { font-family: var(--serif); font-size: 21px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.related .post-list { grid-template-columns: 1fr; }

/* 고정 페이지 */
.page-body { padding: 40px 0 64px; }
.page-body .entry-title { margin-bottom: 26px; }

/* 문의 양식 */
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 input[type=url], .wpcf7 textarea, .wpcf7 select { width: 100%; padding: 13px 14px; border: 1px solid var(--rule-strong); background: #fff; font-size: 16px; }
.wpcf7 label { display: block; font-weight: 600; color: var(--ink); }
.wpcf7 input[type=submit] { min-height: 54px; padding: 0 28px; border: 0; background: var(--wine); color: #fff; font-weight: 700; font-size: 17px; cursor: pointer; width: 100%; }

/* ---------- 바닥 ---------- */
.site-footer { margin-top: 72px; background: var(--ink); color: #cfc6b5; font-size: 14.5px; }
.footer-basis { border-bottom: 1px solid #3a3731; padding: 32px 0; }
.footer-basis .brand { color: #fff; }
.footer-basis .brand-sub { color: #a89f8f; }
.footer-basis p { margin-top: 14px; max-width: 760px; line-height: 1.8; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 28px; padding: 32px 0; }
.footer-cols h2 { font-size: 14px; color: #fff; letter-spacing: .04em; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--brass); font-family: var(--sans); }
.footer-cols ul { margin: 0; padding: 0; list-style: none; }
.footer-cols li + li { margin-top: 9px; }
.footer-cols a { color: #e7dfcf; }
.footer-cols .tel { color: #a89f8f; font-size: 13px; }
.footer-bottom { border-top: 1px solid #3a3731; padding: 20px 0 28px; font-size: 13px; color: #9b927f; line-height: 1.8; }
.footer-bottom a { color: #cfc6b5; }

/* ---------- 태블릿 ---------- */
@media (max-width: 960px) {
  .fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-cols { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .basis-cols { grid-template-columns: 1fr; gap: 18px; }
  .head-search input { width: 160px; }
}

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  .site-top { display: none; }
  .site-header .bar { min-height: 56px; gap: 10px; }
  .brand-name { font-size: 19px; }
  .brand-sub { display: none; }
  .head-search { flex: 1; max-width: 190px; }
  .head-search input { width: 0; flex: 1; }
  .cat-nav a { padding: 10px 10px; font-size: 14.5px; }

  .hero::after { background: linear-gradient(180deg, rgba(247,243,234,0) 0%, rgba(247,243,234,.75) 34%, var(--paper) 52%); }
  .hero-img { height: 260px; object-position: 30% center; }
  .hero-box { padding: 150px 0 34px; }
  .hero h1 { font-size: 27px; }
  .hero p.lead { font-size: 15.5px; }
  .hero-search button { padding: 0 16px; }

  .section { padding: 40px 0; }
  .sec-head h2 { font-size: 21px; }
  .field { padding: 16px 14px; }
  .field h3 { font-size: 16.5px; }
  .field p { display: none; }
  .post-list { grid-template-columns: 1fr; }

  .entry-title { font-size: 25px; }
  .entry-content h2 { font-size: 21.5px; margin-top: 46px; }
  .entry-content h3 { font-size: 18.5px; }
  .entry-content table { font-size: 15px; }
  .entry-content table th, .entry-content table td { padding: 10px 8px; }

  /* 4열 이상 표 → 행마다 카드 */
  .tbl.is-cards { border-top: 0; overflow: visible; }
  .tbl.is-cards table, .tbl.is-cards tbody, .tbl.is-cards tr, .tbl.is-cards td { display: block; width: 100%; }
  .tbl.is-cards thead, .tbl.is-cards tr.th-row { display: none; }
  .tbl.is-cards tr { border: 1px solid var(--rule-strong); border-top: 3px solid var(--ink); margin-bottom: 12px; background: var(--white); }
  .tbl.is-cards td { display: grid; grid-template-columns: 38% 1fr; gap: 10px; padding: 10px 12px; }
  .tbl.is-cards td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: 14px; }
  .tbl.is-cards td:first-child { background: var(--paper); font-size: 16px; }
  .tbl.is-cards td:last-child { border-bottom: 0; }

  .entry-content .wp-block-buttons { flex-direction: column; }
  .wp-block-button, .wp-block-button__link, .btn { width: 100%; }
  .basis-note dl { grid-template-columns: 1fr; gap: 2px; }
  .basis-note dd { margin-bottom: 8px; }
  .author-box { flex-direction: column; gap: 10px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px 18px; }
}

/* 계산기 */
.entry-content .calc { margin-top: 24px; padding: 20px; background: var(--white); border: 1px solid var(--rule-strong); border-top: 4px solid var(--wine); }
.calc-title { font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--ink); margin-bottom: 14px !important; }
.calc-field { margin-top: 14px; }
.calc-label { display: block; font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.calc select, .calc-won input { width: 100%; min-height: 50px; padding: 0 14px; font-size: 17px; border: 1px solid var(--rule-strong); background: #fff; border-radius: 3px; -webkit-appearance: none; appearance: none; }
.calc select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; }
.calc-won { position: relative; }
.calc-won input { padding-right: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.calc-won span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; }
.calc input:focus, .calc select:focus { outline: 2px solid var(--wine); outline-offset: 1px; }
.calc-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calc-seg label { position: relative; }
.calc-seg input { position: absolute; opacity: 0; }
.calc-seg span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--rule-strong); font-size: 16px; font-weight: 600; cursor: pointer; background: #fff; }
.calc-seg input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.calc-seg input:focus-visible + span { outline: 2px solid var(--wine); outline-offset: 2px; }
.entry-content .calc-out { margin: 18px 0 0; border-top: 2px solid var(--ink); }
.calc-out div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.calc-out dt { font-size: 15px; color: var(--muted); }
.calc-out dd { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.calc-out .calc-main dd { font-size: 24px; color: var(--wine); }
.calc.is-minus .calc-main dd { color: var(--muted); }
.entry-content .calc-note { margin-top: 12px; font-size: 14px; line-height: 1.65; color: var(--muted); }
.calc.is-minus .calc-note { color: var(--wine); font-weight: 600; }
@media (max-width: 640px) { .entry-content .calc { padding: 16px; } .calc-out .calc-main dd { font-size: 22px; } }
