/**
 * 全站 Banner 背景图片 - 最终修复版本
 * 
 * 修复内容：
 * 1. 移除所有URL中的多余空格
 * 2. 确保所有图片URL格式正确
 * 3. 优化代码格式
 * 
 * @package Corporate_Theme
 * @since 1.0.0
 */

/* ==========================================================================
   1. 首页 Hero Section
   ========================================================================== */

.home .hero-section {
    background-image: url('http://silica-fume.local/wp-content/uploads/2026/01/5.jpg');
    background-size: cover;
    background-position: center 75%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 500px;
    max-height: 600px;
    height: 60vh;
    position: relative;
    overflow: hidden;
}

.home .hero-section .hero-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.35) 0%, rgba(25, 118, 210, 0.15) 100%);
    position: absolute;
    inset: 0;
    z-index: 1;
}

.home .hero-section .hero-content {
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   2. 产品页 Banner
   ========================================================================== */

.archive-product-new .archive-hero,
.tax-product_category .archive-hero,
.tax-product_tag .archive-hero,
.single-product:not(.lang-ja):not(.lang-vi):not(.lang-ar) .product-hero {
    background-image: url('http://silica-fume.local/wp-content/uploads/2026/01/1.jpg');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    min-height: 300px;
    max-height: 450px;
    position: relative;
    overflow: hidden;
}

.archive-product-new .archive-hero::before,
.tax-product_category .archive-hero::before,
.tax-product_tag .archive-hero::before,
.single-product:not(.lang-ja):not(.lang-vi):not(.lang-ar) .product-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(25, 118, 210, 0.15) 0%, rgba(21, 101, 192, 0.5) 100%);
    z-index: 1;
}

/* ==========================================================================
   3. 新闻页 Banner - 支持自定义特色图片
   ========================================================================== */

/* 新闻归档页 - 只在没有内联背景图片时应用默认图片 */
.archive-news .page-header:not([style*="background-image"]),
/* 新闻分类页（用户的新闻页） */
body.category .page-header:not([style*="background-image"]),
body.category-news .page-header:not([style*="background-image"]),
/* 单篇新闻文章 */
.single-post .post-header:not([style*="background-image"]) {
    background-image: url('http://silica-fume.local/wp-content/uploads/2026/01/4.jpg') !important;
    background-size: cover !important;
    background-position: center 45% !important;
    background-repeat: no-repeat !important;
    min-height: 300px !important;
    max-height: 450px !important;
    position: relative !important;
    overflow: hidden !important;
}

/* 如果有内联背景图片，确保正确显示 */
.archive-news .page-header[style*="background-image"],
body.category .page-header[style*="background-image"],
body.category-news .page-header[style*="background-image"],
.single-post .post-header[style*="background-image"],
body.page-template-template-blog .page-header[style*="background-image"] {
    /* 内联样式已经包含了 background-image, background-size, background-position */
    /* 只需要确保其他属性正确 */
    min-height: 300px !important;
    max-height: 450px !important;
    position: relative !important;
    overflow: hidden !important;
}

/* 遮罩层 - 只在没有自定义背景图片时应用 */
.archive-news .page-header:not([style*="background-image"])::before,
body.category .page-header:not([style*="background-image"])::before,
body.category-news .page-header:not([style*="background-image"])::before,
.single-post .post-header:not([style*="background-image"])::before {
    content: '' !important;
    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.25) 100%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* 有自定义背景图片时，使用更轻的遮罩 */
.archive-news .page-header[style*="background-image"]::before,
body.category .page-header[style*="background-image"]::before,
body.category-news .page-header[style*="background-image"]::before,
.single-post .post-header[style*="background-image"]::before,
body.page-template-template-blog .page-header[style*="background-image"]::before {
    content: '' !important;
    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.2) 0%, rgba(25, 118, 210, 0.15) 100%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   4. 关于我们页 Banner
   ========================================================================== */

