@charset "UTF-8";

/* Gallery Page */
.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header h1 {
    font-size: 36px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.gallery-subtitle {
    font-size: 18px;
    color: #c9979b;
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 100px 20px;
    color: #999;
}

.gallery-empty i {
    font-size: 80px;
    color: #e8b4b8;
    margin-bottom: 20px;
}

.gallery-empty p {
    font-size: 18px;
}

/* Gallery Grid - Flexbox 가로 배치 */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.gallery-item {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    flex: 0 0 calc(33.333% - 17px);
    max-width: calc(33.333% - 17px);
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(201, 151, 155, 0.2);
}

.gallery-thumb {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f9f7f7;
}

.gallery-item:hover .gallery-thumb img {
    transform: scale(1.05);
}

.gallery-info {
    padding: 15px 20px;
    border-top: 1px solid #f5f5f5;
    height: 100px;
    overflow-y: auto;
    flex-shrink: 0;
}

.gallery-info h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
    word-break: keep-all;
    line-height: 1.4;
}

.gallery-info p {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
    word-break: keep-all;
    white-space: pre-wrap;
}

/* 이미지 카운트 뱃지 */
.gallery-thumb .image-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 5;
}

.gallery-thumb .image-count i {
    margin-right: 4px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 36px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
}

.lightbox-caption {
    color: #fff;
    margin-top: 20px;
    font-size: 16px;
    opacity: 0.95;
    max-width: 1200px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    max-height: 180px;
    overflow-y: auto;
    line-height: 1.7;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    white-space: pre-wrap;
    text-align: left;
}

.lightbox-counter {
    color: #fff;
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.7;
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-section {
        padding: 40px 15px;
    }

    .gallery-header h1 {
        font-size: 28px;
    }

    .gallery-grid {
        gap: 15px;
    }

    .gallery-item {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
        border-radius: 10px;
    }

    .gallery-info {
        padding: 12px 15px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background: #f5f5f5;
    border-color: #c9979b;
    color: #c9979b;
}

.pagination span.current {
    background: #c9979b;
    color: #fff;
    border: 1px solid #c9979b;
}

.pagination span.dots {
    background: none;
    border: none;
    color: #999;
}

.pagination .prev,
.pagination .next {
    font-weight: 500;
}

@media (max-width: 480px) {
    .pagination {
        gap: 5px;
    }

    .pagination a,
    .pagination span {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
    }
}
