@charset "utf-8";

/* ============================================================
   gallery.css — 갤러리 전용 (jj_gallery_modi)
   ============================================================ */

/* 서브 비주얼 숨김 */
#jj_sub_visual {
    display: none !important;
}

/* jj_sub_wrapper와 sub_contents inner의 패딩 제거 */
#jj_sub_wrapper,
.sub_contents.inner {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

/* gallery-container에 sub_wrap 역할 부여 */
.gallery-container {
    max-width: var(--wrap) !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

/* Total 표시 숨김 */
#bo_btn_top {
    display: none !important;
}

/* ==================== 히어로 섹션 (gallery.php와 동일) ==================== */
.gallery-hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%);
    border-radius: 0 0 32px 32px;
    padding: 60px 40px;
    margin-bottom: 50px;
    text-align: center;
    color: #fff;
}
.gallery-hero h1 {
    font-size: 36px;
    margin-bottom: 12px;
}
.gallery-hero h1 i {
    margin-right: 12px;
}
.gallery-hero p {
    font-size: 16px;
    opacity: 0.9;
}

/* ==================== 갤러리 필터 ==================== */
.gallery_filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.filter_btn {
    padding: 8px 24px;
    background: var(--bg);
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}
.filter_btn.active,
.filter_btn:hover {
    background: var(--brand);
    color: #fff;
}

/* ==================== 갤러리 그리드 ==================== */
.gallery_grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* ==================== 갤러리 아이템 ==================== */
.gallery_item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}
.gallery_item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.gallery_thumb {
    aspect-ratio: 1/1;
    width: 100%;
    overflow: hidden;
    position: relative;
}
.gallery_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.gallery_item:hover .gallery_thumb img {
    transform: scale(1.05);
}
.gallery_noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f5f5f5;
    color: #ccc;
    font-size: 40px;
}

/* NEW/공지 배지 (왼쪽 위) */
.gallery_badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: var(--brand);
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 5;
}
.gallery_badge.notice {
    background: #ff7b1e;
}
.gallery_badge.new {
    background: #e53e3e;
}

/* ==================== 관리자용 체크박스 (기존 위치/크기 유지하며 스타일만 추가) ==================== */
.gallery_chk {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 10;
}

/* ✅ 체크박스 input 숨기기 (기존 구조 유지) */
.gallery_chk input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* ✅ 체크박스 라벨 (기존 span 크기 유지: 15x15) */
.gallery_chk label {
    display: block;
    cursor: pointer;
    width: 15px;
    height: 15px;
}

/* ✅ 체크박스 디자인 (기존 크기/위치 유지) */
.gallery_chk label span {
    display: block !important;
    width: 15px !important;
    height: 15px !important;
    background: #fff !important;
    border: 2px solid #ccc !important;
    border-radius: 3px !important;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

/* ✅ 체크박스 hover 효과 */
.gallery_chk label:hover span {
    border-color: var(--brand) !important;
    background: #f0f7ff !important;
}

/* ✅ 체크박스 체크된 상태 (배경색 채워짐) */
.gallery_chk input[type="checkbox"]:checked + label span {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
}

/* ✅ 체크 표시 (체크된 상태에 ✓ 표시) */
.gallery_chk input[type="checkbox"]:checked + label span::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* ==================== 정보 영역 ==================== */
.gallery_info {
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gallery_info h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.gallery_badge_cate {
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--brand);
    margin-left: 8px;
    flex-shrink: 0;
}

/* ==================== 하단 버튼 바 ==================== */
.bo_fx {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 12px;
    border-top: 0px solid #e4e4e4;
    margin-bottom: 20px;
}
.btn_bo_user {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.btn_bo_user li {
    position: relative;
}
.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;
}

/* ==================== 페이징 ==================== */
.pg_wrap {
    text-align: center;
    margin: 20px auto;
}
.pg {
    display: inline-block;
}
.pg a,
.pg strong {
    display: inline-block;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    margin: 0 2px;
    font-size: 14px;
    line-height: 32px;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: var(--white);
    color: #555;
    text-align: center;
}
.pg strong {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--white);
}
.pg a:hover {
    background: #f5f5f5;
    border-color: var(--brand);
    color: var(--brand);
}

/* ==================== 마무리 문구 ==================== */
.gallery-footer-msg {
    text-align: center;
    padding: 40px 20px;
    font-size: 20px;
    font-weight: 500;
    color: var(--brand);
    border-top: 1px solid var(--border);
}

/* ==================== 검색 모달 ==================== */
.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);
}
.bo_sch h3 {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    margin: 0;
}
.bo_sch form {
    padding: 16px 20px 20px;
}
.bo_sch select {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}
.bo_sch .sch_bar {
    display: flex;
    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;
}
.bo_sch .sch_btn {
    width: 44px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
}
.bo_sch .bo_sch_cls {
    position: absolute;
    top: 0;
    right: 0;
    padding: 14px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* ==================== 빈 목록 ==================== */
.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: 16px;
}

/* ==================== 반응형 ==================== */
@media (max-width: 1024px) {
    .gallery_grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}
@media (max-width: 768px) {
    .gallery-hero {
        padding: 40px 24px;
    }
    .gallery-hero h1 {
        font-size: 28px;
    }
    .gallery_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .gallery_info {
        padding: 10px;
    }
    .gallery_info h4 {
        font-size: 12px;
    }
    .filter_btn {
        padding: 6px 16px;
        font-size: 12px;
    }
    .bo_fx {
        margin-top: 10px;
        padding-top: 10px;
    }
    .pg a,
    .pg strong {
        min-width: 30px;
        height: 30px;
        line-height: 28px;
        font-size: 12px;
    }
    .gallery-footer-msg {
        font-size: 14px;
        padding: 30px 16px;
    }
    .gallery-container {
        padding: 0 16px !important;
    }
    /* 모바일에서 체크박스 위치 조정 */
    .gallery_chk {
        top: 8px !important;
        right: 8px !important;
    }
}
@media (max-width: 480px) {
    .gallery_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .gallery_info h4 {
        font-size: 12px;
    }
    .pg a,
    .pg strong {
        min-width: 28px;
        height: 28px;
        line-height: 26px;
        font-size: 11px;
    }
}