/**
 * 新闻页面优化 - Banner遮罩 + 排版优化
 * 
 * @package Corporate_Theme
 * @since 1.0.0
 */

/* ==========================================================================
   1. Banner 遮罩层修复 - HTML元素版本（更简单直接）
   ========================================================================== */

/* 确保 page-header 有正确的定位上下文 */
body.category .page-header,
body.category-news .page-header,
.archive-news .page-header {
    position: relative !important;
}

/* 确保有内联背景图片时能正确显示 */
.archive-news .page-header[style*="background-image"],
body.page-template-template-blog .page-header[style*="background-image"] {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* 遮罩层 - 使用真实的 HTML 元素 */
.page-header-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.3) 0%, rgba(25, 118, 210, 0.2) 100%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* 确保标题在遮罩层之上 */
body.category .page-header .container,
body.category-news .page-header .container,
.archive-news .page-header .container {
    position: relative !important;
    z-index: 10 !important;
}

body.category .page-header .page-title,
body.category-news .page-header .page-title,
.archive-news .page-header .page-title,
body.category .page-header h1,
body.category-news .page-header h1,
.archive-news .page-header h1 {
    position: relative !important;
    z-index: 10 !important;
    color: #ffffff !important;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* 分类描述也要在遮罩层之上 */
body.category .page-header .archive-description,
body.category-news .page-header .archive-description,
.archive-news .page-header .archive-description {
    position: relative !important;
    z-index: 10 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

/* Banner 副标题 */
.page-header .page-subtitle {
    position: relative !important;
    z-index: 10 !important;
    margin: 12px 0 0 0 !important;
    font-size: 1.0625rem !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    letter-spacing: 0.3px !important;
}

/* ==========================================================================
   1.5. 分类筛选栏
   ========================================================================== */

.news-filter-bar {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-filter-bar .filter-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.news-filter-bar .filter-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.news-filter-bar .filter-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.news-filter-bar .filter-btn {
    padding: 8px 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.news-filter-bar .filter-btn:hover {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #1976d2;
}

.news-filter-bar .filter-btn.active {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: #ffffff;
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

/* ==========================================================================
   2. 新闻列表排版优化
   ========================================================================== */

/* 新闻列表容器 */
.archive-news .archive-content {
    background: #fafbfc;
    padding: 60px 0;
}

.archive-news .content-area {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* 全宽内容区域 */
.archive-news .content-area-full-width {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 20px;
}

/* 新闻列表 - 网格布局（增加间距） */
.archive-news .news-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 50px;
}

/* 新闻网格 - 卡片式布局（与解决方案页一致） */
.archive-news .news-grid-archive {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 50px;
}

/* 新闻卡片 - 新样式（与解决方案卡片一致） */
.archive-news .news-card-archive {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(25, 118, 210, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.archive-news .news-card-archive:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(25, 118, 210, 0.18);
    border-color: rgba(25, 118, 210, 0.25);
}

/* 新闻图片包装器 */
.archive-news .news-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.archive-news .news-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.archive-news .news-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.archive-news .news-card-archive:hover .news-image-wrapper img {
    transform: scale(1.1);
}

/* 图片占位符 */
.archive-news .news-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    text-decoration: none;
}

.archive-news .news-image-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.archive-news .news-image-placeholder p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* 分类标签（覆盖在图片上） */
.archive-news .news-category-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: rgba(25, 118, 210, 0.95);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.archive-news .news-category-tag .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

/* 新闻卡片内容 */
.archive-news .news-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 新闻元信息 - 卡片版本 */
.archive-news .news-card-content .news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 0.8125rem;
    color: #666;
}

.archive-news .news-card-content .news-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.archive-news .news-card-content .news-meta .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    color: #1976d2;
}

/* 新闻卡片标题 */
.archive-news .news-card-title {
    margin: 0 0 14px 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
}

.archive-news .news-card-title a {
    color: #1a1a1a;
    transition: color 0.2s ease;
    text-decoration: none;
}

.archive-news .news-card-title a:hover {
    color: #1976d2;
}

/* 新闻卡片摘要 */
.archive-news .news-card-excerpt {
    margin-bottom: 18px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #555;
    flex: 1;
}

/* 新闻卡片底部 */
.archive-news .news-card-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* 新闻卡片链接 */
.archive-news .news-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1976d2;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.archive-news .news-card-link:hover {
    color: #1565c0;
    gap: 10px;
}

.archive-news .news-card-link .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.archive-news .news-card-link:hover .dashicons {
    transform: translateX(4px);
}

/* 新闻卡片 */
.archive-news .news-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(25, 118, 210, 0.08);
    display: flex;
    flex-direction: column;
}

.archive-news .news-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(25, 118, 210, 0.15);
    border-color: rgba(25, 118, 210, 0.2);
}

/* 新闻缩略图 */
.archive-news .news-thumbnail {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.archive-news .news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.archive-news .news-item:hover .news-thumbnail img {
    transform: scale(1.08);
}

/* 新闻内容区域 */
.archive-news .news-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 新闻元信息 */
.archive-news .news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.8125rem;
    color: #666;
}

.archive-news .news-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.archive-news .news-meta .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    color: #1976d2;
}

