@charset "utf-8";

/* ============================================================
   gallery.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. 카테고리 바
------------------------------------------------------------ */
#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. 상단 바
------------------------------------------------------------ */
#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);
}
.gall_item.gall_notice {
    background: #ebffef;
    border-color: #b2dfb7;
}

/* ------------------------------------------------------------
   6. 체크박스
------------------------------------------------------------ */
.gall_item_chk {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

/* ------------------------------------------------------------
   7. 썸네일
------------------------------------------------------------ */
.gall_thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    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;
}

/* ------------------------------------------------------------
   8. 배지
------------------------------------------------------------ */
.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;
}
.gall_new {
    color: var(--white);
    background: var(--brand);
    border: 1px solid var(--brand);
}
.gall_notice_badge {
    color: var(--brand);
    background: var(--white);
    border: 1px solid var(--brand);
}

/* ------------------------------------------------------------
   9. 정보 영역
------------------------------------------------------------ */
.gall_info {
    padding: 10px 12px 12px;
}
.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;
}
.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);
}
.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;
}
.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;
}

/* ------------------------------------------------------------
   10. 하단 버튼 바
------------------------------------------------------------ */
.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;
}
.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;
}

/* ------------------------------------------------------------
   11. 검색 모달
------------------------------------------------------------ */
.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;
}

/* ------------------------------------------------------------
   12. 페이징
------------------------------------------------------------ */
.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: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);
}
.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;
}

/* ------------------------------------------------------------
   13. 반응형 (jj_video 스킨 방식)
------------------------------------------------------------ */
/* PC: 1025px 이상 */
/* 태블릿 (744px ~ 1024px): 2개 */
@media (min-width: 744px) and (max-width: 1024px) {
    .gall_grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
        max-width: 100%;
        margin: 0 auto;
        padding: 0px;
    }
}

/* 휴대폰 (743px 이하): 1개 */
@media (max-width: 743px) {
    .gall_grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        max-width: 100%;
        margin: 0 auto;
        padding: 0px;
    }
    .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;
    }
}

/* ============================================================
   PhotoSwipe v5 모달 커스텀 스타일 (이미지 모달 전용)
   ※ 클래스명은 PhotoSwipe v5 기본 구조 기준입니다. 실제 화면에서
     버튼 스타일이 안 먹으면 브라우저 개발자도구로 실제 클래스명을
     확인해서 맞춰주세요(마이너 버전에 따라 살짝 다를 수 있음).
   동영상 모달(.mfp-youtube-video)은 Magnific Popup 그대로 유지 —
   위쪽 "YouTube 모달 스타일" 블록은 이 파일이 아니라 list.skin.php의
   <style> 안에 있으므로 그대로 둡니다.
   ============================================================ */

/* 테마 헤더/사이드바(z-index 10000~10001)보다 항상 위에 뜨도록 보정 */
.pswp {
    z-index: 100000;
}

.pswp__bg {
    background: #000;
}

/* ★ 상단바 자체를 우하단으로 이동 — 안에 있는 확대(zoom)/닫기(close) 버튼이
   flex로 자동 정렬되어 서로 어긋나지 않는다. 카운터는 top-bar 안에 있어도
   position:fixed로 따로 빼놨기 때문에(아래) 좌상단에 그대로 남는다. */
.pswp__top-bar {
    position: fixed;
    top: auto;
    left: auto;
    bottom: 24px;
    right: 24px;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    padding: 0;
}

/* 확대(돋보기) 버튼 */
.pswp__button--zoom {
    position: relative;
    width: 44px !important;
    height: 44px !important;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0.85;
    transition: background 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pswp__button--zoom:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}
/* 기본 SVG 아이콘은 숨기고, 폰트어썸 문자로 직접 그린다
   (SVG 내부 좌표에 의존하지 않아 버튼 크기를 바꿔도 항상 정중앙 유지) */
.pswp__button--zoom .pswp__icn {
    display: none;
}
.pswp__button--zoom::before {
    content: '\f00e'; /* fa-search-plus(확대) — 동그라미 안에 꽉 차 보이도록 큼직하게 */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 20px;
    line-height: 1;
    color: #fff;
}
/* 이미 확대된 상태에서는 축소 아이콘으로 전환 (PhotoSwipe가 자동으로 붙이는 클래스) */
.pswp--zoomed-in .pswp__button--zoom::before {
    content: '\f010'; /* fa-search-minus(축소) */
}

/* 닫기 버튼 — 상단바 안에서 확대 버튼과 같은 높이로 나란히
   ★ 모든 속성에 !important — PhotoSwipe 기본 .pswp__button:hover 스타일이
   specificity를 더 높게 잡고 있어서(예: button.pswp__button:hover 등) 일부만
   저희 스타일이 이기고 일부는 라이브러리 기본값이 이기며 두 스타일이 동시에
   경합해 호버 시 미세하게 떨리는 현상이 있었다. !important로 완전히 봉쇄. */
