/* gallery.style.css - 갤러리 스타일 (1라인 4개) */

/* 갤러리 컨테이너 */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4개의 고정 컬럼 */
    gap: 20px;
    padding: 0;
    margin: 20px 0;
    list-style: none;
}

/* 갤러리 아이템 */
.gallery-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #d9534f;
}

.gallery-item.bo-notice {
    border-left: 4px solid #d9534f;
}

/* 행의 첫 번째와 마지막 아이템 */
.gallery-row-first {
    clear: both;
}

.gallery-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 체크박스 */
.gallery-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 썸네일 영역 */
.gallery-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 비율 */
    overflow: hidden;
    background: #f5f5f5;
}

.gallery-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.08);
}

/* 오버레이 효과 */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(217, 83, 79, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-view-icon {
    color: #fff;
    font-size: 28px;
    transform: scale(0);
    transition: transform 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    background: rgba(217, 83, 79, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .gallery-view-icon {
    transform: scale(1);
}

/* 번호 표시 */
.gallery-num {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* 공지사항 배지 */
.gallery-notice-badge {
    position: absolute;
    top: 10px;
    left: 40px;
    background: #d9534f;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(217, 83, 79, 0.3);
}

/* 아이콘 팩 */
.gallery-icons {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
}

.gallery-icons .icon-pack-wrap {
    display: flex;
    gap: 3px;
    background: rgba(255, 255, 255, 0.9);
    padding: 3px 6px;
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 댓글 카운트 */
.gallery-comment-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* 정보 영역 */
.gallery-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* 제목 */
.gallery-subject {
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 40px;
}

.gallery-subject-link {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.gallery-subject-link:hover {
    color: #d9534f;
}

/* 메타 정보 */
.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.gallery-writer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-writer i {
    color: #999;
    font-size: 11px;
}

.gallery-date {
    color: #999;
    font-size: 11px;
}

/* 통계 */
.gallery-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #888;
}

.gallery-hit,
.gallery-good,
.gallery-comments {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-hit i,
.gallery-good i,
.gallery-comments i {
    font-size: 11px;
    color: #bbb;
}

/* 좋아요 색상 */
.gallery-good i {
    color: #d9534f;
}

/* 빈 갤러리 */
.gallery-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #fafafa;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
}

/* 리스트 아이콘 (원본 스타일 유지) */
.list-icon {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.icon-pack-wrap {
    display: flex;
    gap: 3px;
}

/* 반응형 - 태블릿 */
@media screen and (max-width: 1024px) {
    .gallery-container {
        grid-template-columns: repeat(3, 1fr); /* 3개로 변경 */
        gap: 15px;
    }
    
    .gallery-info {
        padding: 12px;
    }
    
    .gallery-subject-link {
        font-size: 13px;
    }
}

/* 반응형 - 모바일 */
@media screen and (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr); /* 2개로 변경 */
        gap: 12px;
        margin: 10px 0;
    }
    
    .gallery-thumbnail {
        padding-bottom: 75%;
    }
    
    .gallery-info {
        padding: 10px;
    }
    
    .gallery-subject {
        min-height: 36px;
    }
    
    .gallery-subject-link {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .gallery-meta {
        font-size: 11px;
    }
    
    .gallery-stats {
        font-size: 11px;
        padding-top: 8px;
    }
    
    .gallery-view-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}

/* 반응형 - 작은 모바일 */
@media screen and (max-width: 480px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr); /* 2개 유지 */
        gap: 8px;
    }
    
    .gallery-thumbnail {
        padding-bottom: 80%;
    }
    
    .gallery-info {
        padding: 8px;
    }
    
    .gallery-subject-link {
        font-size: 12px;
    }
    
    .gallery-meta {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .gallery-stats {
        font-size: 10px;
        padding-top: 6px;
    }
    
    .gallery-num,
    .gallery-comment-count,
    .gallery-notice-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}