.archive-news .news-meta a {
    color: #666;
    transition: color 0.2s ease;
}

.archive-news .news-meta a:hover {
    color: #1976d2;
}

/* 新闻标题 */
.archive-news .news-title {
    margin: 0 0 12px 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
}

.archive-news .news-title a {
    color: #1a1a1a;
    transition: color 0.2s ease;
}

.archive-news .news-title a:hover {
    color: #1976d2;
}

/* 新闻摘要 */
.archive-news .news-excerpt {
    margin-bottom: 16px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #555;
    flex: 1;
}

/* 阅读更多按钮 */
.archive-news .read-more {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
    align-self: flex-start;
}

.archive-news .read-more:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    color: #ffffff;
}

/* ==========================================================================
   3. 分页导航优化
   ========================================================================== */

.archive-news .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    padding: 30px 0;
}

.archive-news .pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #ffffff;
    color: #333;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

.archive-news .pagination .page-numbers:hover {
    background: #1976d2;
    color: #ffffff;
    border-color: #1976d2;
    transform: translateY(-2px);
}

.archive-news .pagination .page-numbers.current {
    background: #1976d2;
    color: #ffffff;
    border-color: #1976d2;
}

.archive-news .pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

.archive-news .pagination .page-numbers.dots:hover {
    background: transparent;
    transform: none;
}

/* 分页导航 - 与解决方案页一致 */
.archive-news .archive-pagination {
    margin-top: 50px;
    padding: 30px 0;
}

.archive-news .archive-pagination .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.archive-news .archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #ffffff;
    color: #333;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
    text-decoration: none;
}

.archive-news .archive-pagination .page-numbers:hover {
    background: #1976d2;
    color: #ffffff;
    border-color: #1976d2;
    transform: translateY(-2px);
}

.archive-news .archive-pagination .page-numbers.current {
    background: #1976d2;
    color: #ffffff;
    border-color: #1976d2;
}

.archive-news .archive-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

.archive-news .archive-pagination .page-numbers.dots:hover {
    background: transparent;
    transform: none;
}

.archive-news .archive-pagination .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* ==========================================================================
   4. 侧边栏优化（如果存在）
   ========================================================================== */

.archive-news .sidebar {
    display: none; /* 新闻页使用单栏布局 */
}

/* ==========================================================================
   5. 空状态优化
   ========================================================================== */

