/* ==========================================================================
   site.css — 디자인 「조용한 장부」 (2026-11-06 확정). 첫 화면·업무 쪽과 글 쪽이 같은 토큰·부품을 쓴다.
   기준: 확정 시안의 토큰 두 벌(밝게 .qt · 어둡게 .qt-dark).

   - 토큰은 :root 에 둔다. 밝기는 <html data-theme="light|dark"> 가 정한다(머리의 인라인 스크립트가 첫 페인트 전에 단다).
     스크립트가 안 돌면 data-theme 이 없어 기기 설정(prefers-color-scheme)을 따른다.
   - 바탕(글꼴·배경·글자색·여백 0)과 부품(.btn · .chip · .tbl …)은 <body class="qt"> 를 단 쪽만 받는다 — :where(.qt) 로 묶었다.
     옛 쪽(관리자 화면 등)은 같은 이름의 자기 부품(.btn · .seg)이 있어서, 묶지 않으면 서로 섞인다(2026-11-06 확인).
     :where() 는 특정도를 더하지 않아 쪽마다 덮어쓰기 쉽다.
   - 머리·꼬리는 어느 쪽에나 들어간다. 그래서 부품 이름(.btn · .seg · .wrap) 대신 자기 이름(.site-*)만 쓰고,
     선택자 앞에 :root 를 붙여 옛 쪽의 요소 규칙(footer{} · body.dark-mode a{} · a:hover{})을 이긴다.
   - 이 파일은 다른 빌드의 css 폴더에도 통째로 복사된다. 주석에 서비스·회사 이름을 적지 않는다(누수 검사).
   ========================================================================== */

/* ── 1. 토큰 ── */
:root {
    --bg: #F7F6F3;
    --surface: #FFFFFF;
    --subtle: #EFEDE8;
    --line: #E2DFD8;
    --line-strong: #CBC7BE;
    --text: #1A1917;
    --text-2: #44413B;
    --text-3: #6A665E;
    --ink: #1A1917;
    --on-ink: #F7F6F3;
    --accent: #2B4A63;
    --accent-soft: #E7EDF2;
    --font-sans: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    --font-lat: 'Archivo', 'Noto Sans KR', system-ui, sans-serif;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #141412;
    --surface: #1B1B19;
    --subtle: #232320;
    --line: #302F2B;
    --line-strong: #47453F;
    --text: #EEECE7;
    --text-2: #C8C5BD;
    --text-3: #9C988F;
    --ink: #EEECE7;
    --on-ink: #141412;
    --accent: #A9C2D8;
    --accent-soft: #1E2932;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: #141412;
        --surface: #1B1B19;
        --subtle: #232320;
        --line: #302F2B;
        --line-strong: #47453F;
        --text: #EEECE7;
        --text-2: #C8C5BD;
        --text-3: #9C988F;
        --ink: #EEECE7;
        --on-ink: #141412;
        --accent: #A9C2D8;
        --accent-soft: #1E2932;
        color-scheme: dark;
    }
}

/* ── 2. 바탕 — <body class="qt"> 를 단 쪽 ── */
body.qt,
body.qt.dark-mode {
    margin: 0;
    max-width: none;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
    overflow-wrap: break-word;
    transition: none;
}
:where(.qt) a { color: inherit; text-decoration: none; }
:where(.qt) a:hover { color: var(--accent); }
:where(.qt) img { max-width: 100%; height: auto; }
:where(.qt) :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 3. 글자 — 크기 단계. 폰(≤860)은 큰 제목 32, 글 제목 26 ── */
:where(.qt) .lat { font-family: var(--font-lat); font-feature-settings: 'tnum' 1; }
:where(.qt) .eyebrow {
    font-family: var(--font-lat);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-3);
}
:where(.qt) .t-display { margin: 0; font-size: 44px; line-height: 1.22; font-weight: 700; letter-spacing: -.035em; }
:where(.qt) .t-title { margin: 0; font-size: 32px; line-height: 1.3; font-weight: 700; letter-spacing: -.025em; }
:where(.qt) .t-section { margin: 0; font-size: 28px; line-height: 1.4; font-weight: 700; letter-spacing: -.02em; }
:where(.qt) .t-heading { margin: 0; font-size: 21px; line-height: 1.45; font-weight: 700; letter-spacing: -.015em; }
:where(.qt) .t-lead { margin: 0; font-size: 17px; line-height: 1.85; color: var(--text-2); }
:where(.qt) .t-body { margin: 0; font-size: 16px; line-height: 1.85; }
:where(.qt) .t-small { font-size: 14px; color: var(--text-3); }