.pswp__button--close {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 22px !important;
    box-sizing: border-box !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #fff !important;
    opacity: 0.85 !important;
    transform: none !important;
    transition: background 0.25s ease, opacity 0.25s ease !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
}
.pswp__button--close:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    opacity: 1 !important;
    transform: none !important;
}
.pswp__button--close:active {
    background: rgba(255, 255, 255, 0.32) !important;
    transform: none !important;
}
.pswp__button--close:focus {
    outline: none !important;
}
.pswp__button--close .pswp__icn {
    display: none !important; /* 기본 X 아이콘 대신 텍스트로 표시 */
}
.pswp__button--close::before {
    content: 'close';
    font-family: 'Font Awesome 6 Free', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.3px;
}

/* 좌우 화살표 — box-sizing/padding을 명시해서 타원형으로 찌그러지지 않게 함
   ★ position은 absolute 유지(+세로 중앙 정렬) — relative로 바꾸면 문서 흐름에
   갇혀서 공간이 좁을 때 줄바꿈되며 옆으로 밀리는 문제가 생긴다 */
.pswp__button--arrow--prev,
.pswp__button--arrow--next {
    position: absolute !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: 48px !important;
    height: 48px !important;
    padding: 0;
    margin: 0 !important;
    box-sizing: border-box;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0.6;
    transition: background 0.25s ease, opacity 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pswp__button--arrow--prev:hover,
.pswp__button--arrow--next:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
}
.pswp__button--arrow--prev { left: 24px !important; right: auto !important; }
.pswp__button--arrow--next { right: 24px !important; left: auto !important; }
/* 기본 SVG 아이콘은 숨기고, 폰트어썸 화살표 문자로 직접 그린다
   (이 파일의 .pg_prev/.pg_next 페이지네이션 화살표와 같은 방식 — 이미 검증된 패턴) */
.pswp__button--arrow--prev .pswp__icn,
.pswp__button--arrow--next .pswp__icn {
    display: none;
}
.pswp__button--arrow--prev::before,
.pswp__button--arrow--next::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
    color: #fff;
}
.pswp__button--arrow--prev::before {
    content: '\f053'; /* fa-chevron-left */
}
.pswp__button--arrow--next::before {
    content: '\f054'; /* fa-chevron-right */
}

/* 이미지 카운터 (JS의 uiRegister에서 top-bar에 추가한 요소) —
   top-bar가 우하단으로 옮겨졌어도 이 요소 자체는 fixed로 좌상단에 고정.
   flex로 세로 중앙 정렬해서 숫자가 알약 틀 안에서 아래로 치우치지 않게 함 */
.pswp__counter {
    position: fixed;
    top: 24px;
    left: 24px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.4);
    padding: 0 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 0.3px;
}

/* 모바일 모달 */
@media (max-width: 768px) {
    .pswp__top-bar {
        bottom: 16px;
        right: 16px;
        gap: 8px;
    }
    .pswp__button--zoom {
        width: 38px !important;
        height: 38px !important;
    }
    .pswp__button--zoom::before {
        font-size: 17px;
    }
    .pswp__button--close,
    .pswp__button--close:hover,
    .pswp__button--close:active,
    .pswp__button--close:focus {
        height: 38px !important;
        padding: 0 16px !important;
    }
    .pswp__button--close::before {
        font-size: 12px;
    }
    .pswp__button--arrow--prev,
    .pswp__button--arrow--next {
        width: 40px !important;
        height: 40px !important;
    }
    .pswp__button--arrow--prev::before,
    .pswp__button--arrow--next::before {
        font-size: 15px;
    }
    .pswp__button--arrow--prev { left: 10px !important; }
    .pswp__button--arrow--next { right: 10px !important; }
    .pswp__counter {
        top: 14px;
        left: 14px;
        height: 26px;
        font-size: 11px;
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .pswp__top-bar {
        bottom: 12px;
        right: 12px;
    }
    .pswp__button--zoom {
        width: 34px !important;
        height: 34px !important;
    }
    .pswp__button--zoom::before {
        font-size: 15px;
    }
    .pswp__button--close,
    .pswp__button--close:hover,
    .pswp__button--close:active,
    .pswp__button--close:focus {
        height: 34px !important;
        padding: 0 14px !important;
    }
    .pswp__button--close::before {
        font-size: 11px;
    }
    .pswp__button--arrow--prev,
    .pswp__button--arrow--next {
        width: 34px !important;
        height: 34px !important;
    }
    .pswp__button--arrow--prev::before,
    .pswp__button--arrow--next::before {
        font-size: 13px;
    }
    .pswp__button--arrow--prev { left: 6px !important; }
    .pswp__button--arrow--next { right: 6px !important; }
}