/* board_church — 교회 게시판 스킨 (church 레이아웃과 한 세트, 토큰 fallback 필수). T2~T5에서 누적 작성. */
.board { color: var(--text, #372f2c); font-size: var(--fs-body, 17px); }
.board a { color: inherit; text-decoration: none; }
.board a:hover, .board a:focus-visible { color: var(--accent-text, #976870); }

/* ── 리스트 ───────────────────────────── */
/* 코어 공통 CSS가 table 요소에 12px를 강제해 부모 폰트가 끊긴다 — 명시 복원.
   목록 제목 16px(사용자 확정값, 2026-07-15). */
.chb-table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--text, #372f2c); font-size: 16px; }
.chb-table th {
	padding: 16px 12px; font-size: 15px; font-weight: 600;
	border-bottom: 1px solid var(--line, #e1e1e1); text-align: center;
}
.chb-table td { padding: 18px 12px; border-bottom: 1px solid var(--line, #e1e1e1); text-align: center; }
.chb-table .chb-title { text-align: left; }
.chb-table td.chb-title a { display: inline-block; min-height: 24px; overflow-wrap: anywhere; }
.chb-no { width: 72px; color: var(--muted, #7d6f72); font-size: 14px; }
.chb-date { width: 110px; color: var(--muted, #7d6f72); font-size: 14px; }
.chb-empty { padding: 64px 0; color: var(--muted, #7d6f72); }
.chb-badge {
	display: inline-block; padding: 3px 10px; border-radius: var(--r-pill, 980px);
	background: var(--accent, #c18590); color: #fff; font-size: 12px; font-weight: 600;
	/* body lh 25px 상속 차단 — 뱃지가 세로로 부풀지 않게(codex 리뷰와 동류). */
	line-height: var(--lh-caption, 16px);
}
.chb-replynum { margin-left: 6px; font-size: 13px; color: var(--accent-text, #976870); }
.chb-notice td { background: var(--soft, #f3eeee); }
.chb-current td { background: var(--soft, #f3eeee); }

/* ── 게시판 헤더(관리자 설정 링크) — 라벨처럼 보이지 않게 우측 정렬 + 컴팩트 pill ─── */
.board_header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.board_header h2 { margin: 0; }
.board_header .setup {
	margin-left: auto; display: inline-flex; align-items: center;
	min-height: var(--btn-h-compact, 36px); padding: var(--btn-pad-compact, 8px 15px);
	border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-pill, 980px);
	font-size: var(--fs-small, 14px); line-height: var(--lh-small, 18px); color: var(--muted, #7d6f72);
}
.board_header .setup:hover, .board_header .setup:focus-visible { border-color: var(--text, #372f2c); color: var(--text, #372f2c); }

/* ── 툴바: 카테고리(좌) + 검색(우) 한 줄 ─── */
.chb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chb-cate select {
	min-height: 44px; padding: 0 12px; font-size: 17px; background: #fff;
	border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-control, 8px);
}

/* ── 검색(툴바 우측 — 카테고리 없는 게시판에서도 margin-left:auto로 우측 정렬 유지) ─── */
.chb-search {
	/* board.default.js(bsToggle)가 인라인 display:none을 심는 것을 무효화 — 제거 금지 */
	display: flex !important; align-items: center; gap: 0;
	/* fit-content+margin-left:auto — 보더 박스를 내용 폭만큼만(레퍼런스=우측 컴팩트 박스) */
	width: fit-content; margin-left: auto;
	border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-control, 8px); overflow: hidden;
}
/* 컨트롤 폰트는 17px 스펙 고정(본문 18px 상향과 분리). */
.chb-search select { border: 0; height: 44px; padding: 0 8px 0 12px; font-size: 17px; background: #fff; }
.chb-search .iText { border: 0; height: 44px; width: 180px; padding: 0 12px; font-size: 17px; }
.chb-search .btn { border: 0; height: 44px; padding: 0 14px; background: #fff; cursor: pointer; font-size: 17px; }
.chb-footer .bsToggle, .chb-footer .tagSearch { display: none; }

/* ── 푸터(페이지네이션·버튼) ─── 정적 흐름, 테이블 높이에 자연스럽게 따라붙는다 */
.chb-footer { margin-top: 24px; }
.chb-pagination { text-align: center; }
.chb-pagination a, .chb-pagination strong {
	display: inline-flex; align-items: center; justify-content: center;
	/* pill 정책(디자인 시스템) — 44px 원형. */
	min-width: 44px; min-height: 44px; margin: 0 2px; border-radius: var(--r-pill, 980px); font-size: var(--fs-small, 14px);
}
.chb-pagination strong { background: var(--text, #372f2c); color: #fff; }
.chb-pagination a:hover, .chb-pagination a:focus-visible { background: var(--soft, #f3eeee); }
.chb-pagination .direction span { display: none; }
.chb-actions { text-align: right; margin-top: 16px; }
.chb-actions .btn {
	/* 대형 pill(디자인 시스템): 44px, 좌우 21px, 17px/400. */
	display: inline-flex; align-items: center; justify-content: center;
	min-height: var(--btn-h, 44px); padding: 0 21px; border: 1px solid var(--line, #e1e1e1);
	border-radius: var(--r-pill, 980px); font-size: 17px; font-weight: 400;
}
.chb-actions .btn:hover, .chb-actions .btn:focus-visible { border-color: var(--text, #372f2c); }

@media (max-width: 599px) {
	.chb-no { display: none; } .chb-table th.chb-no { display: none; }
	.chb-date { width: 84px; }
	.chb-table td { padding: 14px 8px; }
	.chb-search .iText { width: 120px; }
}

/* ── 갤러리 그리드 ─────────────────────── */
.chb-gallery__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }
.chb-gallery__card { display: block; }
.chb-gallery__thumb, .chb-card__thumb {
	display: block; position: relative; aspect-ratio: 720 / 454; overflow: hidden;
	border-radius: var(--r-card, 18px); background: var(--soft, #f3eeee);
}
.chb-gallery__thumb img, .chb-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chb-gallery__noimg { position: absolute; inset: 0; background: linear-gradient(135deg, #efe6e7, #e1d4d6); }
.chb-gallery__label { display: block; margin: 12px 0 4px; font-size: 12px; color: var(--accent-text, #976870); font-weight: 600; }
.chb-gallery__title { display: block; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }

/* ── 설교 카드 ─────────────────────────── */
.chb-card {
	display: grid; grid-template-columns: 380px 1fr; gap: 32px;
	padding: 28px; border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-card, 18px); margin-bottom: 20px;
}
.chb-card__title { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line, #e1e1e1); font-size: 18px; font-weight: 600; }
.chb-card__meta { margin: 0 0 16px; }
.chb-card__meta div { display: flex; gap: 16px; padding: 4px 0; font-size: 14px; }
.chb-card__meta dt { min-width: 88px; color: var(--muted, #7d6f72); }
.chb-card__meta dt::before { content: '· '; }
.chb-card__meta dd { margin: 0; }
.chb-card__summary { margin: 0; padding: 18px 20px; background: var(--soft, #f3eeee); border-radius: 6px; font-size: 14px; color: var(--muted, #7d6f72); }

@media (max-width: 839px) {
	.chb-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
	.chb-card { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
}
@media (max-width: 599px) {
	.chb-gallery__grid { grid-template-columns: 1fr; }
}

/* ── 읽기 ─────────────────────────────── */
.chb-read__titlebar { padding: 20px 24px; background: var(--soft, #f3eeee); border-top: 2px solid var(--text, #372f2c); }
/* 읽기 제목 — 28px는 과대(가독성 지적, 2026-07-18) → 22px로 축소. */
.chb-read__title {
	margin: 0; font-size: 22px; font-weight: 400;
	line-height: 1.2; letter-spacing: var(--ls-tile, 0.196px); overflow-wrap: anywhere;
}
.chb-read__meta {
	display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
	padding: 14px 24px; border-bottom: 1px solid var(--line, #e1e1e1); font-size: 14px; color: var(--muted, #7d6f72);
}
.chb-read__meta b { font-weight: 600; color: var(--text, #372f2c); }
.chb-read__right { display: inline-flex; gap: 20px; }
.chb-read__content { padding: 40px 24px; min-height: 160px; line-height: 1.8; overflow-wrap: anywhere; }
.chb-read__content img { max-width: 100%; height: auto; }
.chb-read__files { padding: 12px 24px; border-top: 1px solid var(--line, #e1e1e1); font-size: 14px; }
.chb-read__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 24px 0; border-top: 1px solid var(--line, #e1e1e1); }
.chb-btn {
	/* 대형 pill(디자인 시스템): 44px, 좌우 21px, 17px/400. */
	display: inline-flex; align-items: center; justify-content: center;
	min-height: var(--btn-h, 44px); padding: 0 21px; border: 1px solid var(--line, #e1e1e1);
	border-radius: var(--r-pill, 980px); font-size: 17px; font-weight: 400; background: #fff; cursor: pointer;
}
.chb-btn:hover, .chb-btn:focus-visible { border-color: var(--text, #372f2c); }
@media (max-width: 599px) {
	.chb-read__titlebar, .chb-read__meta, .chb-read__content, .chb-read__files { padding-left: 12px; padding-right: 12px; }
}

/* ── 댓글 ─────────────────────────────── */
.chb-comments { margin-top: 32px; }
.chb-comments .fbList > li, .chb-comments ul.fbList li.fbItem { border-bottom: 1px solid var(--line, #e1e1e1); }
.chb-comments .fbList { border-top: 2px solid var(--text, #372f2c); }
.chb-comment-form { margin-top: 24px; }
.chb-comment-form textarea { width: 100%; min-height: 96px; border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-control, 8px); padding: 12px; font-size: 17px; }

/* ── 쓰기 폼 ───────────────────────────── */
.chb-write input[type="text"], .chb-write input[type="password"], .chb-write select {
	border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-control, 8px); min-height: 44px; padding: 0 12px; font-size: 17px;
}
.chb-write .btnArea { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── 디자인 정돈(사용자 지적: 버튼·검색·표시·글자크기) ─────────────── */
/* 보드 콘텐츠 상하 여백 — 서브탭/푸터에 붙지 않게. */
.board { padding: 56px 0 64px; }

/* 검색박스: 레퍼런스 순서(분류 select → 입력 → 버튼)로 재배치 + 내부 구분선. */
.chb-search select { order: -1; border-right: 1px solid var(--line, #e1e1e1); }
.chb-search .iText { width: 180px; }
.chb-search .btn { border-left: 1px solid var(--line, #e1e1e1); color: var(--muted, #7d6f72); }

/* 목록 헤더행 색 통일 — .chb-no/.chb-date의 muted 색이 th에도 번지던 것 교정. */
.chb-table th { color: var(--text, #372f2c); }

/* 읽기 하단의 코어 잔재(문서 액션 팝업 트리거 '이 게시물을…', SNS 공유 리스트) —
   레퍼런스에 없고 스타일도 없는 생 마크업이라 숨김(기능 마크업은 보존). */
.chb-read .read_footer a.action,
.chb-read .read_footer .sns { display: none; }

/* 댓글 헤더 — 이탤릭 카운트 제거, 크기/색 정돈. */
.chb-comments .fbHeader h2 { margin: 40px 0 16px; font-size: 20px; font-weight: 600; }
.chb-comments .fbHeader h2 em { font-style: normal; color: var(--accent-text, #976870); }

/* ── 글쓰기·댓글 폼 정돈(사용자 지적: 에디터 주변 깨짐 — 제목 인풋 협소,
   비로그인 글쓴이/비밀번호/홈페이지/태그 필드 뒤엉킴, 등록 버튼 미스타일) ─── */
/* 제목 행: 분류·제목·공지 셀렉트 한 행, 제목이 남는 폭 전부 차지.
   관리자 모드(분류+공지 셀렉트 동시)의 좁은 화면 가로 넘침 방지: wrap+min-width(codex 리뷰). */
.chb-write .write_header { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chb-write .write_header .iText { flex: 1 1 240px; min-width: 0; }
.chb-write .write_editor { margin-bottom: 16px; }
/* 옵션 체크박스 행 — 체크박스+라벨은 .item으로 짝지어(스킨 html) 짝 내부 gap 6px. */
.chb-write .write_option {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px;
	margin: 16px 0 12px; font-size: var(--fs-small, 14px);
}
.chb-write .write_option .item { display: inline-flex; align-items: center; gap: 6px; }
/* 작성자·태그 필드: 라벨+인풋 짝으로 정렬. 코어가 인라인 style로 width 80/140px를
   박아 넣어 뒤엉키므로 !important로 일관 폭 부여(인라인 스타일은 이 방법뿐). */
.chb-write .write_author, .chb-comment-form .write_author {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 12px 0 4px;
}
.chb-write .write_author .item, .chb-comment-form .write_author .item {
	display: inline-flex; align-items: center; gap: 8px;
}
.chb-write .write_author .iLabel, .chb-comment-form .write_author .iLabel {
	font-size: var(--fs-small, 14px); color: var(--muted, #7d6f72); white-space: nowrap;
}
.chb-comment-form .write_author .iText {
	border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-control, 8px);
	min-height: 40px; padding: 0 12px; font-size: 17px;
}
.chb-write .write_author .userName, .chb-write .write_author .userPw,
.chb-comment-form .write_author .userName, .chb-comment-form .write_author .userPw { width: 130px !important; }
.chb-write .write_author .homePage, .chb-comment-form .write_author .homePage { width: 200px !important; }
/* 태그 필드(마지막 item)는 남는 폭으로 늘어남 — 글쓰기 폼 전용. */
.chb-write .write_author .item:last-child { flex: 1 1 280px; }
.chb-write .write_author .item:last-child .iText { flex: 1; width: auto !important; }
/* 등록/임시저장 버튼 — 대형 pill 규격(.chb-btn과 동일). */
.chb-comment-form .btnArea { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.chb-write .btnArea .btn, .chb-comment-form .btnArea .btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: var(--btn-h, 44px); padding: 0 21px; border: 1px solid var(--line, #e1e1e1);
	border-radius: var(--r-pill, 980px); font-size: 17px; font-weight: 400; background: #fff; cursor: pointer;
}
.chb-write .btnArea .btn:hover, .chb-write .btnArea .btn:focus-visible,
.chb-comment-form .btnArea .btn:hover, .chb-comment-form .btnArea .btn:focus-visible {
	border-color: var(--text, #372f2c);
}

/* ── 첨부파일 블록(읽기) — 코어 생 마크업(토글 버튼+불릿 리스트) 정돈. ─────── */
.chb-read__files { padding: 16px 24px; }
.chb-read__files .toggleFile {
	display: inline-flex; align-items: center; gap: 4px;
	min-height: var(--btn-h-compact, 36px); padding: var(--btn-pad-compact, 8px 15px);
	border: 1px solid var(--line, #e1e1e1); border-radius: var(--r-pill, 980px);
	background: #fff; font-size: var(--fs-small, 14px); line-height: var(--lh-small, 18px);
	color: var(--muted, #7d6f72); cursor: pointer;
}
.chb-read__files .toggleFile:hover,
.chb-read__files .toggleFile:focus-visible { border-color: var(--text, #372f2c); }
.chb-read__files .toggleFile strong { font-weight: 600; color: var(--accent-text, #976870); }
/* 첨부 목록은 기본 숨김 — toggleFile 클릭 시에만 표시(jQuery toggle이 인라인 display 부여). */
.chb-read__files ul.files, .chb-comments .fileList ul.files { display: none; }
.chb-read__files ul.files { list-style: none; margin: 12px 0 0; padding: 0; }
.chb-read__files ul.files li { padding: 6px 0; }
.chb-read__files ul.files a { font-size: 15px; color: var(--text, #372f2c); }
.chb-read__files ul.files a:hover,
.chb-read__files ul.files a:focus-visible { color: var(--accent-text, #976870); text-decoration: underline; }
.chb-read__files .fileSize { margin-left: 6px; font-size: 13px; color: var(--muted, #7d6f72); }

/* ── 게시판 반응형 보강(태블릿·모바일 가독) — 컬럼 숨김/패딩 축소는 위 기존 블록,
   여기는 대형 타이포·여백의 축소 스케일. 목록 16px는 모바일 권장 하한이라 유지. ─── */
@media (max-width: 839px) {
	.board { padding: 40px 0 48px; }
	.chb-read__title { font-size: 20px; }
}
@media (max-width: 599px) {
	.board { padding: 32px 0 40px; }
	/* 첨부 블록 기본 규칙이 위쪽 599 블록보다 뒤에 선언돼 이기므로 여기서 재지정(codex 리뷰). */
	.chb-read__files { padding-left: 12px; padding-right: 12px; }
	.chb-read__title { font-size: 18px; }
	.chb-read__content { padding-top: 28px; padding-bottom: 28px; }
	.chb-comments .fbHeader h2 { font-size: 18px; margin-top: 32px; }
	.chb-card__title { font-size: 17px; }
}