/* ── 4. 틀 ── */
:where(.qt) .wrap,
:root .site-head-in,
:root .site-drawer-in,
:root .site-foot-in { max-width: 1200px; margin: 0 auto; padding-left: 40px; padding-right: 40px; box-sizing: border-box; }
:where(.qt) .col { max-width: 720px; margin: 0 auto; padding-left: 24px; padding-right: 24px; box-sizing: content-box; }
:where(.qt) .skip-link {
    position: absolute;
    left: 16px;
    top: -200px;
    z-index: 100;
    background: var(--ink);
    color: var(--on-ink);
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
}
:where(.qt) .skip-link:focus { top: 16px; color: var(--on-ink); }
:where(.qt) .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── 5. 단추 — 높이 44 알약. 먹색(주)과 선(보조) 두 가지. 머리의 「문의」(.site-contact)도 같은 모양 ── */
:where(.qt) .btn,
:root .site-head .site-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    box-sizing: border-box;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
:where(.qt) .btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
:where(.qt) .btn-ink,
:root .site-head .site-contact { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
:where(.qt) .btn-ink:hover,
:root .site-head .site-contact:hover { color: var(--on-ink); opacity: .86; }
:where(.qt) .btn-line { background: transparent; color: var(--text); border-color: var(--line-strong); }
:where(.qt) .btn-line:hover { color: var(--text); border-color: var(--text); }
:where(.qt) .btn svg { flex: none; }
:where(.qt) .icon-btn,
:root .site-head .site-menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-2);
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    cursor: pointer;
}
:where(.qt) .icon-btn { display: inline-flex; }
:where(.qt) .icon-btn:hover,
:root .site-head .site-menu-btn:hover { background: var(--subtle); color: var(--text); }
:where(.qt) .text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 500;
    color: var(--accent);
}
:where(.qt) .text-link:hover { color: var(--text); }

/* ── 6. 주제 단추 — 고른 것은 먹색 ── */
:where(.qt) .chip {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-2);
    box-sizing: border-box;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
