/* 갤러리 페이지 전용 스타일 */

/* 카테고리 셀렉트박스 스타일 - input 필드와 동일하게 */
#category-select {
    min-height: 50px;
    padding: 5.5px 15px;
    border: 1px solid #d7d7d7;
    vertical-align: top;
    box-sizing: border-box;
    font-size: 18px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    min-width: 100px;
}

#category-select:focus {
    border: 1px solid #475781;
    outline: none;
}

#category-select:hover {
    border-color: #475781;
}

.gallery-card {
    cursor: pointer;
}

.gallery-card .top {
    position: relative !important;
    overflow: hidden;
}

/* 카테고리 배지 - 이미지 우측 상단 */
.gallery-card .category-badge {
    position: absolute !important;
    right: 10px !important;
    top: 10px !important;
    padding: 6px 12px;
    background: rgba(71, 87, 129, 0.9);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    z-index: 10;
}

.gallery-card .p-num {
    position: absolute !important;
    right: 10px !important;
    bottom: 10px !important;
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gallery-card .p-num p {
    color: #fff !important;
    font-size: 24px !important;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

/* 갤러리 컨테이너 및 컬럼 레이아웃 수정 */
#gallery-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 30px; /* 컬럼 사이 30px 간격 */
    max-width: 1260px; /* 3 x 400px + 2 x 30px = 1260px */
    margin: 0 auto;
}

#gallery-container > div {
    flex: 0 0 400px; /* 각 컬럼을 정확히 400px로 고정 */
    width: 400px;
    min-height: 1px; /* flexbox 버그 방지 */
}

/* pnoti-wrap 크기 강제 적용 */
.gallery-card.pnoti-wrap {
    width: 400px !important;
    max-width: 400px;
    min-width: 400px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid #d9d9d9;
}

.gallery-card.pnoti-wrap .top {
    width: 400px !important;
}

.gallery-card.pnoti-wrap .bot {
    width: 400px !important;
}

/* 갤러리 이미지 크기 제한 */
.gallery-card.pnoti-wrap .top img {
    width: 400px !important;
    max-width: 400px;
    height: auto;
    object-fit: cover;
    display: block;
}

.no-results {
    text-align: center;
    padding: 60px 0;
    color: #666;
    width: 400px;
}

/* 갤러리 카드 제목 길이 제한 */
/* 카테고리 태그 — 카드 텍스트 영역 */
.gallery-card .gallery-cat-tag {
    display: inline-block;
    background: #eef0f7;
    color: #475781;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}

.gallery-card .bot-top h5 {
    max-width: 250px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 갤러리 모달 중앙 정렬 */
#gallery-modal.popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 50 !important;
    width: 800px;
    max-width: 92vw;
    max-height: 92vh;
    overflow-y: auto;
}

/* 갤러리 모달 내 Swiper 명시적 크기 */
#gallery-modal .mySwiper2 {
    width: 100%;
    height: 420px;
}

#gallery-modal .mySwiper2 .swiper-slide img {
    width: 100%;
    height: 420px;
    object-fit: contain;
    background: #000;
}

#gallery-modal .mySwiper {
    width: 100%;
    height: 90px;
    padding: 8px 0;
    box-sizing: border-box;
    margin-top: 10px;
}

#gallery-modal .mySwiper .swiper-slide {
    width: 120px !important;
    height: 74px;
    opacity: 0.5;
    cursor: pointer;
    overflow: hidden;
}

#gallery-modal .mySwiper .swiper-slide img {
    width: 100%;
    height: 74px;
    object-fit: cover;
}

#gallery-modal .mySwiper .swiper-slide-thumb-active {
    opacity: 1;
    outline: 2px solid #475781;
}

/* 메인 슬라이드 이미지 — 클릭 가능 커서 */
#gallery-modal .mySwiper2 .swiper-slide img {
    cursor: zoom-in;
    transition: none;
}

/* 이미지 줌 오버레이 */
#img-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
#img-zoom-overlay.active {
    display: flex;
}
#img-zoom-overlay img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    cursor: zoom-out;
    user-select: none;
}