/* =========================================================
   플러그인 화면 스킨 (CSS만 변경, 동작 불변 — CLAUDE.md 1절)
   - MangBoard(body.jdfb .mb-board), Formidable(.frm_forms), WP-Members(#wpmem_login, #wpmem_reg)
   - 플러그인 CSS 가 px·!important 로 작은 글자를 지정하므로 필요한 곳만 !important 로 덮는다.
   ========================================================= */

/* ---------- 공통 입력 요소 ---------- */
:root {
  --field-border: #6b6f76;   /* 흰 배경 대비 4.9:1 (입력칸 테두리 3:1 이상) */
  --error: #b3261e;          /* 흰 배경 대비 6.4:1 */
}
html[data-contrast="high"] { --field-border: #ffffff; --error: #ff8a80; }

body.jdfb .mb-board input[type="text"], body.jdfb .mb-board input[type="password"], body.jdfb .mb-board input[type="email"], body.jdfb .mb-board select, body.jdfb .mb-board textarea,
.frm_forms input[type="text"], .frm_forms input[type="email"], .frm_forms input[type="tel"], .frm_forms input[type="number"], .frm_forms select, .frm_forms textarea,
#wpmem_login input[type="text"], #wpmem_login input[type="password"], #wpmem_reg input[type="text"], #wpmem_reg input[type="password"], #wpmem_reg input[type="email"], #wpmem_reg select, #wpmem_reg textarea {
  font: inherit !important;
  font-size: 1.0625rem !important;
  color: var(--text) !important;
  background: var(--bg) !important;
  border: 2px solid var(--field-border) !important;
  border-radius: 8px !important;
  min-height: 48px !important;
  height: auto !important;
  padding: 8px 12px !important;
  box-shadow: none !important;
  max-width: 100%;
}
body.jdfb .mb-board textarea, .frm_forms textarea, #wpmem_reg textarea { min-height: 120px !important; line-height: 1.6 !important; }
body.jdfb .mb-board input:focus-visible, body.jdfb .mb-board select:focus-visible, body.jdfb .mb-board textarea:focus-visible,
.frm_forms input:focus-visible, .frm_forms select:focus-visible, .frm_forms textarea:focus-visible,
#wpmem_login input:focus-visible, #wpmem_reg input:focus-visible {
  outline: 3px solid var(--focus) !important; outline-offset: 2px !important; border-color: var(--brand) !important;
}
::placeholder { color: #5f6368; opacity: 1; }

/* 주요 버튼 */
body.jdfb .mb-board .btn, body.jdfb .mb-board button.btn, body.jdfb .mb-board input[type="button"], body.jdfb .mb-board input[type="submit"],
.frm_forms .frm_button_submit, .frm_forms button[type="submit"],
#wpmem_login .buttons, #wpmem_reg .buttons {
  font: inherit !important; font-size: 1.0625rem !important; font-weight: 700 !important;
  min-height: 48px !important; height: auto !important; padding: 8px 22px !important; line-height: 1.3 !important;
  border-radius: 10px !important; border: 2px solid var(--brand) !important;
  background: var(--brand) !important; color: var(--brand-ink) !important; cursor: pointer; text-shadow: none !important; box-shadow: none !important;
}
body.jdfb .mb-board .btn:hover, .frm_forms .frm_button_submit:hover, #wpmem_login .buttons:hover, #wpmem_reg .buttons:hover {
  background: var(--bg) !important; color: var(--brand) !important;
}