.page-about-modern .archive-hero {
    background-image: url('http://silica-fume.local/wp-content/uploads/2026/01/3.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* 旧版关于页面（如果存在） */
.page-about .page-hero {
    background-image: url('http://silica-fume.local/wp-content/uploads/2026/01/3.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 300px;
    max-height: 400px;
    position: relative;
    overflow: hidden;
}

.page-about .page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(66, 165, 245, 0.5) 100%);
    z-index: 1;
}

/* ==========================================================================
   5. 联系我们页 Banner - 修复：移除URL中的空格
   ========================================================================== */

.page-contact .page-hero {
    background-image: url('http://silica-fume.local/wp-content/uploads/2026/01/2.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 300px;
    max-height: 400px;
    position: relative;
    overflow: hidden;
}

.page-contact .page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(66, 165, 245, 0.5) 100%);
    z-index: 1;
}

/* ==========================================================================
   通用优化
   ========================================================================== */

.archive-hero .container,
.product-hero .container,
.page-header .container,
.post-header .container,
.page-hero .container {
    position: relative;
    z-index: 2;
}

/* 确保新闻页标题在遮罩层之上 */
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 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 2px 8px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   高级感细节优化
   ========================================================================== */

@keyframes subtle-zoom {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

.hero-section,
.archive-hero,
.product-hero,
.page-header,
.post-header,
.page-hero {
    animation: subtle-zoom 25s ease-in-out infinite;
}

.hero-section::after,
.archive-hero::after,
.product-hero::after,
.page-header::after,
.post-header::after,
.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-section h1,
.hero-section .hero-title,
.archive-hero h1,
.product-hero h1,
.page-header h1,
.post-header h1,
.page-hero h1 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

@media (max-width: 1024px) {
    .home .hero-section {
        min-height: 450px;
        max-height: 500px;
        height: 55vh;
    }
    
    .archive-product-new .archive-hero,
    .tax-product_category .archive-hero,
    .tax-product_tag .archive-hero,
    .single-product .product-hero,
    .page-about .page-hero,
    .page-contact .page-hero {
        min-height: 350px;
        max-height: 400px;
    }
    
    .archive-news .page-header,
    body.category .page-header,
    body.category-news .page-header,
    .single-post .post-header {
        min-height: 280px !important;
        max-height: 320px !important;
    }
}

@media (max-width: 768px) {
    .home .hero-section {
        min-height: 400px;
        max-height: 450px;
        height: 50vh;
        background-attachment: scroll;
    }
    
    .archive-product-new .archive-hero,
    .tax-product_category .archive-hero,
    .tax-product_tag .archive-hero,
    .single-product .product-hero,
    .page-about .page-hero,
    .page-contact .page-hero {
        min-height: 300px;
        max-height: 350px;
        background-position: center center;
    }
    
    .archive-news .page-header,
    body.category .page-header,
    body.category-news .page-header,
    .single-post .post-header {
        min-height: 250px !important;
        max-height: 280px !important;
    }
    
    .hero-section .hero-overlay,
    .archive-hero::before,
    .product-hero::before,
    .page-header::before,
    .post-header::before,
    .page-hero::before {
        background: rgba(0, 0, 0, 0.5) !important;
    }
    
    .hero-section,
    .archive-hero,
    .product-hero,
    .page-header,
    .post-header,
    .page-hero {
        animation: none;
    }
}

@media (max-width: 480px) {
    .home .hero-section {
        min-height: 350px;
        max-height: 400px;
        height: 45vh;
    }
    
    .archive-product-new .archive-hero,
    .tax-product_category .archive-hero,
    .tax-product_tag .archive-hero,
    .single-product .product-hero,
    .page-about .page-hero,
    .page-contact .page-hero {
        min-height: 250px;
        max-height: 300px;
    }
    
    .archive-news .page-header,
    body.category .page-header,
    body.category-news .page-header,
    .single-post .post-header {
        min-height: 200px !important;
        max-height: 240px !important;
    }
}


/* ==========================================================================
   最高优先级 - 确保自定义特色图片能够显示
   ========================================================================== */

/* 新闻页面 - 当有内联背景图片时，覆盖渐变背景 */
/* 使用更具体的选择器来覆盖 core-colors.min.css 中的 !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"],
body.page-template-template-blog .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 简写属性来完全覆盖渐变 */
    /* 但这会移除内联样式，所以我们需要在PHP中添加 !important */
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    min-height: 300px !important;
    max-height: 450px !important;
    position: relative !important;
    overflow: hidden !important;
}
