#bo_gall {
    padding: 40px 0;
}

/* 0. 프리미엄 인트로 헤더 */
.pf-intro-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 0 20px;
}

.pf-intro-title {
    font-size: clamp(2.5rem, 5vw, 65px);
    font-weight: 850;
    color: #0D0E10;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    line-height: 1.1;
    transition: color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pf-intro-desc {
    font-size: 16px;
    color: #555555;
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 500;
    word-break: keep-all;
    transition: color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-theme="dark"] .pf-intro-title {
    color: #ffffff;
}

body[data-theme="dark"] .pf-intro-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* 1. 카테고리 필터 영역 (Pill-shaped Flexible Filter Grid) */
.pf-filter-wrap {
    width: 100%;
    margin-bottom: 50px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* 1차 탭 (작업 타입: 로고/랜딩) */
.pf-type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.pf-type-btn {
    padding: 12px 30px !important;
    border-radius: 50px !important;
    /* 완전 둥근 Pill */
    background-color: #ffffff !important;
    color: #1A1A1A !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    border: 1px solid #e1dfda !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.pf-type-btn.active,
.pf-type-btn:hover {
    background-color: #0D0E10 !important;
    /* 다크 차콜 */
    color: #ffffff !important;
    border-color: #0D0E10 !important;
    box-shadow: 0 6px 20px rgba(13, 14, 16, 0.15) !important;
    /* 버튼 그림자 */
    transform: translateY(-2px);
}

/* 2차 필터 (업종) */
.pf-category-filters {
    display: flex;
    flex-wrap: wrap;
    /* 여러 줄로 이쁘게 줄바꿈 */
    gap: 10px;
    justify-content: center;
    max-width: 1100px;
    /* 전체 너비 제한 */
    margin: 0 auto;
    padding: 0 20px;
}

.pf-cat-btn {
    padding: 8px 20px !important;
    border-radius: 50px !important;
    background-color: #ffffff !important;
    color: #666666 !important;
    border: 1px solid #e9e7e2 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.pf-cat-btn.active,
.pf-cat-btn:hover {
    background-color: #4ADE80 !important;
    /* 브랜드 네온 그린 포인트 */
    color: #111111 !important;
    /* 오버 시 텍스트 블랙으로 변경 */
    font-weight: 900 !important;
    /* 가독성을 위해 아주 굵은 폰트(Black) 적용 */
    -webkit-text-stroke: 0.5px #111111;
    /* 볼드를 더 강하게 보이게 하기 위함 */
    border-color: #4ADE80 !important;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2) !important;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .pf-intro-header {
        margin-bottom: 30px;
    }

    .pf-intro-title {
        font-size: 32px;
    }

    .pf-intro-desc {
        font-size: 14px;
    }

    .pf-type-filters,
    .pf-category-filters {
        justify-content: center;
        /* 모바일에서도 보기 좋게 중앙 정렬 */
        padding: 0 10px;
        flex-wrap: wrap;
        /* 줄바꿈 허용하여 가로 잘림 해결 */
        gap: 8px;
    }

    .pf-cat-btn {
        padding: 6px 14px !important;
        font-size: 12px !important;
    }
}

/* 2. 포트폴리오 리스트 영역 (Masonry Grid) */
.pf-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    position: relative;
}

/* 기본 카드 속성 (화이트 배경, 둥근 모서리, 소프트 그림자) */
.pf-item {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 24px;
    /* Linktree 스타일처럼 크게 둥글게 */
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-color: #ffffff;
    /* 순백색 캔버스 */
    border: 1px solid rgba(0, 0, 0, 0.02);
    /* 은은한 테두리 */
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.03);
    /* 베이지에 어울리는 소프트 섀도우 */
    transition: box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.pf-item:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08);
    /* 호버 시 그림자 깊어짐 */
    transform: translateY(-8px);
    /* 살짝 떠오르는 느낌 */
}

/* PC / 태블릿 사이즈 조정 */
@media (min-width: 768px) {
    .pf-item {
        width: calc(50% - 6.5px);
    }
}

@media (min-width: 1024px) {
    .pf-item {
        width: calc(33.3333% - 10px);
    }

    /* 3열 */
}

@media (min-width: 1400px) {
    .pf-item {
        width: calc(25% - 11.25px);
    }

    /* 4열 와이드 */
}

/* 썸네일 공통 래퍼 (Full Bleed) */
.pf-thumb-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.pf-thumb-wrap img {
    width: 100%;
    display: block;
}

/* 정보 영역 (Hover 시 슬라이드 업) */
.pf-info-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 80px 24px 24px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    text-align: left;
    pointer-events: none;
    z-index: 20;
    /* Hover Animation */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pf-item:hover .pf-info-wrap {
    opacity: 1;
    transform: translateY(0);
}

