@charset "utf-8";

/* =========================================================
  MGX9 Premium Gallery Skin (v6)
  - PC: 5열, Mobile: 2열
  - Sticky category bar: PC만 sticky, 모바일은 sticky 해제
  - Mobile search overflow fix
  - Category color: 파스텔 7색 고정(확실히 구분) - JS가 변수 주입
========================================================= */

:root{
  --mgx-ink:#121316;
  --mgx-sub:rgba(18,19,22,.62);
  --mgx-line:rgba(18,19,22,.10);
  --mgx-line2:rgba(18,19,22,.16);
  --mgx-card:#fff;
  --mgx-soft:rgba(0,0,0,.06);
  --mgx-soft2:rgba(0,0,0,.12);
  --mgx-radius:18px;
  --mgx-gap:18px;
  --mgx-max:1500px;

  /* 테마 상단 고정헤더가 있으면 이 값만 조절 */
  --mgx-sticky-top:88px;
}

#bo_gall.mgx9, #bo_v.mgx9, #bo_vc.mgx9, #bo_w.mgx9{
  color:var(--mgx-ink);
  box-sizing:border-box;
}
#bo_gall.mgx9 *, #bo_v.mgx9 *, #bo_vc.mgx9 *, #bo_w.mgx9 *{ box-sizing:border-box; }
#bo_gall.mgx9 a, #bo_v.mgx9 a, #bo_vc.mgx9 a, #bo_w.mgx9 a{ color:inherit; text-decoration:none; }
#bo_gall.mgx9 a:hover, #bo_v.mgx9 a:hover, #bo_vc.mgx9 a:hover, #bo_w.mgx9 a:hover{ text-decoration:none; }

#bo_gall.mgx9 .inner,
#bo_v.mgx9 .inner,
#bo_w.mgx9 .inner{
  max-width:var(--mgx-max);
  margin:0 auto;
  padding:0 18px;
}
#bo_gall.mgx9 .inner{ overflow:visible; }

.mgx9 .mgx-card{
  background:var(--mgx-card);
  border:1px solid var(--mgx-line);
  border-radius:var(--mgx-radius);
  box-shadow:0 12px 34px var(--mgx-soft);
}

/* 버튼 */
#bo_gall.mgx9 .btn,
#bo_v.mgx9 .btn,
#bo_w.mgx9 .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:44px;
  padding:0 16px;
  border-radius:12px;
  border:1px solid var(--mgx-line2);
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  font-weight:800;
  letter-spacing:-.2px;
}
#bo_gall.mgx9 .btn:hover,
#bo_v.mgx9 .btn:hover,
#bo_w.mgx9 .btn:hover{
  border-color:rgba(18,19,22,.22);
  box-shadow:0 16px 40px var(--mgx-soft2);
}
#bo_gall.mgx9 .btn_b02.btn,
#bo_v.mgx9 .btn_b02.btn,
#bo_w.mgx9 .btn_submit{
  background:#111;
  color:#fff;
  border-color:#111;
}
#bo_gall.mgx9 .btn_b01.btn,
#bo_v.mgx9 .btn_b01.btn{
  height:40px;
  padding:0 14px;
}

/* =========================================================
   LIST (Gallery)
========================================================= */

/* 검색 */
#bo_gall.mgx9 .search_box{ margin:0 0 14px; }
#bo_gall.mgx9 #bo_sch{
  width:100%;
  border:1px solid var(--mgx-line);
  border-radius:16px;
  padding:10px;
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
#bo_gall.mgx9 #bo_sch form{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
  min-width:0;
}
#bo_gall.mgx9 #bo_sch select{
  height:44px;
  border-radius:12px;
  border:1px solid var(--mgx-line);
  padding:0 12px;
  background:#fff;
}
#bo_gall.mgx9 #bo_sch .sch_input{
  flex:1;
  min-width:0; /* ✅ overflow 방지 핵심 */
  height:44px;
  border-radius:12px;
  border:1px solid var(--mgx-line);
  padding:0 12px;
  outline:none;
  background:#fff;
}
#bo_gall.mgx9 #bo_sch .sch_btn{
  height:44px;
  min-width:44px;
  border-radius:12px;
  border:1px solid #111;
  background:#111;
  color:#fff;
  cursor:pointer;
}