:where(.qt) .chip:hover { color: var(--text); border-color: var(--line-strong); }
:where(.qt) .chip.on,
:where(.qt) .chip[aria-pressed="true"],
:where(.qt) .chip[aria-current="page"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* ── 7. 글 카드 — 가는 선·둥근 20. 주제는 강조색 작은 글, 날짜는 Archivo ── */
:where(.qt) .post-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    box-sizing: border-box;
    min-width: 0;
}
:where(.qt) .post-card-body { display: flex; flex-direction: column; gap: 10px; }
:where(.qt) .post-card-topic { font-size: 13px; font-weight: 500; color: var(--accent); }
:where(.qt) .post-card-title { font-size: 17px; line-height: 1.5; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
:where(.qt) .post-card-date { font-family: var(--font-lat); font-feature-settings: 'tnum' 1; font-size: 13px; color: var(--text-3); }
:where(.qt) .post-card:hover { color: var(--text); }
:where(.qt) .post-card:hover .post-card-title { color: var(--accent); }

/* ── 8. 요약 상자 — subtle 바탕, 왼쪽 칸 이름(Insights-Article: 둥근 16 · 28/32 · 96px) ── */
:where(.qt) .summary-box {
    margin: 0;
    background: var(--subtle);
    border-radius: 16px;
    padding: 28px 32px;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px 20px;
    font-size: 16px;
    line-height: 1.7;
}
:where(.qt) .summary-box dt { padding-top: 2px; font-size: 13px; font-weight: 700; color: var(--text-3); }
:where(.qt) .summary-box dd { margin: 0; color: var(--text); }

/* ── 9. 표 — 머리줄 아래 1.5px 먹색 선, 행 사이 가는 선. 폰은 틀 안에서 가로로 민다 ── */
:where(.qt) .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
:where(.qt) .tbl { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
:where(.qt) .tbl th {
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-3);
    padding: 0 16px 12px 0;
    border-bottom: 1.5px solid var(--text);
    vertical-align: bottom;
}
:where(.qt) .tbl td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
:where(.qt) .tbl td.lat { white-space: nowrap; color: var(--text-2); }

/* ── 10. 출처 링크 — 강조색 + 옅은 밑줄 ── */
:where(.qt) .cite { color: var(--accent); font-size: 14px; border-bottom: 1px solid var(--accent-soft); }
:where(.qt) .cite:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── 11. 입력 칸 ── */
:where(.qt) .fld { display: flex; flex-direction: column; gap: 8px; }
:where(.qt) .fld label { font-size: 14px; font-weight: 500; color: var(--text-2); }
:where(.qt) .fld .req { color: var(--accent); margin-left: 2px; }
:where(.qt) .inp {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    box-sizing: border-box;
}
:where(.qt) .inp:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
:where(.qt) textarea.inp { height: 128px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
:where(.qt) select.inp {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
    background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 40px;
}

/* ── 12. 화면 밝기 선택 단추 묶음 — 꼬리의 .site-seg, 쪽 안의 .seg 가 같은 모양 ── */
:where(.qt) .seg,
:root .site-foot .site-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin: 0; border: 1px solid var(--line); border-radius: 999px; }
:root .site-foot .site-seg[hidden] { display: none; }
:where(.qt) .seg button,
:root .site-foot .site-seg button {
    height: 44px;
    padding: 0 16px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}
:where(.qt) .seg button:hover,
:root .site-foot .site-seg button:hover { color: var(--text); }
:where(.qt) .seg button[aria-pressed="true"],
:root .site-foot .site-seg button[aria-pressed="true"] { background: var(--subtle); color: var(--text); }

/* ── 13. 머리 ── */
:root .site-head {
    position: relative;
    z-index: 50;
    max-width: none;
    margin: 0;
    padding: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
}
:root .site-head a,
:root .site-head a:hover { text-decoration: none; }
:root .site-head :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root .site-head-in { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
/* 누르는 칸 44px — 이름은 위아래 10px(24 + 20), 메뉴는 높이 44 에 밑줄을 ::after 로(시안의 글자 아래 6px 자리) */
:root .site-head .site-name { display: flex; align-items: baseline; gap: 8px; padding: 10px 0; white-space: nowrap; color: var(--text); }
:root .site-head .site-name:hover { color: var(--text); }
.site-name-org { font-size: 14px; font-weight: 500; color: var(--text-3); }
.site-name-me { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.site-name-sep { display: none; }
.site-nav-main { display: flex; align-items: center; gap: 28px; }
.site-menu { display: flex; align-items: center; gap: 28px; }
:root .site-head .nav-a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
}
:root .site-head .nav-a:hover { color: var(--accent); }
:root .site-head .nav-a[aria-current="page"] { color: var(--text); }
:root .site-head .nav-a[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px; background: var(--text); }
.site-head-act { display: flex; align-items: center; gap: 10px; }
:root .site-head .site-menu-btn { display: none; }
:root .site-drawer { border-top: 1px solid var(--line); background: var(--bg); }
:root .site-drawer[hidden] { display: none; }
:root .site-drawer-in { display: flex; flex-direction: column; padding-top: 4px; padding-bottom: 16px; }
:root .site-drawer a {
    display: flex;
    align-items: center;
    min-height: 52px;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-2);
}
:root .site-drawer a:hover { color: var(--accent); background: none; }
:root .site-drawer a[aria-current="page"],
:root .site-drawer a.active { color: var(--text); font-weight: 700; }
/* 관리자 묶음(drafts 빌드만) — 옛 서랍의 구분선·묶음 이름 규칙(body.dark-mode …)을 덮는다 */
:root .site-drawer .nav-drawer-divider { height: 0; margin: 12px 0 0; border: 0; background: none; }
:root .site-drawer .nav-drawer-group-label {
    padding: 12px 0 4px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-3);
}
/* 폰 — 메뉴는 단추 뒤 서랍으로 */
@media (max-width: 860px) {
    .site-menu { display: none; }
    :root .site-head .site-menu-btn { display: inline-flex; }
    /* 폰에서도 사무소명(.site-name-org)을 보인다 — 「사무소명 · 이름」 작은 글씨 한 줄(2026-11-09 사용자 결정 S3-Q3 a).
       그 전에는 사무소명을 숨겨 이름만 보였다. 가운뎃점은 폰에서만 그린다(넓은 화면은 굵기 차이로 가른다).
       이 파일은 find-ref 빌드에도 실려 누수 검사를 받는다 — 주석에 상호를 적지 않는다 */
    :root .site-head-in { gap: 12px; }
    :root .site-head .site-name { gap: 4px; min-width: 0; padding: 12px 0; }
    .site-name-org, .site-name-sep { font-size: 13px; font-weight: 500; color: var(--text-3); }
    .site-name-sep { display: inline; }
    .site-name-me { font-size: 14px; }
}
/* 359px 이하(320 폭·크게 확대)는 이름 177px + 문의·메뉴 124px 가 안쪽 폭에 안 들어간다 — 글자를 13px 아래로 줄이지 않고 두 줄로 쌓는다 */
@media (max-width: 359px) {
    :root .site-head .site-name { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 0; line-height: 1.35; }
    .site-name-sep { display: none; }
}
/* 넓은 화면에서는 서랍을 쓰지 않는다 — 관리자 묶음이 있는 빌드(has-extra)만 단추를 남긴다 */
@media (min-width: 861px) {
    :root .site-head:not(.has-extra) .site-drawer { display: none; }
}
:root .site-head.has-extra .site-menu-btn { display: inline-flex; }
/* 옛 쪽(body.qt 없음 — 관리자 화면, 새 모양으로 옮기기 전의 글 쪽) — 옛 머리처럼 화면 위에 붙인다.
   옛 쪽은 body 자체가 800px 칸이라 그대로 두면 머리가 그 칸에 갇힌다. 옛 템플릿은 위 여백을 48px 막대에 맞춰 두었으니
   (calc(48px + 2rem)) 새 머리 높이 72px 로 바꾼다. :has() 로 머리가 있는 쪽만(머리 없는 약관 쪽은 그대로). */
