/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com/
 Description:  Default GeneratePress Child Theme
 Author:       Tom Usborne
 Author URI:   https://generatepress.com
 Template:     generatepress
 Version:      0.1
 Text Domain:  generatepress-child
*/

/* 把你上面全部自定义CSS粘贴到这里！！ */
/* 全局 H1 标题 */
h1 {
    font-size: 32px;
    /* 移动端适配 */
}
@media (max-width: 768px) {
    h1 {
        font-size: 26px;
		     	font-weight: 600
    }
}

/* 全局 H2 标题 */
h2 {
    font-size: 24px;
}
@media (max-width: 768px) {
    h2 {
        font-size: 20px;
    }
}
/* 全局 H3 标题 */
h3 {
    font-size: 20px;
}
@media (max-width: 768px) {
    h3 {
        font-size: 16px;
    }
}
/* 主导航一级菜单 */
.main-navigation .main-nav > ul > li > a {
    font-weight: 700; /* 400常规，600粗，700加粗，900特粗 */
}
/* 下拉子菜单也一起加粗 */
.main-navigation .sub-menu li a {
    font-weight: 600;
}
/* 移动端汉堡菜单文字 */
.main-navigation.toggled .main-nav li a {
    font-weight: 700;
}

/* ==========================================
   热门标签文章列表 - 卡片容器 + 内部列表
   列宽等分，标题自动换行不溢出，无列表符号
   margin-top: 20px; margin-bottom: 0;
   ========================================== */

/* ----- 外层卡片容器 ----- */
.hot-tag-posts-wrapper {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 24px;
    margin-top: 20px;
    margin-bottom: 0;
    color: #333333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
    overflow: hidden;
}

.hot-tag-posts-wrapper:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ----- 标签组标题 ----- */
.hot-tag-title {
    margin: 0 0 15px 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #222;
    letter-spacing: -0.3px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ----- 两列网格列表（等宽） ----- */
.hot-tag-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
    list-style: none;          /* 移除默认列表样式 */
    padding: 0;
    margin: 0 0 20px 0;
}

.hot-tag-list:last-child {
    margin-bottom: 0;
}

/* ----- 每个列表项（无圆点） ----- */
.hot-tag-item {
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    min-height: 36px;
}

/* 已移除 ::before 伪元素 */