/* ✅ 스티키 카테고리바 (PC 기본: sticky) */
#bo_gall.mgx9 #bo_cate{
  position:sticky;
  top:var(--mgx-sticky-top);
  z-index:50;
  margin:12px 0 16px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(18,19,22,.10);
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  box-shadow:0 16px 40px rgba(0,0,0,.08);
}
#bo_gall.mgx9 #bo_cate ul{
  border:0;
  width:100%;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
  margin:0;
  padding:0;
}
#bo_gall.mgx9 #bo_cate li{ margin:0; }

/* 상단 카테고리 버튼(색상은 JS가 변수 주입) */
#bo_gall.mgx9 #bo_cate a{
  --cat-bg: rgba(17,17,17,.05);
  --cat-bd: rgba(18,19,22,.14);
  --cat-tx: rgba(18,19,22,.82);

  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:42px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid var(--cat-bd);
  background:var(--cat-bg);
  color:var(--cat-tx);
  font-size:15px;
  font-weight:850;
  letter-spacing:-.2px;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
#bo_gall.mgx9 #bo_cate a:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 26px rgba(0,0,0,.08);
  border-color:rgba(18,19,22,.22);
}
#bo_gall.mgx9 #bo_cate #bo_cate_on{
  background:#111 !important;
  color:#fff !important;
  border-color:#111 !important;
  box-shadow:0 14px 34px rgba(0,0,0,.16);
}

/* 상단 info/버튼 */
#bo_gall.mgx9 #bo_btn_top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 14px;
}
#bo_gall.mgx9 .sub_total{
  margin:0;
  font-weight:850;
  letter-spacing:-.2px;
  color:rgba(18,19,22,.72);
}
#bo_gall.mgx9 .sub_total span{ color:#111; margin:0 6px; }
#bo_gall.mgx9 .btn_bo_user{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  gap:8px;
  align-items:center;
}
#bo_gall.mgx9 .btn_bo_user li{ margin:0; }

/* 그리드 */
#bo_gall.mgx9 #gall_ul.gall_row{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:var(--mgx-gap);
}
#bo_gall.mgx9 .gall_li{
  float:none !important;
  width:auto !important;
  margin:0 !important;
  display:block !important;
}

/* 카드 */
#bo_gall.mgx9 .gall_box{
  border:1px solid var(--mgx-line);
  border-radius:var(--mgx-radius);
  background:#fff;
  box-shadow:0 10px 28px var(--mgx-soft);
  overflow:hidden;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#bo_gall.mgx9 .gall_box:hover{
  transform:translateY(-2px);
  border-color:rgba(18,19,22,.18);
  box-shadow:0 18px 45px var(--mgx-soft2);
}

/* 썸네일 */
#bo_gall.mgx9 .gall_img{
  position:relative;
  overflow:hidden;
  background:rgba(0,0,0,.04);
}
#bo_gall.mgx9 .gall_img a{ display:block; }
#bo_gall.mgx9 .gall_img img{
  width:100%;
  display:block;
  aspect-ratio:4/3;
  object-fit:cover;
  transform:scale(1.001);
  transition:transform .25s ease;
}
#bo_gall.mgx9 .gall_box:hover .gall_img img{ transform:scale(1.045); }

#bo_gall.mgx9 .gall_text_href{ padding:12px 14px 10px; }

/* 카테고리 뱃지 */
#bo_gall.mgx9 .bo_cate_link{
  --cat-bg: rgba(17,17,17,.06);
  --cat-bd: rgba(18,19,22,.14);
  --cat-tx: rgba(18,19,22,.86);

  display:inline-flex;
  align-items:center;
  height:28px;
  padding:0 11px;
  border-radius:999px;
  border:1px solid var(--cat-bd);
  background:var(--cat-bg);
  color:var(--cat-tx) !important;
  font-size:13px;
  font-weight:850;
  letter-spacing:-.2px;
  margin-bottom:9px;
}