/* ---------- MangBoard 게시판 ---------- */
body.jdfb .mb-board { font-size: 1.0625rem !important; color: var(--text); }
body.jdfb .mb-board table, body.jdfb .mb-board tbody, body.jdfb .mb-board tr, body.jdfb .mb-board td, body.jdfb .mb-board th { font-size: 1.0625rem !important; }
body.jdfb .mb-board .main-style1 table.table td:not(.text-left) { font-size: 1rem !important; }
body.jdfb .mb-board td, body.jdfb .mb-board th, body.jdfb .mb-board span, body.jdfb .mb-board a, body.jdfb .mb-board p, body.jdfb .mb-board div, body.jdfb .mb-board li, body.jdfb .mb-board label {
  font-size: inherit !important; line-height: 1.6 !important;
}
body.jdfb .mb-board a { color: inherit; }
/* 목록 표 */
body.jdfb .mb-board .main-style1 table.table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--text) !important; }
body.jdfb .mb-board .main-style1 table.table th { background: var(--surface) !important; color: var(--text) !important; font-weight: 700 !important; padding: 12px 8px !important; border-bottom: 1px solid var(--line) !important; }
body.jdfb .mb-board .main-style1 table.table td { padding: 14px 8px !important; border-bottom: 1px solid var(--line) !important; color: var(--muted); }
body.jdfb .mb-board .main-style1 table.table td.text-left a { color: var(--text) !important; font-weight: 600 !important; text-decoration: none; display: inline-block; padding-block: 4px; }
body.jdfb .mb-board .main-style1 table.table td.text-left a:hover { text-decoration: underline !important; text-underline-offset: 4px; }
body.jdfb .mb-board .btn-user-info { color: var(--muted) !important; text-decoration: none; }
body.jdfb .mb-board img.list-i-file, body.jdfb .mb-board img.list-i-img, body.jdfb .mb-board img.list-i-secret, body.jdfb .mb-board img.list-i-reply { width: 16px; height: auto; vertical-align: -2px; }
body.jdfb .mb-board img.user-i-level { display: none; } /* 등급 아이콘: 장식(정보 없음) */
/* 검색 */
body.jdfb .mb-board .list-search { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-bottom: 16px !important; float: none !important; }
body.jdfb .mb-board .list-search select { width: auto !important; }
body.jdfb .mb-board .list-search input.search-text { width: min(320px, 100%) !important; }
body.jdfb .mb-board .list-head::after { content: ""; display: block; clear: both; }
/* 페이지 번호 */
body.jdfb .mb-board .pagination-box { margin: 28px 0 8px !important; }
body.jdfb .mb-board table.table-page { margin: 0 auto; border: 0 !important; }
body.jdfb .mb-board table.table-page td { padding: 0 3px !important; border: 0 !important; }
body.jdfb .mb-board a.btn-page-num, body.jdfb .mb-board .table-page a.btn-start, body.jdfb .mb-board .table-page a.btn-prev, body.jdfb .mb-board .table-page a.btn-next, body.jdfb .mb-board .table-page a.btn-end {
  display: inline-grid !important; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text) !important; font-weight: 600 !important; text-decoration: none !important;
}
body.jdfb .mb-board td.btn-page.active a.btn-page-num { background: var(--brand) !important; border-color: var(--brand); color: var(--brand-ink) !important; }
body.jdfb .mb-board .table-page .mb-disabled a { opacity: .45; }
body.jdfb .mb-board .table-page img { width: 14px !important; }
/* 버튼 영역 */
body.jdfb .mb-board .list-btn, body.jdfb .mb-board .view-btn { margin-top: 16px !important; }
body.jdfb .mb-board .btn-box-right, body.jdfb .mb-board .btn-box-left { display: flex; flex-wrap: wrap; gap: 8px; }
/* 글 보기 */
body.jdfb .mb-board .mb-mode-view table.table { width: 100%; border-collapse: collapse; }
body.jdfb .mb-board .mb-mode-view table.table th, body.jdfb .mb-board .mb-mode-view table.table td { padding: 12px 12px !important; border-bottom: 1px solid var(--line) !important; }
body.jdfb .mb-board .mb-mode-view table.table th { background: var(--surface) !important; font-weight: 700 !important; width: 7em; }
body.jdfb .mb-board td.content-box, body.jdfb .mb-board .hwp_editor_board_content { font-size: 1.125rem !important; line-height: 1.8 !important; color: var(--text) !important; padding: 24px 12px !important; }
body.jdfb .mb-board td.content-box img { height: auto !important; }
body.jdfb .mb-board a.file-download { color: var(--brand) !important; font-weight: 600 !important; text-decoration: underline !important; }
body.jdfb .mb-board .prev_next_style table td { padding: 12px 8px !important; border-bottom: 1px solid var(--line) !important; }
/* 댓글 */
body.jdfb .mb-board .cmt-input-box { margin-top: 24px; }
body.jdfb .mb-board .cmt-list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
body.jdfb .mb-board .cmt-name { font-weight: 700 !important; }
body.jdfb .mb-board .cmt-date { color: var(--muted) !important; }
.mb-poweredby { font-size: .875rem !important; color: var(--muted) !important; margin-top: 16px; }