.hot-tag-item a {
    color: #1e73be;
    text-decoration: none;
    font-weight: 400;
    font-size: 1em;
    transition: color 0.15s ease;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.hot-tag-item a:hover {
    color: #0a3c6b;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hot-tag-item:hover {
    background-color: rgba(0,0,0,0.02);
    margin: 0 -6px;
    padding: 8px 6px;
    border-radius: 3px;
}

/* ==========================================
   响应式：移动端单列
   ========================================== */
@media (max-width: 768px) {
    .hot-tag-posts-wrapper {
        padding: 16px;
        margin-top: 16px;
        margin-bottom: 0;
    }

    .hot-tag-list {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hot-tag-title {
        font-size: 1.1em;
    }

    .hot-tag-item {
        padding: 6px 0;
        min-height: auto;
    }

    .hot-tag-item:hover {
        margin: 0 -4px;
        padding: 6px 4px;
    }
}
/* ============================================
   1. 外层容器（无内边距）
   ============================================ */
.herbs-horizontal-wrapper {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0;                 /* 改为 0 */
}

/* ============================================
   2. 横排列表（Flex 布局）
   ============================================ */
.herbs-horizontal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
}

/* ============================================
   3. 单个卡片
   ============================================ */
.herb-card {
    flex: 1 1 calc(25% - 24px);
    min-width: 200px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.herb-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

/* ============================================
   4. 图片区域
   ============================================ */
.herb-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.herb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.herb-card:hover .herb-card-image img {
    transform: scale(1.05);
}

/* ============================================
   5. 内容区域
   ============================================ */
.herb-card-content {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.herb-card-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.herb-card-content h3 a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.herb-card-content h3 a:hover {
    color: #1e7e34;
}

.herb-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   6. 空状态提示
   ============================================ */
.no-herbs-message {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 16px;
}

/* ============================================
   7. 响应式调整
   ============================================ */
@media (max-width: 1024px) {
    .herb-card {
        flex: 1 1 calc(33.333% - 24px);
    }
}

@media (max-width: 768px) {
    .herb-card {
        flex: 1 1 calc(50% - 24px);
    }
    .herb-card-image {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .herb-card {
        flex: 1 1 100%;
    }
    .herb-card-image {
        height: 200px;
    }
}
/* ===== 文章草本茶内容 ===== */

/* 网格容器 */
.formula-ingredients-grid {
    display: grid;
    grid-template-columns: 1fr;   /* 每个卡片占一行，也可调整为多列 */
    gap: 16px;
    margin: 20px 0;
}

/* 卡片：flex 横向排列 */
.ingredient-card {
    display: flex;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    min-height: 120px;
}
.ingredient-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* 左侧图片 */
.card-image {
    flex: 0 0 160px;      /* 固定宽度，可调整 */
    overflow: hidden;
    background: #f5f5f5;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 右侧内容 */
.card-content {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 名称 */
.ingredient-name {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.ingredient-name a {
    color: #1a1a1a;
    text-decoration: none;
}
.ingredient-name a:hover {
    color: #1e7e34;
}

/* 用量 */
.ingredient-usage {
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}
.ingredient-usage .label {
    color: #888;
    margin-right: 4px;
}
.ingredient-usage .value {
    font-weight: 600;
    color: #222;
}
.ingredient-usage .unit {
    color: #666;
    margin-left: 2px;
}

/* 功效 */
.ingredient-efficacy {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}
.ingredient-efficacy .label {
    color: #888;
    margin-right: 4px;
}
.ingredient-efficacy .text {
    color: #333;
}

/* 备注（可选） */
.ingredient-note {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

/* 响应式：小屏幕时图片在上，文字在下 */
@media (max-width: 600px) {
    .ingredient-card {
        flex-direction: column;
        min-height: auto;
    }
    .card-image {
        flex: 0 0 auto;
        height: 150px;
        width: 100%;
    }
    .card-content {
        padding: 12px 14px;
    }
}
/* ===== 侧边栏药材 ===== */
.tag-related-herb-widget {
	margin-bottom: 20px;
}
.tag-related-herb-widget .widget-title {
	font-size: 18px;
	margin: 0 0 12px;
}
.herb-related-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.herb-item a {
	display: block;
	text-decoration: none;
}
.herb-thumb {
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
	margin-bottom: 8px;
}
.no-pic {
	background: #eee;
}
.herb-name {
	font-size: 16px;
	color: #333;
	text-align:center;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.herb-item a:hover .herb-name {
	color: #287d56;
}
/* ===== 侧边栏药材图片 ===== */
/* 列表容器 */
/* ===== 列表容器基础 ===== */
.tag-related-normal-posts {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ===== 所有列表项统一垂直间距 ===== */
.tag-related-normal-posts li {
    display: block;
    list-style: none;
    position: relative;
    /* 统一使用主题间距，以下提供三种推荐方式，选其一即可 */
    
    /* 方式一：使用主题变量（推荐，若主题有定义） */
    margin-bottom: var(--wp--style--block-gap, 1.5em);
    
    /* 方式二：手动设定主题常用的数值（例如 20px，根据主题调整） */
    /* margin-bottom: 20px; */
    
    /* 方式三：使用相对单位，自动随字体缩放 */
    /* margin-bottom: 0.8rem; */
}

/* ===== 最后一项取消底部外边距（避免多余空白，可选） ===== */
.tag-related-normal-posts li:last-child {
    margin-bottom: 0;
}

/* ===== 有图片的卡片样式（覆盖层、悬停等） ===== */
.post-thumb-cover {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    text-decoration: none;
}
.post-thumb-cover img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}
.post-thumb-cover:hover img {
    transform: scale(1.05);
}

.post-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    box-sizing: border-box;
    transition: background 0.3s ease;
}
.post-thumb-cover:hover .post-title-overlay {
    background: rgba(0, 0, 0, 0.8);
}

/* ===== 无图片时的标题链接（颜色跟随主题） ===== */
.post-title-only {
    display: inline-block;
    text-decoration: underline;
    font-weight: 500;
    /* 不设置 color，自动继承主题链接颜色 */
}
.post-title-only:hover {
    text-decoration: underline;
}