/* ==============================================
   全局基础样式
   ============================================== */
.clpd-posts-grid,
.clpd-posts-list,
.clpd-post-item,
.clpd-post-content,
.clpd-post-inner {
    box-sizing: border-box;
}

/* 无文章提示 */
.clpd-no-posts {
    text-align: center;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

/* 文章项通用样式 */
.clpd-post-item {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 文章项悬停效果 */
.clpd-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* 文章链接（覆盖整个卡片） */
.clpd-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* 特色图片通用样式 */
.clpd-post-thumbnail {
    overflow: hidden;
}

.clpd-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* 图片悬停缩放 */
.clpd-post-item:hover .clpd-post-image {
    transform: scale(1.05);
}

/* 文章内容通用样式 */
.clpd-post-content {
    display: flex;
    flex-direction: column;
}

/* 文章标题 */
.clpd-post-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 12px;
    color: #2d3748;
    transition: color 0.3s ease;
}

/* 标题悬停颜色 */
.clpd-post-item:hover .clpd-post-title {
    color: #2563eb;
}

/* 文章摘要 */
.clpd-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #718096;
    margin: 0 0 16px;
    flex: 1;
}

/* 元信息容器 */
.clpd-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #a0aec0;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
}

/* 分类链接样式 */
.clpd-post-categories a {
    color: #4a5568;
    text-decoration: none;
    transition: color 0.3s ease;
}

.clpd-post-categories a:hover {
    color: #2563eb;
}

/* ==============================================
   网格布局样式
   ============================================== */

/* 网格容器 */
.clpd-posts-grid {
    display: grid;
    grid-template-columns: repeat(var(--clpd-columns, 3), 1fr);
    gap: 24px;
    margin: 20px 0;
    width: 100%;
}

/* 网格布局：文章项（纵向排列） */
.clpd-posts-grid .clpd-post-item {
    display: flex;
    flex-direction: column;
}

/* 网格布局：图片容器 */
.clpd-posts-grid .clpd-post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9; /* 固定图片比例 */
}

/* 网格布局：内容容器 */
.clpd-posts-grid .clpd-post-content {
    padding: 20px;
    flex: 1;
}

/* ==============================================
   列表布局样式
   ============================================== */

/* 列表容器 */
.clpd-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
    width: 100%;
}

/* 列表布局：内部 flex 容器（图片+内容横向排列） */
.clpd-post-inner {
    display: flex;
    flex-direction: row;
    height: 100%;
}

/* 列表布局：特色图片容器 */
.clpd-post-thumbnail--list {
    flex-shrink: 0;
    width: 180px; /* 固定图片宽度 */
}

/* 列表布局：内容容器（占据剩余空间） */
.clpd-post-content--list {
    padding: 20px;
    flex: 1;
    justify-content: center; /* 垂直居中对齐 */
}

/* 列表布局：标题（略小，适应横向布局） */
.clpd-post-content--list .clpd-post-title {
    font-size: 17px;
    margin-bottom: 8px;
}

/* 列表布局：摘要（更紧凑） */
.clpd-post-content--list .clpd-post-excerpt {
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* 列表布局：元信息（紧凑排列） */
.clpd-post-content--list .clpd-post-meta {
    padding-top: 8px;
    font-size: 11px;
}

/* ==============================================
   响应式设计
   ============================================== */

/* 平板端（1024px 以下） */
@media (max-width: 1024px) {
    /* 网格布局：减少列数 */
    .clpd-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    /* 列表布局：缩小图片宽度 */
    .clpd-post-thumbnail--list {
        width: 150px;
    }

    /* 列表布局：减少内容内边距 */
    .clpd-post-content--list {
        padding: 16px;
    }
}

/* 移动端（768px 以下） */
@media (max-width: 768px) {
    /* 网格布局：单列显示 */
    .clpd-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 列表布局：改为纵向排列（图片在上，内容在下） */
    .clpd-post-inner {
        flex-direction: column;
    }

    /* 列表布局：恢复图片比例 */
    .clpd-post-thumbnail--list {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    /* 通用：减少内容内边距 */
    .clpd-post-content {
        padding: 16px;
    }

    /* 通用：缩小标题字体 */
    .clpd-post-title {
        font-size: 16px;
    }
}