#bo_gall.mgx9 .bo_tit{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  word-break:break-word;
  line-height:1.42;
  font-weight:800;
  font-size:16px;
  letter-spacing:-.25px;
  min-height:46px;
  color:#111;
}

/* 카드 하단 메타 */
#bo_gall.mgx9 .mgx_meta{
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 14px 14px;
  color:rgba(18,19,22,.56);
  font-size:12px;
  font-weight:800;
  letter-spacing:-.1px;
}
#bo_gall.mgx9 .mgx_meta .dot{ opacity:.55; }
#bo_gall.mgx9 .mgx_meta .meta_item{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
#bo_gall.mgx9 .mgx_meta i{ opacity:.7; }

#bo_gall.mgx9 .empty_list{
  grid-column:1 / -1;
  padding:90px 0;
  text-align:center;
  color:var(--mgx-sub);
  border-radius:var(--mgx-radius);
  border:1px dashed rgba(18,19,22,.18);
  background:rgba(255,255,255,.55);
}

/* 페이지네이션 */
#bo_gall.mgx9 .pg_wrap{ margin:18px 0 0; }
#bo_gall.mgx9 .pg{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
#bo_gall.mgx9 .pg a,
#bo_gall.mgx9 .pg span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:38px;
  height:38px;
  padding:0 10px;
  border-radius:12px;
  border:1px solid var(--mgx-line);
  background:rgba(255,255,255,.72);
  font-weight:850;
}
#bo_gall.mgx9 .pg .pg_current{
  background:#111;
  color:#fff;
  border-color:#111;
}

/* =========================================================
   VIEW
========================================================= */
#bo_v.mgx9 .mgx-card{ padding:26px 24px; }
#bo_v.mgx9 #bo_v_title{ margin:0; }

#bo_v.mgx9 .bo_v_cate{
  --cat-bg: rgba(17,17,17,.05);
  --cat-bd: rgba(18,19,22,.12);
  --cat-tx: rgba(18,19,22,.82);

  display:inline-flex;
  align-items:center;
  height:30px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid var(--cat-bd);
  background:var(--cat-bg);
  color:var(--cat-tx);
  font-size:13px;
  font-weight:850;
}
#bo_v.mgx9 .bo_v_tit{
  display:block;
  margin-top:10px;
  font-size:30px;
  line-height:1.25;
  letter-spacing:-.55px;
  font-weight:850;
  color:#111;
  word-break:break-word;
}

#bo_v.mgx9 #bo_v_info{
  margin-top:18px;
  padding-bottom:16px;
  border-bottom:1px solid var(--mgx-line);
}
#bo_v.mgx9 #bo_v_info h2{ margin:0 0 10px; font-size:14px; color:rgba(18,19,22,.55); }
#bo_v.mgx9 .profile_info{ display:flex; align-items:center; gap:12px; }
#bo_v.mgx9 .pf_img img{ width:44px; height:44px; border-radius:50%; }
#bo_v.mgx9 .profile_info_ct strong{ display:block; font-weight:850; color:#111; }
#bo_v.mgx9 .profile_info_ct .meta{
  margin-top:6px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  color:rgba(18,19,22,.62);
  font-size:13px;
  font-weight:800;
}

#bo_v.mgx9 #bo_v_con{
  margin:14px 0 18px;
  line-height:1.85;
  font-size:16px;
  color:rgba(18,19,22,.86);
  word-break:break-word;
}
#bo_v.mgx9 #bo_v_con img{ max-width:100%; height:auto; border-radius:14px; }
#bo_v.mgx9 #bo_v_img{ margin-top:16px; }
#bo_v.mgx9 #bo_v_img img{
  max-width:100%;
  height:auto;
  border-radius:14px;
  border:1px solid rgba(18,19,22,.10);
}

#bo_v.mgx9 #bo_v_act{ margin-top:18px; text-align:center; }
#bo_v.mgx9 #bo_v_act a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:46px;
  padding:0 18px;
  border-radius:999px;
  border:1px solid rgba(18,19,22,.14);
  background:rgba(17,17,17,.04);
  font-weight:850;
}

