:root {
  --dis-bg:    #3b1a1a;
  --dis-acc:   #c0392b;
  --dis-soft:  #fadbd8;
  --mh-white:  #ffffff;
  --mh-ink:    #1a1a1a;
  --mh-muted:  #5a5a5a;
  --mh-bg:     #ffffff;
  --mh-border: #e8e4dc;
  --mh-radius: 16px;
  --mh-shadow: 0 8px 40px rgba(0,0,0,0.10);
}

/* ══ 기본 타이포 ══ */
body {
  font-family: 'Noto Sans KR', sans-serif !important;
  background: var(--mh-bg) !important;
  color: var(--mh-ink);
  letter-spacing: -0.02em;
  line-height: 1.6;
}
a { color: var(--dis-acc); }
a:hover, a:focus { color: var(--dis-bg); }

/* ══ 그누보드 잔재 숨기기 ══ */
#tnb, #gnb, #hd_wrapper, #aside, #ft_link, #ft_company, #ft_copy,
#hd_sch, .hd_login, #gnb_all, #gnb_all_bg, #hd_define, #hd_qnb {
  display: none !important;
}
#hd_login_msg { display: none !important; }

/* ══ 상단 subnav ══ */
#hd .mh-subnav {
  position: sticky; top: 0; z-index: 50; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5vw; background: var(--dis-bg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
#hd .mh-back {
  display: flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,0.6); font-size: 0.78rem; font-weight: 600;
  text-decoration: none; transition: color 0.2s;
}
#hd .mh-back:hover { color: #fff; }
#hd .mh-logo {
  font-size: 1rem; font-weight: 900; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: 6px;
}
#hd .mh-right { display: flex; align-items: center; gap: 10px; }
#hd .mh-sns { display: flex; gap: 6px; }
#hd .mh-sns a {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
  color: rgba(255,255,255,0.8); text-decoration: none; transition: all 0.2s;
}
#hd .mh-sns a:hover { background: rgba(255,255,255,0.2); color: #fff; }
#hd .mh-phone, #hd .mh-admin {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.23);
  color: #fff; padding: 7px 18px; border-radius: 100px;
  font-size: 0.8rem; font-weight: 700; text-decoration: none;
  transition: background 0.2s;
}
#hd .mh-phone:hover { background: rgba(255,255,255,0.25); color: #fff; }
#hd .mh-admin { background: var(--dis-acc); border-color: var(--dis-acc); }
#hd .mh-admin:hover { background: #a93226; color: #fff; }

/* ══ 본문 영역 ══ */
#wrapper { max-width: 1180px; margin: 0 auto; padding: 0 5vw; width: auto; background: transparent; }
#container_wr { width: auto; background: transparent; }
#container {
  width: auto; float: none; margin: 40px 0 60px; padding: 0;
  background: transparent; border: 0; min-height: 400px;
}
#container_title {
  font-size: 1.6rem; font-weight: 900; letter-spacing: -0.03em;
  color: var(--mh-ink); margin: 0 0 28px; padding: 0 0 18px;
  border-bottom: 2px solid var(--mh-ink); height: auto; line-height: 1.3;
}

/* ══ 게시판 색상 통일 ══ */
/* 목록 상단 건수 표기 */
#bo_list .td_num, #bo_gall .td_num, .bo_fx .td_num,
#bo_list_total, .list_total, #bo_cate h2 { color: var(--mh-muted) !important; }
#bo_list_total strong, .list_total strong { color: var(--dis-acc) !important; }

/* 버튼류 */
.btn_b01, .btn_b02, .btn_submit, .btn_confirm .btn_submit,
#bo_list .btn_b01, #bo_v .btn_b01 {
  background: var(--dis-acc) !important; border-color: var(--dis-acc) !important;
  color: #fff !important; border-radius: 100px !important;
}
.btn_b01:hover, .btn_b02:hover, .btn_submit:hover { background: #a93226 !important; }
.btn_cancel, .btn_close {
  background: var(--mh-border) !important; border-color: var(--mh-border) !important;
  color: var(--mh-ink) !important; border-radius: 100px !important;
}
.btn_admin, .btn_admin:hover {
  background: var(--dis-bg) !important; border-color: var(--dis-bg) !important;
  color: #fff !important; border-radius: 100px !important;
}
.bo_fx .btn_bo_user > li > a, .bo_fx .btn_bo_adm > li > input,
#bo_list .bo_fx button, #bo_gall .bo_fx button { border-radius: 100px !important; }

/* ══ 갤러리: float 해제 후 그리드로 정렬 (카드 높이 통일) ══ */
#bo_gall .gall_row, #bo_gall > ul, #bo_gall ul.gall_row {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
#bo_gall .gall_row::after, #bo_gall > ul::after { display: none !important; }

#bo_gall .gall_li, #bo_gall .gall_row > li, #bo_gall > ul > li {
  float: none !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  overflow: hidden;
  background: var(--mh-white);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#bo_gall .gall_li:hover, #bo_gall .gall_row > li:hover {
  transform: translateY(-4px);
  box-shadow: var(--mh-shadow);
}

/* 썸네일 영역: 비율 고정 */
#bo_gall .gall_href, #bo_gall .gall_con > a:first-child {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--dis-soft);
  position: relative;
}
#bo_gall .gall_href img, #bo_gall .gall_con > a:first-child img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  margin: 0 !important;
}

