/**
 * 特色图片轮播样式
 */

/* 轮播容器 */
.feature-image-slider-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 auto 2em;
    overflow: hidden;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    background-color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: grab;
}

.feature-image-slider-container:active {
    cursor: grabbing;
}

/* 作为特色图片的轮播适配样式 */
.feature-image-slider-container.wp-post-image {
    margin: 0;   /* 移除默认边距 */
    width: auto; /* 适应容器 */
    height: auto; /* 适应容器 */
    max-width: 100%; /* 确保不超出容器 */
    display: block; /* 与特色图片行为一致 */
}

/* 轮播轨道 */
.feature-image-slider-track {
    display: flex;
    transition: transform 0.3s ease-out;
    height: 100%;
    width: 100%;
}

/* 幻灯片 */
.feature-image-slide {
    flex: 0 0 auto;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 幻灯片图片 */
.feature-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 确保轮播内的图片比例与特色图片一致 */
.feature-image-slider-container.wp-post-image .feature-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 懒加载图片样式 */
.feature-image-slide img.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease;
    background-color: #f0f0f0;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23cccccc" d="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M5,5V19H19V5H5M17,17H7L12,9L17,17M8.5,7A1.5,1.5 0 0,0 7,8.5A1.5,1.5 0 0,0 8.5,10A1.5,1.5 0 0,0 10,8.5A1.5,1.5 0 0,0 8.5,7Z" /></svg>');
    background-position: center;
    background-repeat: no-repeat;
}

.feature-image-slide img.lazy-image[src] {
    opacity: 1;
    background-image: none;
}

/* 导航箭头 */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider-arrow:hover {
    background-color: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.slider-arrow:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

/* 导航点 */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.slider-dot.active {
    background-color: white;
    transform: scale(1.2);
}

.slider-dot:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.5);
}

/* 禁用箭头和导航点 */
.feature-image-slider-container .slider-arrow,
.feature-image-slider-container .slider-dots {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .slider-dot {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .feature-image-slider-container {
        height: 300px;
        border-radius: 6px;
    }
    
    .slider-arrow {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* 管理界面样式 */
.feature-image-slider-admin {
    margin-bottom: 1em;
}

.feature-image-slider-images {
    margin-bottom: 10px;
}

.feature-image-slider-admin .no-images {
    text-align: center;
    padding: 20px 0;
    color: #999;
    font-style: italic;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 3px;
}

.feature-image-slider-admin .image-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-image-slider-admin .image-item {
    position: relative;
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    cursor: move;
}

.feature-image-slider-admin .image-item img {
    display: block;
    width: 100%;
    height: auto;
}

.feature-image-slider-admin .remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 2;
}

.feature-image-slider-admin .remove-image:hover {
    opacity: 1;
}

.feature-image-slider-admin .move-image {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: move;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 2;
}

.feature-image-slider-admin .move-image:hover {
    opacity: 1;
}

.feature-image-slider-admin .add-images {
    display: block;
    width: 100%;
    margin: 10px 0;
}

.feature-image-slider-admin .slider-settings {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.feature-image-slider-admin .image-placeholder {
    border: 2px dashed #ddd;
    background-color: #f7f7f7;
    min-height: 80px;
    border-radius: 3px;
}