/* 갤러리 스킨 전용 CSS */

.view-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 1rem;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-btn:hover,
.view-btn.active {
    background: #2c5aa0;
    color: white;
    border-color: #2c5aa0;
}

/* 갤러리 그리드 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 0 1rem;
}

.gallery-grid.list-view {
    grid-template-columns: 1fr;
}

.gallery-grid.list-view .gallery-item {
    max-width: none;
}

.gallery-grid.list-view .gallery-card {
    display: flex;
    align-items: center;
    text-align: left;
}

.gallery-grid.list-view .gallery-image {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
    margin-right: 20px;
}

/* 갤러리 아이템 */
.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

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

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

.gallery-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

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

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.no-image-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.no-image-placeholder span {
    font-size: 14px;
    opacity: 0.9;
}

/* 유튜브 오버레이 */
.youtube-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.youtube-overlay i {
    color: #ff0000;
    font-size: 36px !important;
    margin-left: 2px; /* 아이콘 중앙 정렬을 위한 미세 조정 */
}

.gallery-item:hover .youtube-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

/* 갤러리 정보 */
.gallery-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-category {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    align-self: flex-start;
}

.gallery-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.5;
    letter-spacing: -1px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-title a {
    color: #333;
    text-decoration: none !important;
    transition: color 0.3s;
}

.gallery-title a:hover {
    color: #667eea;
    text-decoration: none !important;
}

.gallery-link {
    text-decoration: none !important;
}

.gallery-excerpt {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: left; /* 전역 p 균등정렬 무효화 */
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #ecf0f1;
    font-size: 13px;
    color: #95a5a6;
}

.meta-left,
.meta-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item i {
    font-size: 12px;
    opacity: 0.8;
}

/* 갤러리 로딩 애니메이션 */
.gallery-item {
    opacity: 0;
    animation: fadeInScale 0.5s ease forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 반응형: 태블릿 */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 12px;
    }
}

/* 반응형: 모바일 */
@media (max-width: 768px) {
    /* 모바일에서 좌우 여백 최소화 */
    .board-container,
    .view-switcher,
    .gallery-grid {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 8px;
    }
    
    .gallery-grid.list-view {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid.list-view .gallery-image {
        width: 120px;
        height: 140px;
        margin-right: 0px;
    }
    
    .gallery-image {
        height: 160px;
    }
    
    .gallery-info {
        padding: 12px;
    }
    
    .gallery-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .gallery-excerpt {
        font-size: 13px;
    }
    
    .gallery-meta {
        font-size: 12px;
        display: flex;
        align-items: flex-start;
        gap: 6px;
    }
    
    .meta-left,
    .meta-right {
        gap: 4px;
    }
}

/* 반응형: 작은 모바일 */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .gallery-image {
        height: 160px;
    }
    
    .gallery-title {
        font-size: 15px;
    }
    
    .gallery-excerpt {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .view-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* 빈 갤러리 */
.no-posts {
    grid-column: 1 / -1;
}