/* 텍스트 영역: 남는 높이를 채워 카드 바닥을 맞춤 */
#bo_gall .gall_text_href, #bo_gall .gall_con {
  padding: 14px 16px 0 !important;
  flex: 1 1 auto;
}
#bo_gall .gall_li .bo_tit, #bo_gall .gall_text_href a {
  color: var(--mh-ink); font-weight: 700; line-height: 1.45;
}
#bo_gall .gall_text_href a:hover { color: var(--dis-acc); }
#bo_gall .gall_li .bo_cnt, #bo_gall .gall_li .gall_bottom,
#bo_gall .gall_li .profile_info { padding: 0 16px 14px !important; margin-top: auto; }
#bo_gall .gall_now .gall_subject { color: var(--dis-acc); }

/* 본문 보기 */
#bo_v_title, #bo_v_info, #bo_v_atc, #bo_v_top, #bo_v_bot {
  border-color: var(--mh-border) !important;
}
#bo_v_title .bo_v_tit { font-weight: 900; letter-spacing: -0.03em; color: var(--mh-ink); }
#bo_v { background: var(--mh-white); border: 1px solid var(--mh-border);
        border-radius: var(--mh-radius); padding: 28px 30px; }

/* 페이지네이션 */
.pg_current { background: var(--dis-acc) !important; border-color: var(--dis-acc) !important; }
.pg_page:hover { color: var(--dis-acc); }

/* 새글 N 아이콘 */
.new_icon, .bo_current { background: var(--dis-acc) !important; }

/* ══ 하단 (ID 선택자로 우선순위 확보) ══ */
#ft.mh-ft {
  background: var(--dis-bg) !important; color: rgba(255,255,255,0.75);
  padding: 48px 5vw 28px; margin-top: 60px; height: auto;
}
#ft.mh-ft a { color: rgba(255,255,255,0.7); }
#ft.mh-ft a:hover { color: #fff; }
#ft .mh-ft-wr {
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between;
}
#ft .mh-ft-brand strong { display: block; font-size: 1.15rem; font-weight: 900; color: #fff; }
#ft .mh-ft-brand span { font-size: 0.8rem; color: rgba(255,255,255,0.55); }
#ft .mh-ft-info p { margin: 0 0 6px; font-size: 0.82rem; }
#ft .mh-ft-info a { color: #fff; text-decoration: none; }
#ft .mh-ft-links { display: flex; flex-direction: column; gap: 8px; }
#ft .mh-ft-links a { font-size: 0.82rem; text-decoration: none; }
#ft .mh-ft-copy {
  max-width: 1180px; margin: 32px auto 0; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.75rem; color: rgba(255,255,255,0.45);
}
#top_btn {
  background: var(--dis-acc) !important; border-color: var(--dis-acc) !important;
  color: #fff !important;
}

/* ══ 모바일 ══ */
@media (max-width: 768px) {
  #hd .mh-subnav { padding: 0 4vw; gap: 8px; }
  #hd .mh-back span { display: none; }
  #hd .mh-back i { font-size: 1.3rem; }
  #hd .mh-phone { display: none; }
  #hd .mh-logo { font-size: 0.95rem; flex: 1; }
  #container_title { font-size: 1.25rem; }
  #container { margin: 24px 0 40px; }
  #ft .mh-ft-wr { flex-direction: column; gap: 24px; }
  #bo_gall .gall_row, #bo_gall > ul, #bo_gall ul.gall_row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

/* ══ 모바일에서 PC 게시판 스킨 보정 (G5_USE_MOBILE=false 전제) ══ */
#container img, #bo_v_con img, #bo_v_atc img, .view_image img {
  max-width: 100% !important; height: auto !important;
}
@media (max-width: 768px) {
  #bo_gall .gall_li { width: 50% !important; }
  #bo_gall .gall_con,
  #bo_gall .gall_href { width: auto !important; }
  #bo_gall .gall_href img,
  #bo_gall .gall_chk + a img { width: 100% !important; height: auto !important; }
  #bo_list, #bo_v, #bo_w { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #bo_list table, #bo_v table { width: 100% !important; min-width: 0 !important; }
  #bo_v_title .bo_v_tit { font-size: 1.05rem; line-height: 1.45; }
  .td_name, .td_num, .td_datetime, .td_num2 { font-size: 0.72rem; }
  #bo_v_info { font-size: 0.72rem; }
  .btn_b01, .btn_b02, .btn_submit, .btn_admin { padding: 8px 14px !important; font-size: 0.8rem !important; }
}
@media (max-width: 480px) {
  #bo_gall .gall_li { width: 100% !important; }
}

/* ══ 모바일 테마(mobile/) 전용 보정 ══ */
#hd_wrapper, #gnb_open, #user_btn, #user_menu, #text_size,
#hd_nb, #gnb_1dul, #device_change, #visit, aside#visit,
#ft_company, .ft_cnt, #ft_copy > br { display: none !important; }

body > #wrapper { padding: 0 4vw; }
#container_title.top {
  display: flex; align-items: center; gap: 8px;
  background: var(--mh-white); margin: 0 -4vw 20px; padding: 14px 4vw;
  border-bottom: 1px solid var(--mh-border); border-top: 0;
  font-size: 1.05rem; font-weight: 900; letter-spacing: -0.03em;
  color: var(--mh-ink); line-height: 1.4; height: auto;
}
#container_title.top a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; color: var(--dis-acc); flex-shrink: 0;
}
#container_title.top i { font-size: 1.3rem; }
#container_title.top.fixed {
  position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
#top_btn {
  background: var(--dis-acc) !important; border: 0 !important;
  color: #fff !important; border-radius: 50% !important;
}

/* ══ 배경 흰색 통일 시 카드 경계 보강 ══ */
#bo_gall .gall_con,
#bo_gall li .gall_href,
.gall_box { border: 1px solid var(--mh-border) !important; border-radius: 12px; overflow: hidden; }
#bo_list, #bo_gall, #container { background: var(--mh-white); }
.pg_wrap, #bo_sch { background: transparent !important; }