.pf-item-cat {
    display: inline-block;
    font-size: 13px;
    color: #111111;
    background-color: #4ADE80; /* 메인 페이지 스타일 네온그린 뱃지 */
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 6px 14px;
    border-radius: 30px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.pf-item-title {
    font-size: 22px;
    font-weight: 850;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* 관리자 수정 버튼 */
.pf-admin-edit-btn {
    pointer-events: auto;
    /* 버튼은 클릭 가능 */
    margin-top: 10px;
    padding: 6px 14px;
    background-color: #4ADE80;
    /* 브랜드 포인트 네온그린 */
    color: #000;
    font-size: 11px;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 30;
}

.pf-admin-edit-btn:hover {
    background-color: #ffffff;
    color: #000;
}

/* 카드 상단 작고 세련된 뱃지 (옵션) */
.pf-item::after {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    z-index: 10;
}

.pf-item.type-logo::after {
    content: "LOGO";
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.pf-item.type-landing::after {
    content: "LANDING";
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

/* -------------------------------------
   Type A: 랜딩페이지 (Hover Scroll)
-------------------------------------- */
.pf-item.type-landing .pf-thumb-wrap {
    aspect-ratio: 3 / 4;
}

.pf-item.type-landing .pf-thumb-wrap img {
    width: 100%;
    height: 100%;
    /* 부모 높이 꽉 채움 */
    object-fit: cover;
    /* 비율 유지하며 여백 없이 채움 */
    object-position: top;
    /* 시작은 최상단 */
    transition: object-position 3s cubic-bezier(0.25, 1, 0.5, 1);
}

.pf-item.type-landing:hover .pf-thumb-wrap img {
    /* 호버 시 최하단으로 부드럽게 스크롤 (위로 올라감) */
    object-position: bottom;
}

/* -------------------------------------
   Type B: 로고 (Hover Scale)
-------------------------------------- */
.pf-item.type-logo .pf-thumb-wrap {
    aspect-ratio: 4 / 3;
    display: block;
    padding: 0;
}

.pf-item.type-logo .pf-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.pf-item.type-logo:hover .pf-thumb-wrap img {
    transform: scale(1.05);
    /* 부드러운 줌인 */
}

/* 3. 모달 레이어 (Popup Modal - Beige/White Mode) */
.pf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    /* 다크 대신 화이트 반투명(모던) */
    backdrop-filter: blur(8px);
    /* 뒤쪽 배경 블러처리 */
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pf-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.pf-modal-content {
    background: #ffffff;
    width: 95%;
    max-width: 1300px;
    height: 85vh; /* 고정 높이 */
    border-radius: 20px;
    overflow-y: auto; /* 전체 모달창 스크롤 허용 (스크롤바를 맨 우측으로 이동) */
    overflow-x: hidden;
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* 자식 요소 높이 각자 유지 (Sticky 필수 조건) */
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.pf-modal-overlay.active .pf-modal-content {
    transform: translateY(0);
}

.pf-modal-left {
    flex: 8; /* 80% */
    background: #f8f8f8;
    /* overflow-y 제거: 내용물(이미지) 높이만큼 길어짐 */
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.pf-modal-left img {
    width: 100%;
    height: auto;
    display: block;
}

.pf-modal-right {
    flex: 2; /* 20% */
    background: #ffffff;
    padding: 35px 25px;
    border-left: 1px solid #eeeeee;
    
    /* Sticky 매직: 우측 텍스트 내용 고정 */
    position: sticky;
    top: 0;
    height: 85vh; /* 뷰포트 높이에 맞춤 */
    overflow-y: auto; /* 내용이 매우 길 경우에만 내부 스크롤 허용 */
    box-sizing: border-box;
}

.modal-cat {
    display: inline-block;
    align-self: flex-start;
    padding: 6px 14px;
    background-color: #4ADE80;
    color: #111111;
    font-size: 12px;
    font-weight: 800;
    border-radius: 30px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.modal-title {
    font-size: 28px;
    font-weight: 850;
    color: #111;
    margin: 0 0 20px 0;
    line-height: 1.3;
    letter-spacing: -0.03em;
    word-break: keep-all;
}
.modal-divider {
    width: 30px;
    height: 3px;
    background: #4ADE80; /* 브랜드 컬러 */
    margin-bottom: 20px;
}
.modal-text {
    font-size: 15px;
    color: #444;
    line-height: 1.6;
    font-weight: 500;
    word-break: break-word;
}
.modal-text p {
    margin: 0 0 10px 0;
}
.modal-text img {
    max-width: 100%;
    height: auto;
}

/* 모달 닫기 버튼 */
.pf-modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    background: #ffffff;
    color: #333;
    border: 1px solid #eee;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.pf-modal-close:hover {
    background: #f1f1f1;
    transform: scale(1.05);
}

/* 모달 모바일 반응형 */
@media (max-width: 992px) {
    .pf-modal-content {
        flex-direction: column;
        height: 90vh;
    }
    .pf-modal-left {
        flex: 1;
        max-height: 50vh;
    }
    .pf-modal-right {
        flex: none;
        padding: 40px 30px;
    }
    .modal-title {
        font-size: 24px;
    }
}

/* 4. 그누보드 기본 버튼 클래스 리셋 (글쓰기, 관리자 버튼 등 겹침 방지) */
#bo_gall .btn_b02,
#bo_gall .btn_b01,
#bo_gall .btn_admin {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #111 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 0 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    height: 45px !important;
    line-height: 45px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    vertical-align: middle !important;
}

#bo_gall .btn_b02:hover,
#bo_gall .btn_b01:hover,
#bo_gall .btn_admin:hover {
    background: #333 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 5. 게시물이 없을 때 (empty_list) 버튼과 겹침 방지 */
#bo_gall .empty_list {
    clear: both !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 80px 0 !important;
    font-size: 16px !important;
    color: #888 !important;
    line-height: 1.5 !important;
    background: transparent !important;
}

/* 하단 버튼 영역 강제 노출 및 겹침 방지 */
#bo_gall .bo_fx {
    position: relative;
    z-index: 100;
    clear: both;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 30px;
    padding-bottom: 20px;
}

#bo_gall .btn_bo_user {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 10px;
}

/* 6. 서브페이지 레이아웃 글로벌 중앙 정렬 및 여백 보정 */
body.sub-page #wrapper {
    width: 100% !important;
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    box-sizing: border-box !important;
    /* CRITICAL FIX: Prevent width 100% + padding overflow */
    overflow-x: hidden;
}

body.sub-page #container_wr,
body.sub-page #container {
    width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.pf-cat-btn,
.pf-type-btn {
    white-space: nowrap !important;
}