/*
 Theme Name:   Dr Julie Child
 Theme URI:    https://drjuliediabetes.com/
 Description:  Astra Child Theme for Dr Julie Diabetes
 Author:       Dr Julie Diabetes Team
 Author URI:   https://drjuliediabetes.com/
 Template:     astra
 Version:      1.0.1
*/

/* 隐藏 Astra 原生的 post meta，因为我们在正文上方已经用 PHP 动态生成了更好看的 */
.ast-article-single .entry-header .entry-meta {
  display: none !important;
}

/* 修复标题贴边与间距过大问题：分别控制 header 和 content 的 padding，避免垂直间距翻倍，强制覆盖 Astra 默认设置 */
.ast-article-single .entry-header {
  padding: 48px 56px 0 56px !important;
  margin-bottom: 20px;
}

.ast-article-single .entry-content {
  padding: 0 56px 48px 56px !important;
}

.entry-title {
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.35;
  color: #4B3494; /* 使用品牌紫色 */
}

/* 移动端缩小padding但保留呼吸感 */
@media (max-width: 768px) {
  .ast-article-single .entry-header {
    padding: 28px 20px 0 20px !important;
  }
  .ast-article-single .entry-content {
    padding: 0 20px 28px 20px !important;
  }
}

/* 动态目录与作者信息的 UI 样式 */
.article-byline {
  font-size: 13px; color: #726F7D;
  margin: 0 0 28px; padding-bottom: 24px;
  border-bottom: 1px solid #EBE6F7;
}

.article-toc {
  background: #F1EDFA; border-radius: 10px;
  padding: 14px 20px; margin: 0 0 28px;
}

.article-toc summary {
  font-weight: 700; color: #4B3494;
  cursor: pointer; font-size: 14px; list-style: none;
}

.article-toc summary::-webkit-details-marker { display: none; }

.article-toc ol { 
  margin: 12px 0 0; 
  padding-left: 20px; 
  font-size: 14px; 
  line-height: 2; 
}

.article-toc a { 
  color: #6D4FC2; 
  text-decoration: none; 
}

/* Custom UI blocks from previous mockup */
.callout{
  border-left:3px solid #6D4FC2;
  background:#F1EDFA;
  border-radius:0 10px 10px 0;
  padding:18px 24px;
  margin:28px 0;
  font-size:16px;
  line-height:1.8;
  color:#4B3494;
  font-weight:500;
}

.trend-divider{margin:40px 0;opacity:.55;}

.icon-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin:24px 0 32px;
}
@media (max-width:640px){ .icon-grid{grid-template-columns:1fr;} }
.icon-card{
  background:#F1EDFA;
  border-radius:12px;
  padding:20px 18px;
  text-align:left;
}
.icon-card .num{
  width:30px;height:30px;border-radius:50%;
  background:#6D4FC2;color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:700;margin-bottom:12px;
}
.icon-card h4{margin:0 0 6px;font-size:15px;color:#4B3494;font-family:'Poppins',sans-serif;font-weight:600;}
.icon-card p{margin:0;font-size:13.5px;line-height:1.7;color:#726F7D;}

.stat-row{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin:24px 0 32px;
}
@media (max-width:640px){ .stat-row{grid-template-columns:1fr;} }
.stat-card{border-radius:12px;padding:20px;text-align:center;}
.stat-card .value{font-family:'Poppins',sans-serif;font-size:28px;font-weight:600;margin-bottom:4px;}
.stat-card .label{font-size:13px;font-weight:500;}
.stat-card.good{background:#E9F7EF;}
.stat-card.good .value,.stat-card.good .label{color:#3E9C6E;}
.stat-card.warn{background:#FDF3E1;}
.stat-card.warn .value,.stat-card.warn .label{color:#C77E1B;}
.stat-card.bad{background:#FBEAEA;}
.stat-card.bad .value,.stat-card.bad .label{color:#C24444;}

.faq-item{border-bottom:1px solid #EBE6F7;}
.faq-item summary{
  padding:18px 0;
  font-weight:700;
  font-size:15.5px;
  color:#3D3A45;
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.faq-item summary::-webkit-details-marker{display:none;}
.faq-item summary::after{content:'+';font-size:20px;color:#6D4FC2;font-weight:400;}
.faq-item[open] summary::after{content:'–';}
.faq-item p{padding-bottom:18px;color:#726F7D;font-size:14.5px;}

.cta-card{
  margin-top:40px;
  background:linear-gradient(135deg,#6D4FC2,#4B3494);
  border-radius:16px;
  padding:32px;
  color:#ffffff !important;
  text-align:center;
  box-shadow: 0 10px 30px rgba(75,52,148,0.2);
}
.cta-card h4{
  font-family:'Poppins',sans-serif;
  font-size:22px;
  margin:0 0 12px;
  color:#ffffff !important;
  font-weight: 700;
}
.cta-card p{
  color:rgba(255,255,255,0.95) !important;
  font-size:15px;
  margin:0 0 24px;
  line-height: 1.6;
}
.cta-card a{
  display:inline-block;
  background:#ffffff !important;
  color:#4B3494 !important;
  font-weight:700;
  font-size:15px;
  padding:14px 32px;
  border-radius:30px;
  text-decoration:none !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cta-card a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* 博客列表页间距与排版优化 (最高优先级绝对压制) */
body.blog .ast-article-post .post-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}
body.blog .ast-article-post .entry-title {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
  flex-grow: 0 !important;
}
body.blog .ast-article-post .entry-header.ast-blog-meta-container,
body.blog .ast-article-post .entry-header .entry-meta {
  margin-top: 0 !important;
  margin-bottom: 16px !important;
  padding: 0 !important;
  flex-grow: 0 !important;
  white-space: nowrap !important;
  text-align: left !important; /* 修复作者/日期居中的问题 */
  justify-content: flex-start !important;
}
body.blog .ast-article-post .ast-excerpt-container {
  margin-top: 0 !important;
  flex-grow: 1 !important;
}
body.blog .ast-article-post .ast-excerpt-container p {
  margin-bottom: 0 !important;
}
