/* g5-override.css — 그누보드 기본 CSS(default.css) 위에 우리 토큰을 다시 입힌다.
 *
 * head.sub.php 의 "게시판" 분기에서 default.css·style.css **뒤에** 로드된다.
 * default.css 는 h1~h6 를 12px 로 리셋하고 본문 폭 제한이 없어, 내용관리 페이지
 * (/bbs/content.php?co_id=…)가 제목이 본문보다 작고 글줄이 화면 끝까지 늘어지는
 * 상태로 나온다(2026-09-11 doldari 개인정보처리방침 실측).
 *
 * 적용 범위는 G5 가 감싸는 래퍼(#ctt)로 한정해 게시판 목록·글쓰기 화면의 기존 레이아웃을 건드리지 않는다.
 */

/* ── G5 default.css 되돌리기(전역) ───────────────────────────────────────────
   default.css 는 body 를 'Malgun Gothic' 0.75em(=12px) 으로, h1~h6·input·textarea·select 도 같은 글꼴로 덮는다.
   게시판·회원 페이지에서만 로드되는데 그 순간 헤더 메뉴·푸터까지 글꼴이 바뀌었다(2026-10-01 돌다리 기록지, 사용자 지적).
   이 시트는 default.css **뒤**에 오므로 base.css 의 body 규칙을 여기서 한 번 더 선언한다. 값은 토큰만(§15). */
body {
    font-family: var(--mood-body-ff);
    font-size: 1rem;
    font-weight: var(--mood-body-fw);
    color: var(--mood-text);
    background-color: var(--mood-bg);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--mood-heading-ff);
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ── 내용관리 페이지(#ctt) ───────────────────────────────────────────────── */

#ctt {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 20px 96px;
    color: var(--mood-text);
    font-family: var(--mood-body-ff);
}

@media (max-width: 767px) {
    #ctt {
        padding: 32px 16px 64px;
    }
}

/* 문서 제목 — G5 내용관리 스킨은 co_subject 를 #ctt > header 로 감싸 출력한다(2026-09-11 실측).
   h1/h2 로 내보내는 스킨도 있어 함께 받는다. */
#ctt > header,
#ctt > header h1,
#ctt > header h2,
#ctt > h1,
#ctt > h2 {
    font-family: var(--mood-heading-ff);
    font-weight: var(--mood-heading-fw);
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.35;
    color: var(--mood-text);
    margin: 0 0 12px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--mood-primary);
    display: block;
}

/* header 안에 다시 heading 이 있는 스킨에서는 바깥 테두리가 두 번 그려지지 않게 안쪽만 남긴다 */
#ctt > header:has(h1),
#ctt > header:has(h2) {
    border-bottom: 0;
    padding-bottom: 0;
}

#ctt > header + #ctt_con {
    margin-top: 32px;
}

#ctt_con,
#ctt_con p,
#ctt_con li {
    /* base.css 가 p 에 별도 크기를 주고 있어 본문만 커지면 제목과 위계가 뒤집힌다 — 함께 고정한다 */
    font-size: 0.9375rem;
    line-height: 1.85;
    color: var(--mood-text);
    word-break: keep-all;      /* 한국어 단어 중간 줄바꿈 방지 */
}

/* 조항 제목 — default.css 의 12px 리셋을 되돌린다 */
#ctt_con h2 {
    font-family: var(--mood-heading-ff);
    font-weight: var(--mood-heading-fw);
    font-size: 1.625rem;
    line-height: 1.4;
    color: var(--mood-text);
    margin: 48px 0 16px;
}

#ctt_con h3 {
    font-family: var(--mood-heading-ff);
    font-weight: 700;
    font-size: 1.3125rem;
    line-height: 1.45;
    color: var(--mood-text);
    margin: 40px 0 12px;
    padding-left: 14px;
    border-left: 3px solid var(--mood-primary);
}

#ctt_con h3:first-child,
#ctt_con h2:first-child {
    margin-top: 0;
}

#ctt_con h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mood-text);
    margin: 28px 0 10px;
}

#ctt_con p {
    margin: 0 0 16px;
}

#ctt_con p:last-child {
    margin-bottom: 0;
}

#ctt_con strong,
#ctt_con b {
    font-weight: 700;
    color: var(--mood-text);
}

/* 목록 — default.css 가 list-style 을 지워 글머리 기호가 사라진다 */
#ctt_con ul,
#ctt_con ol {
    margin: 0 0 20px;
    padding-left: 0;
    list-style: none;
}

#ctt_con ul > li,
#ctt_con ol > li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
    line-height: 1.75;
}

#ctt_con ul > li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.72em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--mood-primary);
}

#ctt_con ol {
    counter-reset: ctt-ol;
}

#ctt_con ol > li {
    counter-increment: ctt-ol;
    padding-left: 24px;
}

#ctt_con ol > li::before {
    content: counter(ctt-ol) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    color: var(--mood-primary);
}

/* 표 — default.css 에는 테두리·여백이 없어 글자만 나열된다 */
#ctt_con table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 24px;
    font-size: 0.9375rem;
    /* 좁은 화면에서 표가 페이지를 밀어내지 않도록 래퍼 없이도 버티게 한다 */
    display: table;
}

