/* ==========================================================================
   网站装修 news_17 模块样式
   - 取自 eco-tableware.com 首页 "Latest News": 白底居中标题 + 装饰小图标 + 新闻卡网格
   - 卡片 = 压暗封面图(外层 div opacity .1, img contain 长边撑满) + 聚焦遮罩层 + 浮层文本(日期/标题/摘要/Read more 按钮), 整卡可点
   - 卡片高度固定: PC 420px / 移动端 400px(@media 内), 不走配置字段
   - 聚焦/按钮配色回落值取自原站 index.css:
     .i_newsItem:hover{background:#161415} / :hover .i_newsItem_title{color:#fff} /
     :hover .i_newsItem_desc{color:#ccc} / .i_newsItem_more{background-color:#94c33b;color:#fff}
   - 作用域 class ly_news_17, 自包含
   - 模块级变量(标题/卡片文本/聚焦/按钮配色/间距/列数)由 news_17.html <style th:inline> 注入 [data-module-id]
   ========================================================================== */

.ly_news_17 {
    box-sizing: border-box;
    background-color: var(--n17-bg-color, #FFFFFF);
    padding: var(--n17-pad-top, 0) var(--n17-pad-right, 0) var(--n17-pad-bottom, 0) var(--n17-pad-left, 0);
}

.ly_news_17 .section {
    box-sizing: border-box;
}

.ly_news_17 .n17_title {
    text-align: center;
    font-size: var(--n17-pc-title-size, 30px);
    line-height: 1.2;
    color: var(--deco-title-color, #000000);
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
}

/* 标题下装饰小图标: 160px 细线 + 中间图片(白底盖线), 与 productDisplay_25 同款
   (原站 ::after 40x18 盒 #fff 底, 20x18 prod_tool.png 居中; 图片可配置, object-fit contain 兼容任意尺寸) */
.ly_news_17 .n17_title_ico {
    width: 160px;
    height: 18px;
    margin: 26px auto 0;
    position: relative;
}

.ly_news_17 .n17_title_ico::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #EEEEEE;
    transform: translateY(-50%);
}

.ly_news_17 .n17_title_ico img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 18px;
    object-fit: contain;
    background-color: var(--n17-bg-color, #FFFFFF);
}

/* 新闻卡网格: 列数由 --n17-pc-columns 驱动(默认 3); 不留卡间 gap(间距走配置的模块间距) */
.ly_news_17 .n17_grid {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(var(--n17-pc-columns, 3), minmax(0, 1fr));
}

/* 卡片: 高度固定 420px(原站 i_newsItem 高 420),
   无图/图未铺满时露出卡片背景色(原站 .i_newsItem background:#eee 同款, 可配置 cardBgColor),
   文本浮层置中(i_newsText 71%x80% 居中) */
.ly_news_17 .n17_card {
    position: relative;
    display: block;
    height: 420px;
    overflow: hidden;
    background-color: var(--n17-card-bg, #EEEEEE);
    text-decoration: none;
}

.ly_news_17 .n17_card:hover {
    text-decoration: unset;
}

/* 封面图容器: 压暗(opacity .1, hover 由聚焦色遮罩盖上); img 按原始比例展示,
   object-fit: contain = 长边撑满、短边留白露出卡片背景色 */
.ly_news_17 .n17_bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
}

.ly_news_17 .n17_bg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 聚焦遮罩层: 独立子元素(不用模块根 ::before/::after), hover 时盖上;
   聚焦色固定 #222021A8(带透明度, 压暗底图), 不再作为配置项 */
.ly_news_17 .n17_mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #222021A8;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ly_news_17 .n17_card:hover .n17_mask {
    opacity: 1;
}

.ly_news_17 .n17_text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 71%;
    height: 80%;
    margin: auto;
    box-sizing: border-box;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.ly_news_17 .n17_date {
    font-family: Verdana, Arial, sans-serif;
    font-size: var(--n17-pc-date-size, 12px);
    line-height: 1.4;
    color: var(--n17-date-color, #999999);
    transition: color 0.3s ease;
}

.ly_news_17 .n17_card:hover .n17_date {
    color: var(--n17-focus-date-color, #94C33B);
}

.ly_news_17 .n17_name {
    margin-top: 10px;
    max-width: 100%;
    font-size: var(--n17-pc-name-size, 15px);
    line-height: 1.5;
    color: var(--n17-name-color, #333333);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.ly_news_17 .n17_card:hover .n17_name {
    color: var(--n17-focus-title-color, #FFFFFF);
}

.ly_news_17 .n17_desc {
    margin-top: 10px;
    font-family: Verdana, Arial, sans-serif;
    font-size: var(--n17-pc-desc-size, 13px);
    line-height: 1.6;
    color: var(--n17-desc-color, #666666);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.3s ease;
}

.ly_news_17 .n17_card:hover .n17_desc {
    color: var(--n17-focus-desc-color, #CCCCCC);
}

/* Read more 按钮: 原站 .i_newsItem_more(200x50, #94c33b 底白字, 直角无边框); hover 深化为设计值 */
.ly_news_17 .n17_readmore {
    display: inline-block;
    margin-top: 24px;
    min-width: 200px;
    padding: 0 20px;
    box-sizing: border-box;
    height: 50px;
    line-height: 50px;
    font-family: Verdana, Arial, sans-serif;
    font-size: 18px;
    text-align: center;
    text-transform: uppercase;
    color: var(--n17-readmore-text, #FFFFFF);
    background-color: var(--n17-readmore-bg, #94C33B);
    border-radius: var(--n17-readmore-radius, 0px);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.ly_news_17 .n17_readmore:hover {
    color: var(--n17-readmore-text-hover, #FFFFFF);
    background-color: var(--n17-readmore-bg-hover, #7DA330);
}

/* 响应式 */
@media screen and (max-width: 1000px) {
    .ly_news_17 .n17_card {
        height: 400px;
    }
    .ly_news_17 .n17_grid {
        margin-top: 24px;
        grid-template-columns: repeat(var(--n17-pc-columns, 1), minmax(0, 1fr));
    }
    .ly_news_17 .n17_title_ico {
        margin-top: 16px;
    }
    .ly_news_17 .n17_text {
        width: 90%;
    }
    .ly_news_17 .n17_readmore {
        margin-top: 18px;
        height: 40px;
        line-height: 40px;
        font-size: 14px;
    }
}
