/* ================================================================
   HousingAI.ca — 文章组件共用样式 v1.0
   粘贴位置：WordPress → 外观 → 自定义 → 附加CSS（追加到末尾）
   ================================================================ */

/* ── 字体引入 ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── CSS 变量 ── */
:root {
  --hai-gold:   #C4A45E;
  --hai-gold2:  #E2C07A;
  --hai-amber:  #B45309;
  --hai-bg:     #0D1117;
  --hai-bg2:    #161C27;
  --hai-bg3:    #1E2736;
  --hai-text:   #E8E4DC;
  --hai-muted:  #8A95A8;
  --hai-red:    #DC2626;
  --hai-blue:   #1D4ED8;
  --hai-green:  #065F46;
  --hai-purple: #5B21B6;
}

/* ================================================================
   ARTICLE WRAPPER — 包裹整篇文章内容
   ================================================================ */
.hai-article {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--hai-text);
  background: var(--hai-bg);
  margin: -20px -30px 0;   /* 抵消Astra默认内边距 */
  overflow: hidden;
}

/* ================================================================
   HERO BANNER — 文章顶部大图区
   ================================================================ */
.hai-hero {
  padding: 56px 60px 48px;
  position: relative;
  overflow: hidden;
}
.hai-hero::after {
  content: attr(data-emoji);
  position: absolute;
  right: 60px; top: 50%;
  transform: translateY(-50%);
  font-size: 130px;
  opacity: 0.06;
  pointer-events: none;
  line-height: 1;
}
.hai-hero-inner { max-width: 820px; position: relative; }

/* 类型徽章 */
.hai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 3px;
  margin-bottom: 22px;
}
.hai-badge::before {
  content: '';
  width: 7px; height: 7px;
  background: #fff;
  border-radius: 50%;
  animation: hai-blink 1.3s ease-in-out infinite;
}
@keyframes hai-blink { 0%,100%{opacity:1} 50%{opacity:.15} }