#ctt_con thead th {
    background-color: color-mix(in srgb, var(--mood-primary) 8%, transparent);
    font-weight: 700;
    color: var(--mood-text);
}

#ctt_con th,
#ctt_con td {
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--mood-text) 14%, transparent);
    text-align: left;
    vertical-align: top;
    line-height: 1.7;
    word-break: keep-all;
}

/* th 가 첫 열로 쓰이는 정보표(보호책임자 등) */
#ctt_con tbody th {
    width: 28%;
    background-color: color-mix(in srgb, var(--mood-text) 4%, transparent);
    white-space: nowrap;
}

@media (max-width: 560px) {
    #ctt_con table {
        font-size: 0.875rem;
    }
    #ctt_con th,
    #ctt_con td {
        padding: 10px 8px;
    }
    #ctt_con tbody th {
        width: 34%;
        white-space: normal;
    }
}

#ctt_con a {
    color: var(--mood-primary);
    text-decoration: underline;
    word-break: break-all;
}

/* 시행일자 등 마지막 고지 문단 */
#ctt_con > p:last-of-type strong {
    display: inline-block;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid color-mix(in srgb, var(--mood-text) 12%, transparent);
    width: 100%;
    color: var(--mood-text-muted);
    font-weight: 600;
}

/* G5 가 내용관리 상단에 넣는 관리자 링크 — 방문자 화면에서는 조용히 둔다 */
#ctt .ctt_admin {
    margin-bottom: 12px;
    font-size: 0.8125rem;
}

/* ── 회원 화면(.mbskin) — 로그인·비밀번호 찾기·비밀번호 재설정·회원 확인 ─────────
   G5 skin/member/basic 이 공통으로 .mbskin 래퍼를 쓴다. default.css 에는 이 화면의
   레이아웃이 거의 없어 좌상단에 납작하게 붙어 나온다(2026-09-11 doldari 실측). */

.mbskin {
    max-width: 420px;
    margin: 0 auto;
    padding: 56px 20px 96px;
}

@media (max-width: 767px) {
    .mbskin {
        padding: 36px 16px 64px;
    }
}

/* G5 는 h1 에 페이지명, h2 에 섹션명을 넣는다. 하나만 보이게 정리한다 */
.mbskin > h1 {
    font-family: var(--mood-heading-ff);
    font-weight: var(--mood-heading-fw);
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    color: var(--mood-text);
    text-align: center;
    margin: 0 0 28px;
}

.mbskin h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mood-text);
    margin: 0 0 16px;
}

.mbskin_box {
    padding: 32px 28px;
    border: 1px solid color-mix(in srgb, var(--mood-text) 12%, transparent);
    border-radius: 14px;
    background-color: var(--mood-bg);
}

@media (max-width: 480px) {
    .mbskin_box {
        padding: 24px 18px;
    }
}

/* 입력 필드 — default.css 의 .frm_input 은 폭·높이가 없다 */
.mbskin input[type="text"],
.mbskin input[type="password"],
.mbskin input[type="email"],
.mbskin .frm_input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid color-mix(in srgb, var(--mood-text) 16%, transparent);
    border-radius: var(--mood-radius, 8px);
    font-family: var(--mood-body-ff);
    font-size: 1rem;
    color: var(--mood-text);
    background-color: var(--mood-bg);
    box-sizing: border-box;
}

.mbskin input:focus {
    outline: none;
    border-color: var(--mood-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mood-primary) 15%, transparent);
}

/* 필수 표시(*)가 입력칸 위로 겹쳐 뜨는 것을 막는다 */
.mbskin .sound_only,
.mbskin .required_icon {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* 제출 버튼 */
.mbskin .btn_submit,
.mbskin input[type="submit"],
.mbskin button[type="submit"] {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    border: 0;
    border-radius: var(--mood-radius, 8px);
    background-color: var(--mood-primary);
    color: #fff;
    font-family: var(--mood-body-ff);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s;
}

.mbskin .btn_submit:hover {
    filter: brightness(1.08);
}

/* 자동로그인 체크박스 줄 */
.mbskin label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--mood-text-muted);
    cursor: pointer;
}

.mbskin input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--mood-primary);
}

/* 아이디/비밀번호 찾기 등 보조 링크 */
.mbskin ul,
.mbskin .mbskin_box + ul {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    text-align: center;
}

.mbskin li {
    display: inline-block;
    margin: 0 8px;
}

.mbskin a {
    color: var(--mood-text-muted);
    font-size: 0.875rem;
    text-decoration: underline;
}

.mbskin a:hover {
    color: var(--mood-primary);
}

/* 안내 문구 */
.mbskin p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--mood-text-muted);
    margin-bottom: 16px;
    word-break: keep-all;
}

/* .mbskin 세부 보정 — G5 login.skin.php 실제 구조(.mbskin_box > h1 + .mb_log_cate + form) 기준 */

