/* ============================================================
   learn-article.css
   Base styles shared across ALL 9 /learn/ article pages.
   Link on every article — this is the only required file.

   <link rel="stylesheet" href="/assets/css/learn-article.css">
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --accent:    #F5C542;
  --accent-dk: #C9A020;
  --blue:      #1D4ED8;
  --ink:       #111827;
  --muted:     #6B7280;
  --bg:        #F9F7F4;
  --bg-card:   #FFFFFF;
  --border:    #E5E1DA;
}

/* ── Base ──────────────────────────────────────────────────── */
body { background: var(--bg); color: var(--ink); }
hr.rule { border: none; border-top: 1px solid var(--border); }

/* ── Article Hero ──────────────────────────────────────────── */
.article-hero {
  background: var(--ink); color: #fff;
  padding: 60px 0 52px;
  position: relative; overflow: hidden;
}
.article-hero::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -55deg, transparent, transparent 40px,
    rgba(255,255,255,.025) 40px, rgba(255,255,255,.025) 41px
  );
}
.article-hero-inner { position: relative; z-index: 2; }

/* Standard yellow category badge */
.article-category {
  display: inline-block;
  background: rgba(245,197,66,.15); color: var(--accent);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 4px; margin-bottom: 16px;
}

/* Red category badge — BMI / health articles */
.cat-badge {
  display: inline-block;
  background: rgba(220,38,38,.15); color: #FCA5A5;
  border: 1px solid rgba(220,38,38,.3);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 4px; margin-bottom: 16px;
  text-decoration: none;
}

.article-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800; line-height: 1.2;
  letter-spacing: -.02em; margin-bottom: 16px;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: .8rem; color: rgba(255,255,255,.55);
}
.article-meta span { display: flex; align-items: center; gap: 5px; }