.archive-news .no-posts {
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.archive-news .no-posts h2 {
    margin-bottom: 16px;
    font-size: 1.75rem;
    color: #333;
}

.archive-news .no-posts p {
    font-size: 1.0625rem;
    color: #666;
}

/* 空状态 - 与解决方案页一致 */
.archive-news .archive-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.archive-news .archive-empty-state .empty-icon {
    margin-bottom: 24px;
}

.archive-news .archive-empty-state .empty-icon .dashicons {
    width: 80px;
    height: 80px;
    font-size: 80px;
    color: #bdbdbd;
}

.archive-news .archive-empty-state h2 {
    margin-bottom: 16px;
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
}

.archive-news .archive-empty-state p {
    margin-bottom: 32px;
    font-size: 1.0625rem;
    color: #666;
    line-height: 1.6;
}

.archive-news .archive-empty-state .empty-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.archive-news .archive-empty-state .btn {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.archive-news .archive-empty-state .btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.archive-news .archive-empty-state .btn-primary:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.archive-news .archive-empty-state .btn-outline {
    background: transparent;
    color: #1976d2;
    border: 2px solid #1976d2;
}

.archive-news .archive-empty-state .btn-outline:hover {
    background: #1976d2;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================================================
   6. 响应式优化
   ========================================================================== */

@media (max-width: 768px) {
    /* Banner */
    body.category .page-header,
    body.category-news .page-header,
    .archive-news .page-header {
        min-height: 250px !important;
    }
    
    body.category .page-header .page-title,
    body.category-news .page-header .page-title,
    .archive-news .page-header h1 {
        font-size: 1.75rem !important;
    }
    
    .page-header .page-subtitle {
        font-size: 0.9375rem !important;
        margin-top: 8px !important;
    }
    
    /* 筛选栏 */
    .news-filter-bar {
        padding: 16px 0;
    }
    
    .news-filter-bar .filter-wrapper {
        gap: 12px;
    }
    
    .news-filter-bar .filter-label {
        font-size: 0.875rem;
    }
    
    .news-filter-bar .filter-buttons {
        gap: 8px;
    }
    
    .news-filter-bar .filter-btn {
        padding: 6px 16px;
        font-size: 0.8125rem;
    }
    
    /* 内容区域 */
    .archive-news .archive-content {
        padding: 40px 0;
    }
    
    /* 新闻列表 - 改为单列 */
    .archive-news .news-list {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    /* 新闻网格 - 改为2列 */
    .archive-news .news-grid-archive {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    /* 新闻缩略图 */
    .archive-news .news-thumbnail {
        height: 200px;
    }
    
    /* 新闻图片包装器 */
    .archive-news .news-image-wrapper {
        height: 180px;
    }
    
    /* 新闻内容 */
    .archive-news .news-content {
        padding: 20px;
    }
    
    /* 新闻卡片内容 */
    .archive-news .news-card-content {
        padding: 20px;
    }
    
    /* 新闻标题 */
    .archive-news .news-title,
    .archive-news .news-card-title {
        font-size: 1.0625rem;
    }
    
    /* 新闻元信息 */
    .archive-news .news-meta {
        gap: 12px;
        font-size: 0.8125rem;
    }
    
    /* 分页 */
    .archive-news .pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    /* Banner */
    body.category .page-header,
    body.category-news .page-header,
    .archive-news .page-header {
        min-height: 200px !important;
    }
    
    body.category .page-header .page-title,
    body.category-news .page-header .page-title,
    .archive-news .page-header h1 {
        font-size: 1.5rem !important;
    }
    
    /* 内容区域 */
    .archive-news .archive-content {
        padding: 30px 0;
    }
    
    /* 新闻列表 */
    .archive-news .news-list {
        gap: 20px;
    }
    
    /* 新闻网格 - 改为单列 */
    .archive-news .news-grid-archive {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 新闻缩略图 */
    .archive-news .news-thumbnail {
        height: 180px;
    }
    
    /* 新闻图片包装器 */
    .archive-news .news-image-wrapper {
        height: 180px;
    }
    
    /* 新闻内容 */
    .archive-news .news-content {
        padding: 16px;
    }
    
    /* 新闻卡片内容 */
    .archive-news .news-card-content {
        padding: 18px;
    }
    
    /* 新闻标题 */
    .archive-news .news-title,
    .archive-news .news-card-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    /* 新闻摘要 */
    .archive-news .news-excerpt,
    .archive-news .news-card-excerpt {
        font-size: 0.875rem;
        margin-bottom: 12px;
    }
    
    /* 阅读更多按钮 */
    .archive-news .read-more {
        padding: 6px 16px;
        font-size: 0.8125rem;
    }
    
    /* 新闻卡片链接 */
    .archive-news .news-card-link {
        font-size: 0.875rem;
    }
    
    /* 分页 */
    .archive-news .pagination {
        gap: 6px;
        margin-top: 40px;
    }
    
    .archive-news .pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   7. 打印样式
   ========================================================================== */

@media print {
    body.category .page-header::before,
    body.category-news .page-header::before,
    .archive-news .page-header::before {
        display: none !important;
    }
    
    .archive-news .news-item {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}


/* ==========================================================================
   Banner Background Image Support - High Priority Override
   ========================================================================== */

/* 确保特色图片能够正确显示 - 最高优先级 */
/* 覆盖 core-colors.min.css 中的 background: var(--gradient-primary) !important */
body.page-template-template-blog.page main.archive-news .page-header[style*="background-image"],
body.page-template-template-blog.page .archive-news .page-header[style*="background-image"],
body.page-template-template-blog.page .page-header[style*="background-image"],
body.page-template-template-blog main.archive-news .page-header[style*="background-image"],
body.page-template-template-blog .archive-news .page-header[style*="background-image"],
main.archive-news .page-header[style*="background-image"],
.archive-news .page-header[style*="background-image"],
body.category .page-header[style*="background-image"],
body.category-news .page-header[style*="background-image"] {
    /* 只移除渐变背景色，保留内联样式的背景图片 */
    background-color: transparent !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}