#bo_v.mgx9 #bo_v_top{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid rgba(18,19,22,.08);
}
#bo_v.mgx9 .bo_v_com{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
#bo_v.mgx9 .btn_more_opt{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(18,19,22,.10);
  background:rgba(17,17,17,.04);
  cursor:pointer;
}
#bo_v.mgx9 .more_opt{
  display:none;
  position:absolute;
  top:44px;
  right:0;
  list-style:none;
  margin:0;
  padding:6px;
  min-width:120px;
  border-radius:14px;
  border:1px solid rgba(18,19,22,.10);
  background:rgba(255,255,255,.94);
  box-shadow:0 16px 40px rgba(0,0,0,.14);
  z-index:9999;
}
#bo_v.mgx9 .more_opt li{ border-bottom:1px solid rgba(18,19,22,.06); }
#bo_v.mgx9 .more_opt li:last-child{ border-bottom:none; }
#bo_v.mgx9 .more_opt a{ display:block; padding:10px 10px; font-weight:850; }

/* =========================================================
   COMMENTS
========================================================= */
#bo_vc.mgx9 .mgx-card{ padding:18px 18px 10px; margin-top:12px; }
#bo_vc.mgx9 h2{ margin:0 0 10px; font-size:14px; color:rgba(18,19,22,.55); }
#bo_vc.mgx9 article{ margin:14px 0; padding:14px 0; border-bottom:1px solid rgba(18,19,22,.08); }
#bo_vc.mgx9 article:last-child{ border-bottom:none; }
#bo_vc.mgx9 .pf_img img{ width:40px; height:40px; border-radius:50%; }

#bo_v.mgx9 .cmt_btn{
  width:100%;
  border:0;
  background:transparent;
  padding:16px 0;
  margin-top:14px;
  cursor:pointer;
}
#bo_v.mgx9 .cmt_btn .total{ font-weight:850; letter-spacing:-.2px; }
#bo_v.mgx9 .cmt_btn .cmt_more{ float:right; opacity:.6; }

/* =========================================================
   WRITE
========================================================= */
#bo_w.mgx9 .mgx-card{ padding:22px 18px; }
#bo_w.mgx9 .frm_input,
#bo_w.mgx9 select,
#bo_w.mgx9 textarea{
  border:1px solid rgba(18,19,22,.12);
  border-radius:12px;
  padding:12px 12px;
  outline:none;
  background:#fff;
}
#bo_w.mgx9 textarea{ min-height:140px; }

/* 반응형 */
@media (max-width:1200px){
  #bo_gall.mgx9 #gall_ul.gall_row{ grid-template-columns:repeat(4, minmax(0,1fr)); }
}

@media (max-width:768px){
  #bo_gall.mgx9 .inner, #bo_v.mgx9 .inner, #bo_w.mgx9 .inner{ padding:0 14px; }

  /* ✅ 모바일 검색창 overflow 해결 (줄바꿈 + 너비 강제) */
  #bo_gall.mgx9 #bo_sch form{
    flex-wrap:wrap;
    gap:8px;
  }
  #bo_gall.mgx9 #bo_sch select{
    width:100%;
    flex:1 1 100%;
    height:42px;
  }
  #bo_gall.mgx9 #bo_sch .sch_input{
    flex:1 1 auto;
    width:calc(100% - 52px);
    height:42px;
  }
  #bo_gall.mgx9 #bo_sch .sch_btn{
    height:42px;
    min-width:44px;
    width:44px;
  }

  #bo_gall.mgx9 #gall_ul.gall_row{
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:12px;
  }

  /* ✅ 모바일에서는 스티키 해제 */
  #bo_gall.mgx9 #bo_cate{
    position:static;
    top:auto;
    z-index:auto;
  }

  #bo_gall.mgx9 #bo_cate{ padding:12px 10px; border-radius:16px; }
  #bo_gall.mgx9 #bo_cate a{ height:38px; padding:0 14px; font-size:14px; }

  #bo_v.mgx9 .mgx-card{ padding:20px 16px; border-radius:16px; }
  #bo_v.mgx9 .bo_v_tit{ font-size:22px; font-weight:850; }
}