body:not(.qt):has(.site-head) { padding-top: calc(72px + 2rem); }
/* 목차 등 쪽 안 링크로 옮겨 갈 때 제목이 붙은 머리 밑에 숨지 않게 */
html:has(body:not(.qt) .site-head) { scroll-padding-top: 88px; }
body:not(.qt) .site-head { position: fixed; top: 0; left: 0; right: 0; z-index: 1002; }
body:not(.qt) .site-drawer { max-height: calc(100vh - 73px); overflow-y: auto; }

/* ── 14. 꼬리 ── */
:root .site-foot {
    max-width: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    text-align: left;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    word-break: keep-all;
    transition: none;
}
:root .site-foot a,
:root .site-foot a:hover { text-decoration: none; }
:root .site-foot :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root .site-foot-in { padding-top: 40px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 24px; }
.site-foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 48px; }
.site-foot-name { font-size: 15px; font-weight: 700; color: var(--text); }
.site-foot-nav { display: flex; flex-wrap: wrap; column-gap: 24px; font-size: 14px; }
:root .site-foot .site-foot-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); }
:root .site-foot .site-foot-nav a:hover { color: var(--accent); }
.site-foot-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.site-foot-copy { font-family: var(--font-lat); font-feature-settings: 'tnum' 1; font-size: 13px; color: var(--text-3); }
/* 옛 쪽 — 꼬리는 800px 본문 칸 안에 그대로 둔다(옛 꼬리 자리). 칸 안이라 좌우 여백을 빼고, 옛 꼬리의 위 간격을 잇는다 */
body:not(.qt) .site-foot { margin-top: 4rem; background: transparent; }
body:not(.qt) .site-foot-in { padding-left: 0; padding-right: 0; }

/* ── 15. 폰 공통 ── */
@media (max-width: 860px) {
    :where(.qt) .wrap,
    :root .site-head-in,
    :root .site-drawer-in,
    :root .site-foot-in { padding-left: 20px; padding-right: 20px; }
    :where(.qt) .col { padding-left: 20px; padding-right: 20px; }
    :where(.qt) .hide-sm { display: none; }
    :where(.qt) .t-display { font-size: 32px; }
    :where(.qt) .t-title { font-size: 26px; }
    :where(.qt) .t-section { font-size: 24px; }
}
@media (max-width: 480px) {
    :where(.qt) .summary-box { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 22px 20px; }
    :where(.qt) .summary-box dd + dt { margin-top: 10px; }
}
