@charset "utf-8";

/* ============================================================
   gallery.css — 갤러리 전용
   의존: style.css (공통 reset, 버튼, 체크박스)
   컬러/폰트/페이징/버튼은 jjtheme.css :root 변수 사용
   (jj_basic list.css와 동일한 변수 체계)
   ============================================================ */

/* ------------------------------------------------------------
   1. 컨테이너
------------------------------------------------------------ */
#bo_gall {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    box-sizing: border-box;
}
#bo_gall::after {
    display: block; visibility: hidden; clear: both; content: "";
}

/* ------------------------------------------------------------
   2. 카테고리 바 — basic list.css와 완전 동일
------------------------------------------------------------ */
#bo_cate {
    margin: 16px 0 12px;
}
#bo_cate h2 {
    position: absolute; font-size: 0; line-height: 0; overflow: hidden;
}
#bo_cate ul {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin: 0; padding: 0; list-style: none;
}
#bo_cate li { display: inline-block; }
#bo_cate a {
    display: inline-block;
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--txt-s);
    line-height: 1.6;
    transition: border-color 0.15s, color 0.15s;
}
#bo_cate a:hover,
#bo_cate a:focus,
#bo_cate #bo_cate_on {
    border-color: var(--brand);
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

/* ------------------------------------------------------------
   3. 상단 바 — Total 건수 (basic과 동일)
------------------------------------------------------------ */
#bo_btn_top {
    padding: 8px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid #e4e4e4;
}
#bo_btn_top::after {
    display: block; visibility: hidden; clear: both; content: "";
}
#bo_list_total {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
}
#bo_list_total span {
    color: var(--txt);
    font-weight: 600;
}

/* ------------------------------------------------------------
   4. 갤러리 그리드
------------------------------------------------------------ */
.gall_grid {
    display: grid;
    grid-template-columns: repeat(var(--gal-pc-cols, 4), 1fr);
    gap: 20px;
    margin: 20px 0 0;
}

/* ------------------------------------------------------------
   5. 갤러리 아이템
------------------------------------------------------------ */
.gall_item {
    position: relative;
    background: var(--white);
    border: 1px solid #ececec;
    border-radius: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
.gall_item:hover {
    border-color: var(--brand);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

/* 공지 아이템 — basic의 .bo_notice와 동일한 배경색 */
.gall_item.gall_notice {
    background: #ebffef;
    border-color: #b2dfb7;
}

/* ------------------------------------------------------------
   6. 체크박스 (master_에게만 렌더링, 위치만 정의)
------------------------------------------------------------ */
.gall_item_chk {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

/* ------------------------------------------------------------
   7. 링크 래퍼
------------------------------------------------------------ */
.gall_item_link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.gall_item_link:hover { text-decoration: none; }

/* ------------------------------------------------------------
   8. 썸네일
------------------------------------------------------------ */
.gall_thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f5;
}
.gall_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
.gall_item:hover .gall_thumb img {
    transform: scale(1.03);
}
.gall_noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f5f5f5;
}
.gall_noimg i {
    font-size: 40px;
    color: #ccc;
}

/* ------------------------------------------------------------
   9. 배지 — basic의 notice_icon / bo_new와 동일한 스타일 기준
------------------------------------------------------------ */
.gall_new,
.gall_notice_badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 2px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
/* 새글: basic bo_new 배경(#f0f6ff)과 연계, 뱃지는 brand 컬러 */
.gall_new {
    color: var(--white);
    background: var(--brand);
    border: 1px solid var(--brand);
}
/* 공지: basic notice_icon과 동일 */
.gall_notice_badge {
    color: var(--brand);
    background: var(--white);
    border: 1px solid var(--brand);
}

/* ------------------------------------------------------------
   10. 정보 영역
------------------------------------------------------------ */
.gall_info {
    padding: 10px 12px 12px;
}

/* 카테고리 — basic bo_cate_link와 동일 */
.gall_cate {
    display: inline-block;
    padding: 2px 7px;
    font-size: 11px;
    color: var(--brand);
    border: 1px solid #b8d0e8;
    border-radius: 2px;
    background: transparent;
    margin-bottom: 6px;
    white-space: nowrap;
}

/* 제목 — basic bo_tit a와 동일한 폰트 기준 */
.gall_subject {
    font-size: 14px;
    font-weight: 500;
    color: var(--txt);
    line-height: 1.45;
    margin-bottom: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.gall_item:hover .gall_subject {
    color: var(--brand);
}

/* 댓글 수 — basic cnt_cmt와 동일 */
.gall_cmt {
    display: inline-block;
    padding: 0 5px;
    height: 16px;
    line-height: 16px;
    font-size: 11px;
    color: var(--brand);
    background: var(--brand-light);
    border-radius: 2px;
    font-weight: 400;
    vertical-align: middle;
    margin-left: 4px;
}

/* 메타 — basic td_datetime/td_name 폰트 기준 */
.gall_meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
    line-height: 1.5;
}
.gall_meta i {
    margin-right: 3px;
    font-size: 11px;
    color: #ccc;
}

/* 추천 */
.gall_good {
    font-size: 11px;
    color: #aaa;
}
.gall_good i { margin-right: 3px; color: #ccc; }

/* ------------------------------------------------------------
   11. 하단 버튼 바 — basic bo_fx와 완전 동일
------------------------------------------------------------ */
.bo_fx {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 14px 0 6px;
    padding-top: 12px;
    border-top: 1px solid #e4e4e4;
    float: none;
}
.bo_fx::after {
    display: block; visibility: hidden; clear: both; content: "";
}

.btn_bo_user {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0; padding: 0;
    list-style: none;
    float: none;
}
.btn_bo_user li {
    float: none;
    width: auto;
    background: transparent;
    margin: 0;
}
.btn_bo_user > li { position: relative; }

/* 드롭업 (basic list.css와 동일) */
.btn_bo_user .more_opt {
    top: auto;
    bottom: 42px;
}
.btn_bo_user .more_opt::before {
    top: auto;
    bottom: -6px;
    transform: rotate(225deg);
}
.btn_bo_user .more_opt { min-width: 110px; }
.btn_bo_user .more_opt li { padding: 9px 4px 9px 14px; }

/* ------------------------------------------------------------
   12. 검색창 — basic list.css와 완전 동일 (모달형)
------------------------------------------------------------ */
.bo_sch_wrap {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
}
.bo_sch_bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.25);
}
.bo_sch {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(360px, 90vw);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: visible;
    max-height: none;
    margin: 0;
    text-align: left;
}
.bo_sch::after { display: block; visibility: hidden; clear: both; content: ""; }
.bo_sch h3 {
    padding: 16px 20px;
    font-size: 14px; font-weight: 600; color: var(--txt);
    border-bottom: 1px solid #eee;
    margin: 0;
}
.bo_sch legend { position: absolute; width: 0; height: 0; overflow: hidden; background: transparent; }
.bo_sch form { padding: 16px 20px 20px; display: block; }
.bo_sch select {
    border: 1px solid var(--border);
    width: 100%; height: 40px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 13px; color: #444;
    background: var(--white);
    appearance: auto;
}
.bo_sch select:focus { border-color: var(--brand); outline: none; }
.bo_sch .sch_bar {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.bo_sch .sch_input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: none;
    background: var(--white);
    font-size: 13px; color: var(--txt);
    box-shadow: none;
}
.bo_sch .sch_input:focus { outline: none; border: none !important; box-shadow: none; }
.bo_sch .sch_btn {
    width: 44px; height: 40px;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--white);
    color: var(--txt-s); font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s;
}
.bo_sch .sch_btn:hover { color: var(--brand); }
.bo_sch .bo_sch_cls {
    position: absolute;
    top: 0; right: 0;
    padding: 14px 16px;
    font-size: 16px; color: #bbb;
    background: transparent; border: none;
    cursor: pointer; line-height: 1;
    transition: color 0.15s;
}
.bo_sch .bo_sch_cls:hover { color: #555; }

/* ------------------------------------------------------------
   13. 빈 목록
------------------------------------------------------------ */
.gall_empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #aaa;
    font-size: 14px;
    border: 1px solid #ececec;
    background: #fafafa;
    border-radius: 4px;
}

