/* ===================================
   게시판 갤러리형 스타일 CSS
   style-board-gallery.css
   =================================== */

/* ===================================
   기본 갤러리형 게시판
   =================================== */
.board-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* 갤러리 이미지 영역 */
.gallery-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    overflow: hidden;
}

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

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

.gallery-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-size: 3rem;
}

/* 갤러리 배지 */
.gallery-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.gallery-badge.new {
    background: rgba(0, 102, 204, 0.9);
}

.gallery-badge.hot {
    background: rgba(231, 76, 60, 0.9);
}

/* 갤러리 콘텐츠 영역 */
.gallery-content {
    padding: 1.5rem;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-excerpt {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 갤러리 메타 정보 */
.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #6c757d;
}

.gallery-meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-meta-right {
    display: flex;
    gap: 1rem;
}

.gallery-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.gallery-meta-item i {
    font-size: 0.9rem;
}

/* ===================================
   마감니 갤러리형
   =================================== */
.board-gallery.masonry {
    display: block;
    column-count: 3;
    column-gap: 1.5rem;
}

.board-gallery.masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.board-gallery.masonry .gallery-image {
    height: auto;
}

.board-gallery.masonry .gallery-image img {
    height: auto;
}

/* ===================================
   카드 갤러리형
   =================================== */
.board-gallery.cards .gallery-item {
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.board-gallery.cards .gallery-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

.board-gallery.cards .gallery-content {
    padding: 1.25rem;
}

.board-gallery.cards .gallery-meta {
    background: #f8f9fa;
    margin: 0 -1.25rem -1.25rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
}

/* ===================================
   플립 갤러리형
   =================================== */
.board-gallery.flip .gallery-item {
    position: relative;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.board-gallery.flip .gallery-item:hover {
    transform: rotateY(180deg);
}

.board-gallery.flip .gallery-front,
.board-gallery.flip .gallery-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
}

.board-gallery.flip .gallery-back {
    transform: rotateY(180deg);
    background: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===================================
   갤러리형 반응형
   =================================== */
@media (max-width: 1200px) {
    .board-gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .board-gallery.masonry {
        column-count: 3;
    }
}

@media (max-width: 992px) {
    .board-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .board-gallery.masonry {
        column-count: 2;
        column-gap: 1rem;
    }
}

@media (max-width: 768px) {
    .board-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .gallery-item {
        border-radius: 8px;
    }
    
    .gallery-image {
        height: 150px;
    }
    
    .gallery-content {
        padding: 1rem;
    }
    
    .gallery-title {
        font-size: 1rem;
    }
    
    .gallery-excerpt {
        display: none;
    }
    
    .board-gallery.masonry {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .board-gallery {
        grid-template-columns: 1fr;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    .gallery-excerpt {
        display: block;
        -webkit-line-clamp: 2;
    }
    
    .board-gallery.masonry {
        column-count: 1;
    }
    
    .gallery-meta {
        font-size: 0.8rem;
    }
    
    .gallery-meta-right {
        gap: 0.5rem;
    }
}