/* Breaking = red */
.hai-badge.breaking { background: var(--hai-red); }
/* Report = blue */
.hai-badge.report    { background: var(--hai-blue); }
/* Data = green */
.hai-badge.data      { background: #047857; }
/* Policy = purple */
.hai-badge.policy    { background: var(--hai-purple); }

/* 标题 */
.hai-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 3.8vw, 44px);
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.hai-title em   { font-style: italic; }
/* em颜色按类型 */
.hai-hero.breaking .hai-title em { color: #F87171; }
.hai-hero.report   .hai-title em { color: #93C5FD; }
.hai-hero.data     .hai-title em { color: #6EE7B7; }
.hai-hero.policy   .hai-title em { color: #C4B5FD; }

/* 副标题 */
.hai-subtitle {
  font-size: 17px;
  color: var(--hai-muted);
  line-height: 1.65;
  max-width: 680px;
  margin-bottom: 26px;
}

/* Meta行 */
.hai-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--hai-muted);
  flex-wrap: wrap;
}
.hai-meta-dot { width: 3px; height: 3px; background: var(--hai-muted); border-radius: 50%; }
.hai-tag {
  border: 1px solid;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hai-hero.breaking .hai-tag { color:#F87171; border-color:#F8717140; background:#F8717112; }
.hai-hero.report   .hai-tag { color:#93C5FD; border-color:#93C5FD40; background:#93C5FD12; }
.hai-hero.data     .hai-tag { color:#6EE7B7; border-color:#6EE7B740; background:#6EE7B712; }
.hai-hero.policy   .hai-tag { color:#C4B5FD; border-color:#C4B5FD40; background:#C4B5FD12; }

/* ── Hero 背景按类型 ── */
.hai-hero.breaking {
  background: linear-gradient(135deg, #1A0505 0%, #0D1117 55%, #12101A 100%);
  border-bottom: 1px solid rgba(220,38,38,.2);
}
.hai-hero.report {
  background: linear-gradient(135deg, #050D1A 0%, #0D1117 55%, #0A1020 100%);
  border-bottom: 1px solid rgba(29,78,216,.2);
}
.hai-hero.data {
  background: linear-gradient(135deg, #051A0F 0%, #0D1117 55%, #0A1510 100%);
  border-bottom: 1px solid rgba(4,120,87,.2);
}
.hai-hero.policy {
  background: linear-gradient(135deg, #0D0520 0%, #0D1117 55%, #120A1C 100%);
  border-bottom: 1px solid rgba(91,33,182,.2);
}

/* ================================================================
   LAYOUT — 主内容 + 侧边栏
   ================================================================ */
.hai-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 56px;
  padding: 0 60px;
  background: var(--hai-bg);
  max-width: 100%;
}
.hai-body    { padding: 52px 0; }
.hai-sidebar { padding: 52px 0; }

/* ================================================================
   BODY ELEMENTS
   ================================================================ */

/* 导语 */
.hai-lead {
  font-size: 19.5px;
  line-height: 1.78;
  color: #CEC8BF;
  margin-bottom: 40px;
  padding-bottom: 38px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.hai-lead strong { color: #fff; font-weight: 600; }

/* Section块 */
.hai-section { margin-bottom: 44px; }

.hai-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.hai-section-icon { font-size: 22px; line-height: 1; }
.hai-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.hai-section-body {
  color: #B0A89E;
  font-size: 16.5px;
  line-height: 1.85;
}
.hai-section-body p { margin-bottom: 15px; }
.hai-section-body p:last-child { margin-bottom: 0; }
.hai-section-body strong { color: var(--hai-text); font-weight: 600; }

/* ── 数据卡 ── */
.hai-data-card {
  background: linear-gradient(135deg, var(--hai-bg2) 0%, #0F1520 100%);
  border: 1px solid rgba(196,164,94,.2);
  border-radius: 12px;
  padding: 26px 30px;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
}
.hai-data-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--hai-gold) 0%, transparent 100%);
  border-radius: 3px 0 0 3px;
}
.hai-data-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hai-gold);
  margin-bottom: 18px;
}
.hai-data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.hai-data-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 27px;
  font-weight: 600;
  color: var(--hai-gold2);
  line-height: 1;
  margin-bottom: 5px;
}
.hai-data-num.danger { color: #F87171; }
.hai-data-num.up     { color: #4ADE80; }
.hai-data-desc { font-size: 12px; color: var(--hai-muted); line-height: 1.4; }

/* ── 引用块 ── */
.hai-pullquote {
  border-left: 3px solid var(--hai-gold);
  padding: 4px 0 4px 26px;
  margin: 32px 0;
}
.hai-pullquote p {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-style: italic;
  color: var(--hai-gold2);
  line-height: 1.55;
  margin: 0;
}

/* ── 警告块 ── */
.hai-alert {
  background: rgba(220,38,38,.06);
  border: 1px solid rgba(220,38,38,.22);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 28px 0;
}
.hai-alert p { color: #FCA5A5; font-size: 15.5px; line-height: 1.75; margin: 0; }
.hai-alert strong { color: #FEE2E2; }

/* ── 信息块（蓝，用于report/policy） ── */
.hai-info {
  background: rgba(29,78,216,.06);
  border: 1px solid rgba(29,78,216,.22);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 28px 0;
}
.hai-info p { color: #93C5FD; font-size: 15.5px; line-height: 1.75; margin: 0; }
.hai-info strong { color: #BFDBFE; }

/* ── 行动清单 ── */
.hai-action {
  background: linear-gradient(135deg, #0F1E0F 0%, #0D1117 100%);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 12px;
  padding: 26px 30px;
  margin: 28px 0;
}
.hai-action-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #4ADE80; margin-bottom: 14px;
}
.hai-action ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.hai-action li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 15px; color: #A7C5A7; line-height: 1.55;
}
.hai-action li::before { content: '→'; color: #4ADE80; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.hai-action li strong { color: #D1FAE5; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.hai-sb-card {
  background: var(--hai-bg2);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}
.hai-sb-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--hai-gold);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(196,164,94,.15);
}

/* Key Numbers */
.hai-kn-list { display: flex; flex-direction: column; gap: 14px; }
.hai-kn-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px; font-weight: 600;
  color: var(--hai-gold2); line-height: 1;
}
.hai-kn-val.danger { color: #F87171; }
.hai-kn-val.up     { color: #4ADE80; }
.hai-kn-desc { font-size: 13px; color: var(--hai-muted); margin-top: 3px; line-height: 1.4; }

/* Timeline */
.hai-timeline { display: flex; flex-direction: column; }
.hai-tl-item {
  display: grid; grid-template-columns: 62px 1fr; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.hai-tl-item:last-child { border-bottom: none; }
.hai-tl-year { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--hai-gold); }
.hai-tl-text { font-size: 13px; color: var(--hai-muted); line-height: 1.5; }

/* AI Insight */
.hai-ai {
  background: linear-gradient(135deg, #0D1420 0%, #0A1015 100%);
  border: 1px solid rgba(99,179,237,.2);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.hai-ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(99,179,237,.1); color: #93C5FD;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px; margin-bottom: 11px;
}
.hai-ai-text { font-size: 13.5px; color: #94A3B8; line-height: 1.65; }
.hai-ai-text strong { color: #CBD5E1; }

/* CTA */
.hai-cta {
  background: linear-gradient(135deg, #1A1508 0%, #0D1117 100%);
  border: 1px solid rgba(196,164,94,.3);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  margin-bottom: 20px;
}
.hai-cta p { font-size: 14px; color: var(--hai-muted); line-height: 1.6; margin-bottom: 14px; }
.hai-cta a {
  display: block;
  background: linear-gradient(135deg, var(--hai-gold) 0%, var(--hai-amber) 100%);
  color: #0D1117 !important;
  text-decoration: none !important;
  font-weight: 700; font-size: 14px;
  padding: 11px 18px; border-radius: 8px;
  letter-spacing: 0.02em; transition: opacity .2s;
}
.hai-cta a:hover { opacity: .88; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 860px) {
  .hai-layout { grid-template-columns: 1fr; padding: 0 24px; gap: 0; }
  .hai-hero   { padding: 40px 24px 36px; }
  .hai-hero::after { display: none; }
  .hai-data-grid { grid-template-columns: 1fr 1fr; }
  .hai-sidebar { padding-top: 0; }
}
