/*
 Theme Name: Astra Child
 Theme URI: http://example.com/astra-child
 Description: Astra 子主题（支持自定义样式 + 关闭 Emoji 和 Dashicons 前端加载）
 Author: Your Name
 Template: astra
 Version: 1.0.0
 Text Domain: astra-child
*/

/* ----------------------
   子主题自定义样式区域
   你可以把 WordPress 额外 CSS 或 Elementor 全局 CSS 粘贴到这里
------------------------ */
:root {
  --accent: #32F08C;
  --text-dark: #000000;
  --text-light: #ffffff;
  --header-border: #2F3742;
  --d2h-container-max: 1200px;
  --d2h-container-pad: 20px;
}

/* Elementor 渐变容器内统一默认态与过渡 */
.e-con[data-settings*="background_background\":\"gradient"] .elementor-heading-title,
.e-con[data-settings*="background_background\":\"gradient"] .elementor-widget-text-editor p,
.e-con[data-settings*="background_background\":\"gradient"] .elementor-divider-separator {
  color: var(--text-light);
  border-color: var(--text-light);
  transition: color .2s ease, border-color .2s ease;
}
/* 悬停反转颜色，提高对比 */
.e-con[data-settings*="background_background\":\"gradient"]:hover .elementor-heading-title,
.e-con[data-settings*="background_background\":\"gradient"]:hover .elementor-widget-text-editor p,
.e-con[data-settings*="background_background\":\"gradient"]:hover .elementor-divider-separator {
  color: var(--text-dark);
  border-color: var(--text-dark);
}

/* 页脚段落排版 */
.footer-widget-area .textwidget p { line-height: 1.5; }

/* 头部按钮 */
.header-book-btn {
  display: inline-block;
  padding: .5rem 1.125rem;
  background-color: var(--accent);
  color: var(--text-light);
  border-radius: .3125rem;
  text-decoration: none;
  font-weight: 700;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.header-book-btn:hover,
.header-book-btn:focus-visible {
  background-color: #ffffff;
  color: var(--text-dark);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 30%, transparent);
}

/* 头部条 */
.main-header-bar {
  background-color: transparent;
  margin-bottom: 2rem; /* 原 31px */
  border-bottom: 1px solid var(--header-border);
}

/* WooCommerce 标签：统一颜色，减少重复 */
.wc-tabs li a,
.wc-tabs li a:hover,
.wc-tabs li.active a {
  color: var(--accent);
  transition: color .2s ease;
}

/* 商品短描述间距 */
.woocommerce-product-details__short-description { margin-top: 3rem; }

/* 相关产品标题 */
.related h2 { font-size: 3rem; }

/* 产品列表布局与间距 */
.woocommerce ul.products.columns-3 {
  display: flex;
  justify-content: space-between;
  gap: 70px;
}
.woocommerce ul.products.columns-3 li.product {
  margin-right: 0;
  margin-bottom: 30px;
  width: 30%;
}
/* 移动端优化 */
@media (max-width: 768px) {
  .woocommerce ul.products.columns-3 { gap: 20px; }
  .woocommerce ul.products.columns-3 li.product { margin-bottom: 20px; width: 100%; }
}

/* 自定义区块：文章列表标题/导航/日期 */
.elementor-element-8b7a0cc h5 { margin-bottom: 16px; }
.elementor-element-8b7a0cc h5 + nav { margin-top: 12px; }
.elementor-element-8b7a0cc nav ul { margin-left: 0; padding-left: 0; list-style-position: outside; }
.elementor-element-8b7a0cc nav li { margin-left: 20px; color: var(--accent); }
.elementor-element-8b7a0cc .post-date { font-size: 12px; color: #ffffff; }

/* 表格与图片通用样式 */
.john-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
.john-table td, .john-table th {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}
.john-table td figure,
.john-table td .wp-caption { display: block; margin: 0; width: 100% !important; }
.john-table td img,
.john-table td .wp-caption img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}
.john-table thead tr { background-color: var(--accent); }
.john-table thead th, .john-table thead span { color: var(--text-light) !important; }
.john-table tr:nth-child(even) { background-color: #f2f2f2; }

.john-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}
#john li, #john p { margin-bottom: 16px; }
#john li::marker { color: var(--accent) !important; }

/* Astra 文章区：缩小左右内边距、拉近与面包屑距离、统一宽度与对齐 */
/* 覆盖 Astra 分隔容器下文章的左右大内边距（保留较强特异性与 !important） */
.ast-separate-container .site-main .ast-row > article.ast-article-post.ast-article-post,
.ast-separate-container .site-main .ast-row > article.ast-article-single.ast-article-single,
.ast-separate-container .ast-article-post.ast-article-post,
.ast-separate-container .ast-article-single.ast-article-single {
  padding: 1.25em 0 !important; /* 原 5.34em 6.67em，去掉左右内边距 */
  margin: 0 !important;
  border-bottom: 1px solid var(--ast-border-color) !important;
}