/* ---------- Formidable 후원신청 폼 ---------- */
.frm_forms { font-size: 1.0625rem !important; max-width: 760px; }
.frm_forms .frm_form_title { font-size: 1.375rem !important; margin: 0 0 16px !important; }
.frm_forms .frm_form_field { margin-bottom: 22px !important; }
.frm_forms .frm_primary_label { display: block; font-size: 1.125rem !important; font-weight: 700 !important; color: var(--text) !important; margin-bottom: 8px !important; padding: 0 !important; }
.frm_forms .frm_required { color: var(--error) !important; font-weight: 700; }
.frm_forms .frm_description { font-size: 1rem !important; color: var(--muted) !important; line-height: 1.6 !important; margin-top: 6px !important; }
.frm_forms input[type="text"], .frm_forms input[type="email"], .frm_forms input[type="tel"], .frm_forms input[type="number"] { width: 100% !important; }
/* 라디오·체크박스: 큰 클릭 영역 */
.frm_forms .frm_opt_container { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.frm_forms .frm_radio, .frm_forms .frm_checkbox { margin: 0 !important; }
.frm_forms .frm_radio label, .frm_forms .frm_checkbox label {
  display: inline-flex !important; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px !important;
  border: 2px solid var(--line); border-radius: 10px; font-size: 1.0625rem !important; color: var(--text) !important; cursor: pointer; background: var(--bg);
}
.frm_forms .frm_radio label:has(input:checked), .frm_forms .frm_checkbox label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.frm_forms input[type="radio"], .frm_forms input[type="checkbox"] { width: 22px !important; height: 22px !important; margin: 0 !important; accent-color: var(--brand); }
.frm_forms .frm_submit { margin-top: 28px !important; }
.frm_forms .frm_button_submit { min-width: 200px; }
/* 오류·완료 메시지: 색 + 글자 + 굵기로 표시(색만으로 구분하지 않음) */
.frm_forms .frm_error, .frm_forms .frm_error_style {
  color: var(--error) !important; font-size: 1rem !important; font-weight: 700 !important; margin-top: 6px !important;
}
.frm_forms .frm_error_style { background: #fdecea !important; border: 2px solid var(--error) !important; border-radius: 10px; padding: 12px 16px !important; color: var(--text) !important; }
.frm_forms .frm_blank_field input, .frm_forms .frm_blank_field select, .frm_forms .frm_blank_field textarea { border-color: var(--error) !important; }
.frm_message { font-size: 1.125rem !important; font-weight: 700; background: var(--brand-soft) !important; border: 2px solid var(--brand) !important; border-radius: 10px; padding: 16px 20px !important; color: var(--text) !important; }
.frm_forms a { color: var(--brand) !important; font-weight: 600; text-underline-offset: 4px; }

/* ---------- WP-Members 로그인·회원가입 ---------- */
#wpmem_login, #wpmem_reg { max-width: 560px; font-size: 1.0625rem !important; }
#wpmem_login fieldset, #wpmem_reg fieldset { border: 1px solid var(--line) !important; border-radius: var(--radius); padding: 20px 24px 24px !important; margin: 0 !important; }
#wpmem_login legend, #wpmem_reg legend { font-size: 1.375rem !important; font-weight: 800 !important; padding: 0 8px !important; }
#wpmem_login label, #wpmem_reg label { display: block; font-weight: 700 !important; font-size: 1.0625rem !important; margin: 14px 0 6px !important; float: none !important; width: auto !important; text-align: left !important; }
#wpmem_login .div_text, #wpmem_reg .div_text { float: none !important; width: 100% !important; margin: 0 !important; }
#wpmem_login input.username, #wpmem_login input.password, #wpmem_reg input.textbox { width: 100% !important; }
#wpmem_login .button_div, #wpmem_reg .button_div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px !important; width: auto !important; float: none !important; text-align: left !important; }
#wpmem_login .button_div label, #wpmem_login input[type="checkbox"] + label { display: inline-flex !important; margin: 0 !important; }
#wpmem_login input[type="checkbox"], #wpmem_reg input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--brand); vertical-align: middle; }
#wpmem_login .link-text, #wpmem_reg .link-text { margin-top: 16px !important; font-size: 1.0625rem !important; float: none !important; width: auto !important; text-align: left !important; }
#wpmem_login a, #wpmem_reg a { color: var(--brand); font-weight: 700; text-underline-offset: 4px; }
#wpmem_reg .req, #wpmem_reg .req-text { color: var(--error) !important; font-weight: 700; }
.wpmem_msg { font-size: 1.0625rem !important; border: 2px solid var(--brand) !important; border-radius: 10px; padding: 14px 18px !important; background: var(--brand-soft) !important; color: var(--text) !important; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 640px) {
  body.jdfb .mb-board .main-style1 table.table td { padding: 12px 4px !important; }
  body.jdfb .mb-board .list-search { justify-content: stretch; }
  body.jdfb .mb-board .list-search input.search-text { flex: 1 1 140px; width: auto !important; }
  body.jdfb .mb-board .mb-mode-view table.table th { width: 5em; }
  .frm_forms .frm_opt_container { flex-direction: column; }
  .frm_forms .frm_radio label, .frm_forms .frm_checkbox label { width: 100%; }
  .frm_forms .frm_button_submit { width: 100%; }
}

/* 목록: 번호·작성자·날짜·조회수는 한 줄 유지, 제목 칸이 남는 폭을 쓴다 */
body.jdfb .mb-board .main-style1 table.table td:not(.text-left) { white-space: nowrap; }
body.jdfb .mb-board col.mb-col-pid { width: 4.5em !important; }
body.jdfb .mb-board col.mb-col-user-name { width: 7.5em !important; }
body.jdfb .mb-board col.mb-col-reg-date { width: 8em !important; }
body.jdfb .mb-board col.mb-col-hit { width: 4.5em !important; }
body.jdfb .mb-board col.mb-col-title { width: auto !important; }

/* 필수 칸인데 별표 설정이 비어 있는 경우(예: 성명/단체명) 화면에 별표 표시.
   폼 설정은 바꾸지 않는다. 입력칸에는 이미 aria-required="true" 가 있어 스크린리더는 '필수'로 읽는다. */
.frm_forms .frm_required_field .frm_primary_label .frm_required:empty::after { content: "*"; }