/* 제목은 h1 하나만 남긴다. G5 는 .mb_log_cate 안에 h2("회원로그인")를 또 넣어 같은 말이 두 번 나온다. */
.mbskin_box > h1 {
    font-family: var(--mood-heading-ff);
    font-weight: var(--mood-heading-fw);
    font-size: 1.5rem;
    line-height: 1.3;
    color: var(--mood-text);
    text-align: center;
    margin: 0 0 24px;
}

.mbskin .mb_log_cate h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.mbskin .mb_log_cate {
    margin: 0;
}

/* fieldset/legend 는 G5 가 구조용으로만 쓴다 — 테두리·여백 제거 */
.mbskin fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.mbskin legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* default.css 가 .required 에 붙이는 별표 배경 이미지(img/require.png) — 입력칸 오른쪽 위에
   겹쳐 떠서 오류 표시처럼 보인다. 아이디·비밀번호는 placeholder 로 이미 명확하고,
   필수 여부는 브라우저 기본 검증이 알린다.
   G5 쪽 선택자가 #mb_login 을 포함해 특이도가 더 높으므로 !important 로만 이길 수 있다. */
.mbskin .frm_input.required,
.mbskin input.required {
    background-image: none !important;
}

/* 자동로그인 줄 — 버튼 바로 아래에 붙어 답답해 보이지 않게 */
.mbskin .btn_submit + * {
    margin-top: 14px;
}

/* 회원가입 링크는 별도 안내 없이 노출하지 않는다.
   이 사이트는 회원 기능을 쓰지 않고(상담은 비회원 작성), 가입 약관(cf_stipulation/cf_privacy)이
   비어 있어 /bbs/register.php 가 빈 화면으로 뜬다(2026-09-11 실측). 약관을 채우면 이 규칙을 지운다. */
.mbskin .mb_log_cate a.join {
    display: none;
}

/* ── 회원정보 찾기(#find_info.new_win) ──────────────────────────────────────
   G5 는 이 화면을 팝업창(new_win)용으로 만들어 본문 폭·여백이 없다.
   우리 사이트에서는 일반 페이지로 열리므로 .mbskin 과 같은 틀을 입힌다. */

#find_info.new_win,
.new_win {
    max-width: 460px;
    margin: 0 auto;
    padding: 56px 20px 96px;
}

@media (max-width: 767px) {
    #find_info.new_win,
    .new_win {
        padding: 36px 16px 64px;
    }
}

.new_win .new_win_title,
#find_info h1,
#find_info h2 {
    font-family: var(--mood-heading-ff);
    font-weight: var(--mood-heading-fw);
    font-size: 1.5rem;
    line-height: 1.3;
    color: var(--mood-text);
    text-align: center;
    margin: 0 0 20px;
}

#find_info p,
.new_win p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--mood-text-muted);
    text-align: center;
    margin-bottom: 8px;
    word-break: keep-all;
}

#find_info fieldset,
.new_win fieldset {
    border: 1px solid color-mix(in srgb, var(--mood-text) 12%, transparent);
    border-radius: 14px;
    background-color: var(--mood-bg);
    padding: 28px 24px;
    margin-top: 24px;
}

#find_info input[type="text"],
#find_info input[type="email"],
.new_win input[type="text"],
.new_win input[type="email"] {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    margin-bottom: 14px;
    border: 1px solid color-mix(in srgb, var(--mood-text) 16%, transparent);
    border-radius: var(--mood-radius, 8px);
    font-size: 1rem;
    color: var(--mood-text);
    background-color: var(--mood-bg);
    background-image: none !important;   /* require.png 별표 제거 */
    box-sizing: border-box;
}

#find_info input:focus,
.new_win input:focus {
    outline: none;
    border-color: var(--mood-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mood-primary) 15%, transparent);
}

/* 캡차 — 이미지·입력칸·버튼이 한 줄로 정렬되게 */
#find_info #captcha,
.new_win #captcha {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

#find_info #captcha input[type="text"],
.new_win #captcha input[type="text"] {
    width: 110px;
    margin-bottom: 0;
}

#find_info #captcha img,
.new_win #captcha img {
    height: 48px;
    border-radius: calc(var(--mood-radius, 8px) / 2);
}

#find_info #captcha button,
.new_win #captcha button {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid color-mix(in srgb, var(--mood-text) 16%, transparent);
    border-radius: var(--mood-radius, 8px);
    background-color: transparent;
    cursor: pointer;
}

#find_info #captcha_info,
.new_win #captcha_info {
    flex-basis: 100%;
    font-size: 0.8125rem;
    color: var(--mood-text-muted);
    text-align: left;
}

#find_info .btn_confirm,
#find_info .btn_submit,
.new_win .btn_confirm,
.new_win .btn_submit {
    display: block;
    width: 100%;
    margin-top: 18px;
    text-align: center;
}

#find_info input[type="submit"],
#find_info button[type="submit"],
.new_win input[type="submit"],
.new_win button[type="submit"] {
    display: block;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: var(--mood-radius, 8px);
    background-color: var(--mood-primary);
    color: #fff;
    font-family: var(--mood-body-ff);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