/* ── Article Body ──────────────────────────────────────────── */
.article-body { font-size: 1rem; line-height: 1.85; color: #1f2937; }
.article-body h2 {
  font-size: 1.4rem; font-weight: 800; color: var(--ink);
  margin: 2.5rem 0 1rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}
.article-body h3 {
  font-size: 1.1rem; font-weight: 700;
  color: var(--ink); margin: 1.8rem 0 .75rem;
}
.article-body p { margin-bottom: 1.25rem; }
.article-body ul,
.article-body ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: .5rem; }
.article-body strong { color: var(--ink); }
.article-body a { color: var(--blue); text-decoration: underline; }
.article-body a:hover { color: #1e40af; }

/* ── Callout Boxes ─────────────────────────────────────────── */
/* All 7 colour variants present across the 9 articles */
.callout {
  border-radius: 10px; padding: 20px 24px;
  margin: 2rem 0; border-left: 4px solid;
}
.callout-blue   { background: #eff6ff; border-color: #3b82f6; }
.callout-yellow { background: #fefce8; border-color: var(--accent); }
.callout-green  { background: #f0fdf4; border-color: #22c55e; }
.callout-red    { background: #fef2f2; border-color: #ef4444; }
.callout-purple { background: #f5f3ff; border-color: #8b5cf6; }  /* percentage */
.callout-teal   { background: #f0fdfa; border-color: #14b8a6; }  /* molarity  */
.callout-orange { background: #fff7ed; border-color: #f97316; }  /* electric  */

.callout-title {
  font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px;
}
.callout-blue   .callout-title { color: #2563eb; }
.callout-yellow .callout-title { color: #92400e; }
.callout-green  .callout-title { color: #15803d; }
.callout-red    .callout-title { color: #b91c1c; }
.callout-purple .callout-title { color: #7c3aed; }
.callout-teal   .callout-title { color: #0f766e; }
.callout-orange .callout-title { color: #c2410c; }
.callout p { margin-bottom: 0; font-size: .92rem; }

/* ── Data Table ────────────────────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse;
  margin: 1.5rem 0; font-size: .875rem;
}
.data-table th {
  background: var(--ink); color: #fff;
  padding: 10px 14px; text-align: left;
  font-weight: 600; font-size: .8rem;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:nth-child(even) td { background: #f9fafb; }
.data-table tr:last-child td { border-bottom: none; }
.highlight-row td { background: #fefce8 !important; font-weight: 700; }
/* Electric consumption row colour variants */
.high-cost td { background: #fef2f2 !important; }
.low-cost  td { background: #f0fdf4 !important; }
/* 13th month pay yes/no cell helpers */
.yes { color: #15803d; font-weight: 700; }
.no  { color: #b91c1c; font-weight: 700; }

/* ── Key Number Cards ──────────────────────────────────────── */
/* Used by: finance x3, ohm, molarity */
.key-number {
  text-align: center; padding: 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--border); border-radius: 12px;
}
.key-number .num {
  font-size: 2rem; font-weight: 800;
  color: var(--blue); line-height: 1;
}
.key-number .label { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ── Sidebar Cards ─────────────────────────────────────────── */
.sidebar-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 24px;
}
/* h3 — all articles except BMI */
.sidebar-card h3 {
  font-size: .75rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
/* h4 — BMI article uses h4 instead */
.sidebar-card h4 {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

/* ── CTA Box ───────────────────────────────────────────────── */
.cta-box {
  background: var(--ink); color: #fff;
  border-radius: 12px; padding: 28px;
  text-align: center; margin-bottom: 24px;
}
.cta-box h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.cta-box p  { font-size: .85rem; color: rgba(255,255,255,.6); margin-bottom: 16px; }
.btn-cta {
  display: inline-block;
  background: var(--accent); color: var(--ink);
  font-weight: 700; font-size: .875rem;
  padding: 10px 22px; border-radius: 7px;
  text-decoration: none; transition: background .2s;
}
.btn-cta:hover { background: var(--accent-dk); color: var(--ink); }

/* ── Related Article Cards ─────────────────────────────────── */
.related-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px;
  text-decoration: none; color: inherit; display: block;
  transition: box-shadow .2s, transform .2s; height: 100%;
}
.related-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  transform: translateY(-3px); color: inherit;
}
.related-cat {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 8px; display: block;
}
.related-card h4 {
  font-size: .95rem; font-weight: 700;
  color: var(--ink); line-height: 1.4; margin-bottom: 8px;
}
.related-card p { font-size: .8rem; color: var(--muted); line-height: 1.6; margin-bottom: 0; }

/* ── BMI: sidebar TOC links ────────────────────────────────── */
.toc-link {
  display: block; font-size: .85rem; color: var(--muted);
  text-decoration: none; padding: 5px 0 5px 12px;
  border-left: 2px solid transparent; transition: all .2s;
}
.toc-link:hover { color: var(--blue); border-color: var(--blue); }

/* ── BMI: sidebar related post list ───────────────────────── */
.related-post {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.related-post:last-child { border-bottom: none; }
.related-post-icon {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.related-post-title { font-size: .83rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.related-post-title:hover { color: var(--blue); }

/* ── BMI: tag pills ────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  border: 1.5px solid var(--border); font-size: .75rem; font-weight: 500;
  color: var(--muted); text-decoration: none; margin: 3px; transition: all .2s;
}
.tag:hover { border-color: var(--accent); color: var(--ink); }

/* ── BMI: author card ──────────────────────────────────────── */
.author-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 24px;
  display: flex; gap: 18px; align-items: flex-start;
  margin: 48px 0 32px;
}
.author-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #F97316);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.author-name { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.author-bio  { font-size: .82rem; color: var(--muted); line-height: 1.6; }

/* ── BMI: related calculators chip block ───────────────────── */
.related-calcs {
  background: var(--ink); border-radius: 12px;
  padding: 28px 32px; margin: 48px 0;
}
.related-calcs h3 { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.calc-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff; padding: 8px 16px; border-radius: 8px;
  text-decoration: none; font-size: .85rem; font-weight: 500;
  margin: 4px; transition: background .2s;
}
.calc-chip:hover { background: rgba(245,197,66,.15); color: var(--accent); }