/*
 * jj_project_lat / style.css
 * 경로: theme/jjtheme/skin/latest/jj_project_lat/style.css
 */

/* ── 카드 button 리셋 ── */
button.fv-proj-card {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    font: inherit;
    color: inherit;
}

/* ── 카드 이미지 래퍼 ── */
.fv-proj-card-img {
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
}
.fv-proj-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
    display: block;
}
.fv-proj-card:hover .fv-proj-card-img img,
.fv-proj-card:focus-visible .fv-proj-card-img img {
    transform: scale(1.06);
}

/* ── 줌 아이콘 오버레이 ── */
.jj-pj-zoom-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    opacity: 0;
    transition: opacity .25s;
    text-shadow: 0 2px 10px rgba(0,0,0,.5);
    pointer-events: none;
    background: rgba(0,0,0,.08);
}
.jj-pj-card:hover .jj-pj-zoom-icon,
.jj-pj-card:focus-visible .jj-pj-zoom-icon {
    opacity: 1;
}

/* ── 플레이스홀더 ── */
.fv-proj-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-sub);
    font-size: 32px;
    background: var(--brand-light);
}

/* ── 이미지 개수 배지 (우측 하단) ── */
.jj-pj-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
}
.jj-pj-badge i {
    font-size: 11px;
}

/* ── ✅ 분류 배지 (썸네일 왼쪽 상단) ── */
.jj-pj-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--brand, #2c5f8a);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 5;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
}

/* ── 카드 정보 영역 ── */
.fv-proj-card-info {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
    background: #fff;
}

.fv-proj-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--txt);
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ══════════════════════════════════════
   PhotoSwipe v5 모달 커스텀 스타일 (이미지 모달 전용)
   ※ jj_gallery_modal/gallery.css와 동일한 방식 — 사이트 전체에서
     이미지 모달 UI가 일관되게 보이도록 통일했습니다.
══════════════════════════════════════ */

/* 테마 헤더/사이드바(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를 더 높게 잡고 있어서 일부만 저희 스타일이 이기고 일부는
   라이브러리 기본값이 이기며 호버 시 미세하게 떨리는 현상이 있었다.
   !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 아이콘은 숨기고, 폰트어썸 화살표 문자로 직접 그린다 */
.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;
    }

    /* ✅ 모바일에서 분류 배지 크기 조정 */
    .jj-pj-cat-badge {
        top: 8px;
        left: 8px;
        font-size: 10px;
        padding: 3px 10px;
    }
}

@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; }
}