/* ==========================================================================
   PIPELINE CONTENT LAYER — learncbse.net (2026-07-10)
   Styles for every HTML element/class the content pipeline emits, audited
   from pipeline/cli.py + wp.py + gates.py + templates/. Scoped to article
   content; token-driven (uses main.css :root vars). Mobile-first (RULES §11):
   nothing here may cause page-level horizontal scroll.
   CONTRACT: any new pipeline-emitted class ships with a rule here in the
   same change — see the repo skill .claude/skills/front-design/SKILL.md.
   ========================================================================== */

/* ---------- Reading rhythm (readability law, RULES §2) ------------------- */
.ink-article-content { font-size: 1.02rem; line-height: 1.72; }
.ink-article-content p { margin: 0 0 1.05em; }
.ink-article-content h2 {
  margin: 2em 0 .7em; padding-top: .35em; line-height: 1.25;
  font-weight: 700; scroll-margin-top: 90px;   /* TOC anchor jumps clear the sticky header */
}
.ink-article-content h2::after {
  content: ""; display: block; width: 56px; height: 3px; margin-top: 10px;
  background: var(--primary); border-radius: 2px; opacity: .85;
}
.ink-article-content h3 { margin: 1.5em 0 .5em; line-height: 1.3; font-weight: 700; scroll-margin-top: 90px; }
.ink-article-content ul, .ink-article-content ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.ink-article-content li { margin: .35em 0; }
.ink-article-content li::marker { color: var(--primary); font-weight: 600; }
.ink-article-content strong { color: var(--ink); }
.ink-article-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ---------- Table of contents (<nav class="lcbse-toc ce-toc">) -----------
   OWNER DECISION 2026-07-10 (v2.2.1): the TOC keeps its PREVIOUS rendering —
   the v2.2.0 card restyle was reviewed and reverted. Do not restyle the TOC
   without an explicit owner request. */

/* ---------- Tables: scroll shell + data styling --------------------------
   Every content table sits inside .lcbse-table-scroll (pipeline emits it;
   functions.php normalizes strays) — the §11 no-horizontal-overflow law. */
.lcbse-table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 1.3em 0; border-radius: var(--radius-sm);
}
.lcbse-table-scroll > table { margin: 0; min-width: 480px; }
.ink-article-content td { font-variant-numeric: tabular-nums; }

/* Exam-footprint / weightage tables (PYQ + cluster stats) */
.lcbse-weightage thead th { background: var(--primary-l); color: var(--primary-d); }
.lcbse-weightage tbody tr:hover { background: var(--surface); }

/* ---------- PYQ year tag chip ("(CBSE 2024, Set 1, 3 marks)") ------------ */
.lcbse-pyq-tag {
  display: inline-block; font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: .78rem; font-weight: 500; color: var(--primary-d);
  background: var(--primary-l); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 2px 10px; margin: 0 0 .4em;
  white-space: nowrap;
}

/* ---------- Solution / answer blocks ------------------------------------- */
.icse-solution-answer, .lcbse-solution-answer {
  background: var(--paper-card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--radius-sm);
  padding: 14px 18px; margin: .6em 0 1.6em;
}
.icse-solution-answer > p:first-child, .lcbse-solution-answer > p:first-child { margin-top: 0; }
.icse-solution-answer > p:last-child, .lcbse-solution-answer > p:last-child { margin-bottom: 0; }

/* ---------- FAQ accordions (<details class="lcbse-faq">) ------------------
   The pipeline emits lcbse-faq; icse-faq-item (older pages) stays aliased. */
details.lcbse-faq {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper-card); overflow: hidden; margin: 0 0 10px;
}
details.lcbse-faq > summary {
  list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600;
  color: var(--ink); display: flex; align-items: center;
  justify-content: space-between; gap: 12px; min-height: 44px;   /* tap target */
}
details.lcbse-faq > summary::-webkit-details-marker { display: none; }
details.lcbse-faq > summary::after {
  content: "+"; font-size: 1.3rem; line-height: 1; color: var(--primary);
  transition: transform .2s; flex: none;
}
details.lcbse-faq[open] > summary { color: var(--primary-d); border-bottom: 1px solid var(--line); }
details.lcbse-faq[open] > summary::after { transform: rotate(45deg); }
details.lcbse-faq > *:not(summary) { padding: 0 18px; }
details.lcbse-faq > p:last-child, details.lcbse-faq > div:last-child { padding-bottom: 14px; }
details.lcbse-faq > summary + * { padding-top: 12px; }

/* ---------- Cluster / silo navigation footer ------------------------------
   <div class="lcbse-silo-nav"> — reverse chain, prev/next, related, cluster. */
.lcbse-silo-nav {
  margin: 2.6em 0 0; padding: 20px 20px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.lcbse-silo-nav h2 { margin: 0 0 .8em; font-size: 1.1rem; }
.lcbse-silo-nav h2::after { display: none; }
.lcbse-silo-nav ul { list-style: none; margin: 0 0 .6em; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lcbse-silo-nav li { margin: 0; }
.lcbse-silo-nav a, .lcbse-silo-nav span[data-lcbse-pending-link] {
  display: inline-block; padding: 8px 14px; min-height: 44px; line-height: 1.9;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-pill); font-size: .9rem; font-weight: 600;
  color: var(--primary-d); text-decoration: none;
}
.lcbse-silo-nav a:hover { border-color: var(--primary); background: var(--primary-l); }
.lcbse-silo-nav span[data-lcbse-pending-link] { color: var(--muted); font-weight: 500; }

/* ---------- Figures + MathJax (overflow-safe, §11) ------------------------ */
.ink-article-content figure { margin: 1.6em 0; text-align: center; }
.ink-article-content figcaption {
  font-size: .86rem; color: var(--muted); margin-top: 8px;
}
mjx-container { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
mjx-container[display="true"] { padding: 4px 0; }

/* ---------- Generic details inside content (not FAQ, not theme UI) -------- */
.ink-article-content details:not(.lcbse-faq):not([class]) {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; margin: 0 0 1em; background: var(--paper-card);
}

/* ---------- Mobile refinements (§11: phone first) -------------------------- */
@media (max-width: 640px) {
  .ink-article-content { font-size: 1rem; }
  .ink-article-content table { font-size: .9rem; }
  .ink-article-content th, .ink-article-content td { padding: 9px 10px; }
  .lcbse-silo-nav a, .lcbse-silo-nav span[data-lcbse-pending-link] { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  details.lcbse-faq > summary::after { transition: none; }
}