/* 统一容器宽度与左对齐（与面包屑同宽） */
.ast-archive-description,
.ast-separate-container .site-main .ast-row {
  max-width: var(--d2h-container-max);
  padding-left: var(--d2h-container-pad);
  padding-right: var(--d2h-container-pad);
  margin-left: auto;
  margin-right: auto;
}

/* 去掉正文内部额外左右留白，填满容器 */
.ast-article-post .ast-article-inner,
.ast-article-post .entry-content,
.ast-article-single .ast-article-inner,
.ast-article-single .entry-content {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 消除正文顶部多余空隙（如有叠加间距） */
.ast-separate-container .site-main .ast-row > article {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 去掉文章块的背景图，背景透明（含伪元素与行容器） */
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post .ast-article-inner,
.ast-separate-container .ast-article-single .ast-article-inner {
  background: transparent !important;
  background-image: none !important;
}
.ast-separate-container .ast-article-post::before,
.ast-separate-container .ast-article-post::after,
.ast-separate-container .ast-article-single::before,
.ast-separate-container .ast-article-single::after {
  background: none !important;
  background-image: none !important;
  content: none !important;
  box-shadow: none !important;
  opacity: 0 !important;
}
.ast-separate-container .site-main .ast-row {
  background: transparent !important;
  background-image: none !important;
}

/* 仅修正“内容数据录入”分类页（/category/data-entry/）导航条配色 */
body.category.category-data-entry .main-header-bar .main-header-menu .menu-link,
body.category.category-data-entry .ast-header-break-point .main-header-menu .menu-link {
  color: #ffffff !important; /* 默认白色 */
}
body.category.category-data-entry .main-header-bar .main-header-menu .menu-link:hover,
body.category.category-data-entry .main-header-bar .main-header-menu .menu-link:focus-visible,
body.category.category-data-entry .ast-header-break-point .main-header-menu .menu-link:hover,
body.category.category-data-entry .ast-header-break-point .main-header-menu .menu-link:focus-visible {
  color: var(--accent, #32F08C) !important; /* 悬停绿色 */
}
/* 当前/激活项保持绿色 */
body.category.category-data-entry .main-header-bar .main-header-menu .current-menu-item > .menu-link,
body.category.category-data-entry .main-header-bar .main-header-menu .current-menu-ancestor > .menu-link,
body.category.category-data-entry .main-header-bar .main-header-menu .current_page_item > .menu-link,
body.category.category-data-entry .main-header-bar .main-header-menu .current_page_ancestor > .menu-link,
body.category.category-data-entry .ast-header-break-point .main-header-menu .current-menu-item > .menu-link,
body.category.category-data-entry .ast-header-break-point .main-header-menu .current-menu-ancestor > .menu-link,
body.category.category-data-entry .ast-header-break-point .main-header-menu .current_page_item > .menu-link,
body.category.category-data-entry .ast-header-break-point .main-header-menu .current_page_ancestor > .menu-link {
  color: var(--accent, #32F08C) !important;
}

/* 文章列表标题链接颜色（含 hover/visited，使用站点主色） */
h2.entry-title.ast-blog-single-element > a,
h2.entry-title.ast-blog-single-element > a:hover,
h2.entry-title.ast-blog-single-element > a:visited,
.ast-separate-container .ast-article-post h2.entry-title.ast-blog-single-element > a {
  color: var(--accent, #32F08C) !important;
}

/* 单篇文章页（博客详情页）顶部导航条配色：默认白色、悬停绿色、当前项绿色 */
body.single-post .main-header-bar .main-header-menu .menu-link,
body.single-post .ast-builder-menu-1 .menu-link,
body.single-post .ast-header-break-point .main-header-menu .menu-link,
body.single-post .ast-header-break-point .ast-builder-menu-1 .menu-link {
  color: #ffffff !important;
}
body.single-post .main-header-bar .main-header-menu .menu-link:hover,
body.single-post .main-header-bar .main-header-menu .menu-link:focus-visible,
body.single-post .ast-builder-menu-1 .menu-link:hover,
body.single-post .ast-builder-menu-1 .menu-link:focus-visible,
body.single-post .ast-header-break-point .main-header-menu .menu-link:hover,
body.single-post .ast-header-break-point .main-header-menu .menu-link:focus-visible,
body.single-post .ast-header-break-point .ast-builder-menu-1 .menu-link:hover,
body.single-post .ast-header-break-point .ast-builder-menu-1 .menu-link:focus-visible {
  color: var(--accent, #32F08C) !important;
}
body.single-post .main-header-bar .main-header-menu .current-menu-item > .menu-link,
body.single-post .main-header-bar .main-header-menu .current-menu-ancestor > .menu-link,
body.single-post .main-header-bar .main-header-menu .current_page_item > .menu-link,
body.single-post .main-header-bar .main-header-menu .current_page_ancestor > .menu-link,
body.single-post .ast-builder-menu-1 .current-menu-item > .menu-link,
body.single-post .ast-builder-menu-1 .current-menu-ancestor > .menu-link,
body.single-post .ast-builder-menu-1 .current_page_item > .menu-link,
body.single-post .ast-builder-menu-1 .current_page_ancestor > .menu-link,
body.single-post .ast-header-break-point .main-header-menu .current-menu-item > .menu-link,
body.single-post .ast-header-break-point .main-header-menu .current-menu-ancestor > .menu-link,
body.single-post .ast-header-break-point .main-header-menu .current_page_item > .menu-link,
body.single-post .ast-header-break-point .main-header-menu .current_page_ancestor > .menu-link,
body.single-post .ast-header-break-point .ast-builder-menu-1 .current-menu-item > .menu-link,
body.single-post .ast-header-break-point .ast-builder-menu-1 .current-menu-ancestor > .menu-link,
body.single-post .ast-header-break-point .ast-builder-menu-1 .current_page_item > .menu-link,
body.single-post .ast-header-break-point .ast-builder-menu-1 .current_page_ancestor > .menu-link {
  color: var(--accent, #32F08C) !important;
}

/* 单篇文章页：导航默认白、悬浮绿；“Blog”项始终为绿（桌面与移动端） */
body.single-post.ast-desktop .ast-primary-header-bar .main-header-menu .menu-link,
body.single-post .ast-primary-header-bar .main-header-menu .menu-link,
body.single-post .main-header-bar .main-header-menu .menu-link,
body.single-post .ast-builder-menu-1 .menu-link,
body.single-post .ast-mobile-popup-drawer .main-header-menu .menu-link,
body.single-post .ast-mobile-popup-content .menu-link {
  color: #ffffff !important;
}
body.single-post.ast-desktop .ast-primary-header-bar .main-header-menu .menu-link:hover,
body.single-post.ast-desktop .ast-primary-header-bar .main-header-menu .menu-link:focus-visible,
body.single-post .ast-primary-header-bar .main-header-menu .menu-link:hover,
body.single-post .ast-primary-header-bar .main-header-menu .menu-link:focus-visible,
body.single-post .main-header-bar .main-header-menu .menu-link:hover,
body.single-post .main-header-bar .main-header-menu .menu-link:focus-visible,
body.single-post .ast-builder-menu-1 .menu-link:hover,
body.single-post .ast-builder-menu-1 .menu-link:focus-visible,
body.single-post .ast-mobile-popup-drawer .main-header-menu .menu-link:hover,
body.single-post .ast-mobile-popup-drawer .main-header-menu .menu-link:focus-visible,
body.single-post .ast-mobile-popup-content .menu-link:hover,
body.single-post .ast-mobile-popup-content .menu-link:focus-visible {
  color: var(--accent, #32F08C) !important;
}

/* 强制“Blog”菜单项为绿色（即使未被标记为当前项），并在悬浮依然保持绿色 */
body.single-post .main-header-menu .menu-item a.menu-link[href*="/data-entry/"],
body.single-post .ast-builder-menu-1 .menu-item a.menu-link[href*="/data-entry/"],
body.single-post .ast-mobile-popup-drawer .menu-item a.menu-link[href*="/data-entry/"],
body.single-post .ast-mobile-popup-content .menu-item a.menu-link[href*="/data-entry/"] {
  color: var(--accent, #32F08C) !important;
}
body.single-post .main-header-menu .menu-item a.menu-link[href*="/data-entry/"]:hover,
body.single-post .ast-builder-menu-1 .menu-item a.menu-link[href*="/data-entry/"]:hover,
body.single-post .ast-mobile-popup-drawer .menu-item a.menu-link[href*="/data-entry/"]:hover,
body.single-post .ast-mobile-popup-content .menu-item a.menu-link[href*="/data-entry/"]:hover,
body.single-post .main-header-menu .menu-item a.menu-link[href*="/data-entry/"]:focus-visible,
body.single-post .ast-builder-menu-1 .menu-item a.menu-link[href*="/data-entry/"]:focus-visible,
body.single-post .ast-mobile-popup-drawer .menu-item a.menu-link[href*="/data-entry/"]:focus-visible,
body.single-post .ast-mobile-popup-content .menu-item a.menu-link[href*="/data-entry/"]:focus-visible {
  color: var(--accent, #32F08C) !important;
}

/* 若主题仍赋予当前项类名，保持为绿色（兜底） */
body.single-post .main-header-bar .main-header-menu .current-menu-item > .menu-link,
body.single-post .main-header-bar .main-header-menu .current-menu-ancestor > .menu-link,
body.single-post .ast-builder-menu-1 .current-menu-item > .menu-link,
body.single-post .ast-builder-menu-1 .current-menu-ancestor > .menu-link,
body.single-post .ast-mobile-popup-drawer .current-menu-item > .menu-link,
body.single-post .ast-mobile-popup-drawer .current-menu-ancestor > .menu-link,
body.single-post .ast-mobile-popup-content .current-menu-item > .menu-link,
body.single-post .ast-mobile-popup-content .current-menu-ancestor > .menu-link {
  color: var(--accent, #32F08C) !important;
}

/* 可选：尊重系统减少动画设置 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}