/* 文章页头图 + 面包屑条（新排版）
   HTML: template-parts/CategorySection/CategoryHero.php；生效范围: Custom/catHero/cat-hero.php 白名单；本文件只管长相。
   尺寸全在 .nf-cat-hero 的变量上，换高度/字号只改变量：
   --nf-hero-h 图带高（稿 319）｜--nf-hero-gutter 标题左内缩（250/1920=13.02vw）｜--nf-hero-title-size / -lh 标题字号行高（48/57.6）
   --nf-crumb-h 面包屑高（60）｜--nf-crumb-gutter 面包屑左内缩（250）
   窄屏（≤768px）在文件末尾整体切成移动档（160 / 36 / 32 / 35 / 18）。
   设计稿：即时设计 185:367 头图 / 185:371 面包屑 / 230:740、230:744 移动 */

.nf-cat-hero {
    --nf-hero-h: 319px;
    --nf-hero-gutter: clamp(20px, 13.02vw, 250px);
    --nf-hero-title-size: 48px;
    --nf-hero-title-lh: 57.6px;
    --nf-crumb-h: 60px;
    --nf-crumb-gutter: clamp(20px, 13.02vw, 250px);
}

/* 一、头图：固定高度图片带，图铺满后居中裁，标题绝对定位浮在图上 */
.nf-cat-hero__band {
    position: relative;
    height: var(--nf-hero-h);
    overflow: hidden;
    background-color: #061929; /* 图没加载完时的底色 */
}

.nf-cat-hero__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 只有填了移动端头图才会多出这张 --m 图（band 带 --has-m）；没填就用桌面图 cover 裁，不重复出图 */
.nf-cat-hero__img--m {
    display: none;
}

.nf-cat-hero__title {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: grid;
    align-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 var(--nf-hero-gutter);
    font-family: 'Poppins', sans-serif;
    font-size: var(--nf-hero-title-size);
    font-weight: 700;
    line-height: var(--nf-hero-title-lh);
    letter-spacing: 0;
    color: #FFFFFF;
    text-align: left;
    text-transform: none;
    /* 文章标题比分类名长，强制允许在容器内换行（主题别处有 nowrap） */
    white-space: normal;
}

/* 标题文字独立成块：h1 是网格容器，长标题按列宽换行 */
.nf-cat-hero__title-text {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* 二、面包屑条：紧贴头图下方 */
.nf-cat-crumb {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    height: var(--nf-crumb-h);
    /* flex 容器忽略标签间空白，段间距全由 sep 的外边距控制 */
    padding: 0 var(--nf-crumb-gutter);
    background: #F7FAFC;
    border-bottom: 1px solid #C0C9CE;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    color: #5E717D;
}

/* 分隔符紧贴前一项的「/」，后面留一个空格：Home/ Application and Solutions */
.nf-cat-crumb__sep {
    margin: 0 4px 0 0;
    color: #5E717D;
}

.nf-cat-crumb__link {
    color: #5E717D;
    text-decoration: none;
}

.nf-cat-crumb__link:hover {
    color: #061929;
    text-decoration: underline;
}

.nf-cat-crumb__current {
    color: #061929;
}

/* 三、窄屏（稿子 393 宽）：头图变矮、标题变小、内缩换移动档 */
@media (max-width: 768px) {
    .nf-cat-hero {
        --nf-hero-h: 160px;
        --nf-hero-gutter: clamp(16px, 9.16vw, 36px);
        --nf-hero-title-size: 32px;
        --nf-hero-title-lh: 35px;
        --nf-crumb-gutter: clamp(12px, 4.58vw, 18px);
    }

    .nf-cat-hero__band--has-m .nf-cat-hero__img--pc {
        display: none;
    }

    .nf-cat-hero__band--has-m .nf-cat-hero__img--m {
        display: block;
    }

    /* 文章标题和面包屑都比分类名长：标题允许在词间断行，面包屑允许换行并自适应高度 */
    .nf-cat-crumb {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--nf-crumb-h);
        padding-top: 10px;
        padding-bottom: 10px;
        row-gap: 4px;
    }

    .nf-cat-crumb__item,
    .nf-cat-crumb__sep {
        flex: 0 0 auto;
    }

    .nf-cat-crumb__current {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}