/* ------------------------------------------------------------
   14. 페이징 — basic list.css와 완전 동일
------------------------------------------------------------ */
.pg_wrap {
    position: relative;
    display: block;
    text-align: center;
    width: 100%;
    float: none;
    clear: both;
    margin: 30px 0 20px;
}
.pg {
    display: inline-block;
    float: none;
    margin: 0 auto;
    padding: 0;
}
.pg a,
.pg strong {
    display: inline-block;
    float: none;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    margin: 0 2px;
    font-size: 14px;
    font-family: 'Apple SD Gothic Neo', sans-serif !important;
    line-height: 32px;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: var(--white);
    color: #555;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
    transition: all 0.2s;
}
.pg strong {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--white);
    font-weight: 600;
}
.pg a:hover {
    background: #f5f5f5;
    border-color: var(--brand);
    color: var(--brand);
}
.pg_start a, .pg_prev a, .pg_next a, .pg_end a {
    font-size: 0 !important;
    position: relative;
}
.pg_start a:before { content: "\f100"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 14px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #555; }
.pg_prev  a:before { content: "\f104"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 14px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #555; }
.pg_next  a:before { content: "\f105"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 14px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #555; }
.pg_end   a:before { content: "\f101"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 14px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #555; }
.pg_start a:hover:before, .pg_prev a:hover:before,
.pg_next a:hover:before, .pg_end a:hover:before { color: var(--brand); }

/* ------------------------------------------------------------
   15. 반응형
------------------------------------------------------------ */
@media (max-width: 1024px) {
    .gall_grid {
        grid-template-columns: repeat(var(--gal-tablet-cols, 3), 1fr);
        gap: 15px;
    }
}
@media (max-width: 767px) {
    .gall_grid {
        grid-template-columns: repeat(var(--gal-mobile-cols, 2), 1fr);
        gap: 10px;
    }
    .gall_info { padding: 8px 10px 10px; }
    .gall_subject { font-size: 13px; }
    .gall_meta { font-size: 10px; gap: 6px; }
    .bo_fx { margin-top: 10px; padding-top: 10px; }
    .pg a, .pg strong {
        min-width: 30px; height: 30px; line-height: 28px;
        padding: 0 6px; font-size: 12px;
    }
    .pg_start a:before, .pg_prev a:before,
    .pg_next a:before, .pg_end a:before { font-size: 12px; }
}
@media (max-width: 480px) {
    .gall_subject { font-size: 12px; }
    .pg a, .pg strong {
        min-width: 28px; height: 28px; line-height: 26px;
        padding: 0 4px; font-size: 11px;
    }
    .pg_start a:before, .pg_prev a:before,
    .pg_next a:before, .pg_end a:before { font-size: 11px; }
}
