/* 照片墙插件前端样式 */
.photo-gallery {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

/* 列数布局 */
.gallery-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.gallery-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* 图片项样式 */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #fff;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* 图片标题样式 */
.gallery-caption {
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .gallery-columns-6 {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gallery-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-columns-3,
    .gallery-columns-4,
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: repeat(1, 1fr);
        gap: 10px;
    }
    
    .gallery-image {
        height: 200px;
    }
}

/* 加载状态 */
.photo-gallery.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 空状态提示 */
.photo-gallery:empty::before {
    content: "暂无图片可显示";
    display: block;
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* 轻量级灯箱效果 */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.gallery-lightbox.active {
    display: flex;
}

.gallery-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.gallery-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-close:hover {
    color: #ff6b6b;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeIn 0.5s ease forwards;
}

/* 为不同列数设置不同的动画延迟 */
.gallery-columns-2 .gallery-item:nth-child(2n) { animation-delay: 0.1s; }
.gallery-columns-3 .gallery-item:nth-child(3n) { animation-delay: 0.1s; }
.gallery-columns-3 .gallery-item:nth-child(3n+1) { animation-delay: 0.2s; }
.gallery-columns-4 .gallery-item:nth-child(4n) { animation-delay: 0.1s; }
.gallery-columns-4 .gallery-item:nth-child(4n+1) { animation-delay: 0.2s; }
.gallery-columns-4 .gallery-item:nth-child(4n+2) { animation-delay: 0.3s; }
