/**
 * 갤러리 그리드 모듈 CSS
 * 전후사진, 자필후기 갤러리 표시
 * 소스: includes/modules/gallery_grid.php에서 분리
 */

/* 갤러리 그리드 모듈 */
.gallery-grid-module {
    width: 100%;
}

/* 카테고리 필터 */
.gallery-grid-module .category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.gallery-grid-module .category-filter a {
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 30px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}
.gallery-grid-module .category-filter a:hover {
    border-color: #333;
    color: #333;
}
.gallery-grid-module .category-filter a.active {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* 갤러리 그리드 - 2x2 레이아웃 (원본 momoprs.com과 동일) */
.gallery-grid-module .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 32px;
}
@media (max-width: 1024px) {
    .gallery-grid-module .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        row-gap: 32px;
    }
}
@media (max-width: 768px) {
    .gallery-grid-module .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
    }
}

/* 갤러리 아이템 */
.gallery-grid-module .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

/* 전후사진 비교 이미지 */
.gallery-grid-module .compare-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 비율 */
    overflow: hidden;
}
.gallery-grid-module .compare-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}
.gallery-grid-module .compare-container .before-img {
    z-index: 2;
}
.gallery-grid-module .compare-container .after-img {
    z-index: 1;
}
.gallery-grid-module .gallery-item:hover .compare-container .before-img {
    opacity: 0;
}
.gallery-grid-module .compare-labels {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    z-index: 3;
    pointer-events: none;
}
.gallery-grid-module .compare-labels span {
    padding: 4px 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
}

/* 단일 이미지 */
.gallery-grid-module .single-image {
    position: relative;
    width: 100%;
    padding-top: 130%; /* 세로로 긴 비율 */
    overflow: hidden;
}
.gallery-grid-module .single-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.gallery-grid-module .gallery-item:hover .single-image img {
    transform: scale(1.05);
}

/* 아이템 정보 */
.gallery-grid-module .item-info {
    padding: 12px;
}
.gallery-grid-module .item-info .title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gallery-grid-module .item-info .category {
    font-size: 12px;
    color: #888;
}

/* 페이지네이션 */
.gallery-grid-module .pagination-box {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 5px;
}
.gallery-grid-module .pagination-box a,
.gallery-grid-module .pagination-box span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}
.gallery-grid-module .pagination-box a:hover {
    background: #f8f9fa;
    border-color: #333;
}
.gallery-grid-module .pagination-box .current {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* 빈 상태 */
.gallery-grid-module .empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #888;
    grid-column: 1 / -1;
}
.gallery-grid-module .empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* 라이트박스 모달 */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.gallery-lightbox.show {
    display: flex;
}
.gallery-lightbox .lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}
.gallery-lightbox .lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
}
.gallery-lightbox .lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}
.gallery-lightbox .lightbox-compare {
    position: relative;
    display: flex;
    gap: 20px;
}
.gallery-lightbox .lightbox-compare img {
    max-width: 45vw;
    max-height: 70vh;
    object-fit: contain;
}
.gallery-lightbox .lightbox-label {
    position: absolute;
    bottom: 10px;
    padding: 5px 15px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
}
.gallery-lightbox .lightbox-label.before {
    left: 10px;
}
.gallery-lightbox .lightbox-label.after {
    right: 10px;
}
.gallery-lightbox .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    border: none;
    padding: 20px 15px;
    border-radius: 4px;
}
.gallery-lightbox .lightbox-prev {
    left: 20px;
}
.gallery-lightbox .lightbox-next {
    right: 20px;
}
