/* shared/unify.css - 모든 사이트 디자인 통일 (권한 정리 4단계, 2026-10-27)
   모든 페이지에서 "맨 마지막"에 불러온다 (각 사이트 css 를 덮어씀). 숫자를 바꾸고 싶으면 아래 :root 만 고치면 된다.
   재어 본 예전 값: 위쪽 바 높이 72 / 70 / 60, 본문 폭 1460 / 1400 / 1360 / 1240, 글자 15 · 16px, 표 안쪽 스크롤 2곳 */

:root {
    /* 크기 */
    --lw-header-h: 70px;          /* 위쪽 바 높이 (모든 사이트) */
    --lw-content: 1400px;         /* 본문 최대 폭 (모든 사이트) */
    --lw-gutter: 24px;            /* 본문 좌우 여백 */
    /* 글자 */
    --lw-font: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
    --lw-font-serif: 'Gowun Batang', 'Nanum Myeongjo', serif;   /* 큰 소개 문구만 */
    --lw-fs: 16px;                /* 기본 글자 */
    --lw-fs-sm: 14px;             /* 작은 글자 · 표 */
    --lw-h1: 24px;                /* 페이지 제목 */
    --lw-h2: 20px;                /* 칸 제목 */
    /* 색 (theme.css 의 파랑 + 상태 색) */
    --lw-ok: #0f9d76;             /* 수입 · 저장됨 · 승인 */
    --lw-bad: #d92d20;            /* 지출 · 지우기 · 오류 */
    --lw-warn: #f79009;           /* 주의 · 고침 */
    --lw-bg: var(--brand-50);     /* 페이지 바탕 */
    --lw-card: #ffffff;
    --lw-line: var(--line);
    --content-width: var(--lw-content);   /* 성도 사이트가 쓰는 이름 */

    /* 신학원 · 관리자 css 의 옛 이름도 같은 색으로 */
    --success-color: var(--lw-ok);
    --error-color: var(--lw-bad);
    --warning-color: var(--lw-warn);
}
@media (max-width: 760px) {
    :root { --lw-header-h: 60px; }    /* 휴대폰 위쪽 바 */
}
@media (max-width: 600px) {
    :root { --lw-gutter: 16px; --lw-h1: 21px; --lw-h2: 18px; }
}

/* ── 글자: 모든 사이트 같은 글꼴 · 같은 기본 크기 ── */
html, body { font-family: var(--lw-font); }
body { font-size: var(--lw-fs); color: var(--ink); background-color: var(--lw-bg); }
button, input, select, textarea { font-family: inherit; }
html[data-site="admin"] .admin-header h1 { font-size: var(--lw-h1); }
.chp-h2, .cs-sec-head h2, .section-title, .net-section-title { font-size: var(--lw-h2); }

/* ── 위쪽 바 높이 (모든 사이트 70px) ── */
.topbar { min-height: var(--lw-header-h); padding-top: 0; padding-bottom: 0; }
.navbar-container { min-height: var(--lw-header-h); }
/* 행정 네트워크: 파란 띠 → 신학원 · 관리자와 같은 흰 바 (성도 사이트만 투명) */
.net-top { min-height: var(--lw-header-h); padding-top: 0; padding-bottom: 0; background: rgba(255, 255, 255, 0.96); color: var(--brand-900);
    box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(26, 68, 50, 0.06); backdrop-filter: blur(8px); }
.net-top .net-brand { color: var(--brand-900); }
.net-top .net-brand small { color: var(--ink-muted); opacity: 1; }
.net-top .net-brand img { background: transparent; padding: 0; }
/* "← 홈" 링크: 예전 파란 띠용 흰 글자가 흰 바 위에서 안 보였다 (2026-10-31) */
.net-top .net-home { color: var(--brand-700); }
/* 교회 사이트의 교회 바는 위쪽 바 바로 밑 */
.cs-bar { top: var(--lw-header-h); margin-top: var(--lw-header-h); }

/* ── 따라 내려오는 칸은 위쪽 바 바로 밑에 (--lw-sticky-top = 실제 바 높이, shared/site-header.js 가 잰다) ──
   신학원 홈 오른쪽 유저 정보 · 강의 보기 목록 · 자료 미리보기 (예전 고정 90px 은 두 줄 바보다 낮아 바 밑으로 들어갔다) */
.sidebar,
.lw-page .lw-course-col,
.lw-page .lw-doc-col { top: calc(var(--lw-sticky-top, 74px) + 16px); }
.church-card { scroll-margin-top: calc(var(--lw-sticky-top, 74px) + 16px); }

/* ── 본문 폭 (모든 사이트 1400px) · 좌우 여백 ── */
.main-container,
html[data-site="admin"] .main-container,
.chp-main,
.cs-bar-inner,
.net-main { max-width: var(--lw-content); padding-left: var(--lw-gutter); padding-right: var(--lw-gutter); }

/* ── 스크롤 하나로: 표가 그 탭의 전부일 때 표 안쪽 세로 스크롤을 없애고 페이지 스크롤만 (가로는 넘칠 때만) ──
   (교회 출석 명단은 2026-10-29 부터 출석 엑셀 보기처럼 표 안 스크롤 + 머리 줄 고정 - church.css .att-table-wrap.is-stick) */
html[data-site="admin"] .table-container { max-height: none; overflow-y: visible; overflow-x: auto; }

/* ── 사이트 버튼 줄: 앱 화면처럼 이름은 2줄까지 (모든 사이트) ── */
.quick-links .app > span:last-child,
.lw-site-row .app > span:last-child {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere;
}

/* ── 카드 · 판 모양 (둥근 정도 · 선 · 그림자 통일) ── */
.chp-panel, .cs-card, .card, .uc-card, .net-card { border-radius: var(--radius-md); }

/* ── 교회 나라 탭 (국기 + 이름 + 교회 수) - shared/countries.js tabsHtml (82번 SQL) ── */
.lw-country-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.lw-country-tab {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 7px 14px 7px 10px;
    border: 1.5px solid #dbe6db; border-radius: 999px; background: #fff; color: #344054;
    font: inherit; font-size: 14.5px; font-weight: 800; cursor: pointer; transition: border-color .15s, background .15s;
}
.lw-country-tab:hover { border-color: #89c9ac; }
.lw-country-tab.is-on { border-color: #1f4d3a; background: #f9f6ee; color: #163829; }
.lw-country-tab .lw-flag { flex-shrink: 0; width: 26px; height: 17px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(11, 19, 15, .14); }
.lw-country-tab small { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #f8f5ed; color: #475467; font-size: 12.5px; font-weight: 800; text-align: center; }
.lw-country-tab.is-on small { background: #1f4d3a; color: #fff; }
.lw-flag-inline { width: 20px; height: 13px; object-fit: cover; border-radius: 2px; vertical-align: -1px; margin-right: 6px; box-shadow: 0 0 0 1px rgba(11, 19, 15, .14); }
