/* ══════════════════════════════════════════════════════════
   SagarmathaIQ: Document-analysis article components
   Reusable layer for PDF / document-comparison forensics pieces.
   Load AFTER sagarmathaiq.css. Every colour resolves from the shared
   design tokens (--bg, --ink*, --rule*, --c-*) so light + dark both
   work with no per-page dark block. Tinted backgrounds use color-mix
   so they lighten on white and darken on the slate background.
   ══════════════════════════════════════════════════════════ */

/* ── Article shell (editorial serif, narrower measure) ── */
.article {
  max-width: 960px;
  padding: 2.5rem 1.5rem 4rem;
  font-family: var(--serif);
}

/* ── Lede ── */
.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: 0.9rem;
}

.headline {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 700px;
  margin: 0 0 1.2rem;
}

.standfirst {
  font-family: var(--sans);
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--ink-mid);
  background: var(--bg-tint);
  border-left: 3px solid var(--c-navy);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-light);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin-bottom: 2rem;
}

.meta strong {
  color: var(--ink);
}

/* ── Hero stat strip ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  border: 1px solid var(--rule-dark);
  margin-bottom: 2.5rem;
  background: var(--bg);
}

.stat-cell {
  padding: 0.85rem 0.9rem 0.8rem;
  border-right: 1px solid var(--rule-dark);
}

.stat-cell:last-child {
  border-right: none;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}

.stat-val {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.stat-val.red {
  color: var(--c-red);
}

.stat-val.amber {
  color: var(--c-amber);
}

.stat-val.green {
  color: var(--c-green);
}

.stat-note {
  font-family: var(--sans);
  font-size: 0.67rem;
  color: var(--ink-light);
  line-height: 1.35;
}

/* ── Section heading ── */
.sh {
  font-family: var(--sans);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.38rem;
  margin: 2.5rem 0 1.2rem;
}

/* ── Prose ──
   Fill the article column (overrides the shared .prose 760px cap) so prose
   aligns to the same left/right edges as the cards, tables and method boxes —
   keeps every tab panel a consistent width. */
.prose {
  max-width: none;
}
.prose p {
  font-family: var(--serif);
  font-size: 0.94rem;
  color: var(--ink-mid);
  line-height: 1.76;
  margin-bottom: 1rem;
  max-width: none;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ── Provision diff cards ──
   Highlighted: thick colour-keyed left edge, a filled colour header band per
   verdict type, a bold prominent title, and a solid filled verdict badge.
   Uses only the existing semantic colours (amber=added, red=omitted,
   green=clerical, grey=no-difference). */
.provision {
  border: 1px solid var(--rule-dark);
  border-left-width: 5px;
  margin-bottom: 1.6rem;
  background: var(--bg);
  overflow: hidden;
}

.provision.added {
  border-left-color: var(--c-amber);
}
.provision.omitted {
  border-left-color: var(--c-red);
}
.provision.clerical {
  border-left-color: var(--c-green);
}
.provision.same {
  border-left-color: var(--rule-dark);
}

.prov-header {
  padding: 0.85rem 1.1rem 0.72rem 1.2rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Filled, colour-keyed header band per verdict type */
.provision.added .prov-header {
  background: color-mix(in srgb, var(--c-amber) 13%, var(--bg));
  border-bottom-color: color-mix(in srgb, var(--c-amber) 30%, var(--bg));
}
.provision.omitted .prov-header {
  background: color-mix(in srgb, var(--c-red) 13%, var(--bg));
  border-bottom-color: color-mix(in srgb, var(--c-red) 30%, var(--bg));
}
.provision.clerical .prov-header {
  background: color-mix(in srgb, var(--c-green) 13%, var(--bg));
  border-bottom-color: color-mix(in srgb, var(--c-green) 30%, var(--bg));
}
.provision.same .prov-header {
  background: var(--bg-tint);
}

.prov-title {
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.prov-badge {
  font-family: var(--mono);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.26rem 0.6rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Solid filled badges so the verdict reads at a glance.
   color: var(--bg) flips to white on light, near-black on dark. */
.prov-badge.added {
  background: var(--c-amber);
  color: var(--bg);
}
.prov-badge.omitted {
  background: var(--c-red);
  color: var(--bg);
}
.prov-badge.clerical {
  background: var(--c-green);
  color: var(--bg);
}
.prov-badge.same {
  background: var(--bg-chip);
  color: var(--ink-light);
}

.prov-body {
  padding: 0.9rem 1.2rem 1rem;
}

.prov-body p {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.72;
  margin-bottom: 0.7rem;
}

.prov-body p:last-child {
  margin-bottom: 0;
}

/* ── Side-by-side PDF excerpt boxes ── */
.pdf-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.pdf-box {
  border: 1px solid var(--rule);
  padding: 0.65rem 0.8rem;
  background: var(--bg);
}

.pdf-box-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.pdf-box-text {
  font-family: var(--mukta, "Mukta", sans-serif);
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.6;
}

.pdf-box.parliament {
  border-left: 3px solid var(--c-navy);
}

.pdf-box.mof {
  border-left: 3px solid var(--c-amber);
}

.pdf-box.absent {
  background: var(--bg-tint);
}

.pdf-box.absent .pdf-box-text {
  color: var(--ink-faint);
  font-style: italic;
  font-family: var(--sans);
  font-size: 0.8rem;
}

/* ── Budget-speech tags ── */
.speech-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  letter-spacing: 0.04em;
  margin: 0.4rem 0 0.2rem;
}

.speech-yes {
  background: color-mix(in srgb, var(--c-green) 18%, var(--bg));
  color: var(--c-green);
}

.speech-no {
  background: var(--bg-chip);
  color: var(--ink-light);
}

.speech-note {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-light);
  line-height: 1.5;
  margin-top: 0.3rem;
}

/* ── Metadata table ── */
.meta-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.78rem;
  margin: 1rem 0;
}

.meta-table th {
  background: var(--bg-tint);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 0.42rem 0.65rem;
  text-align: left;
  border: 1px solid var(--rule-dark);
}

.meta-table td {
  padding: 0.52rem 0.65rem;
  border: 1px solid var(--rule);
  color: var(--ink-mid);
  vertical-align: top;
  line-height: 1.45;
}

.meta-table td.flag {
  color: var(--c-red);
  font-weight: 600;
}

.meta-table td.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* ── Callout ──
   Fill the article column (overrides the shared .callout 720px cap) so callouts
   align to the same left/right edges as the prose, cards and tables. */
.callout {
  max-width: none;
  border-left: 3px solid var(--c-navy);
  background: color-mix(in srgb, var(--c-blue) 10%, var(--bg));
  padding: 0.78rem 1rem;
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--c-blue);
  line-height: 1.55;
  margin: 1.25rem 0;
}

.callout.red {
  border-color: var(--c-red);
  background: color-mix(in srgb, var(--c-red) 9%, var(--bg));
  color: var(--c-red);
}

.callout.amber {
  border-color: var(--c-amber);
  background: color-mix(in srgb, var(--c-amber) 9%, var(--bg));
  color: var(--c-amber);
}

.callout.green {
  border-color: var(--c-green);
  background: color-mix(in srgb, var(--c-green) 9%, var(--bg));
  color: var(--c-green);
}

/* ── Summary table + verdict badges ── */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.76rem;
  margin: 1rem 0;
}

.summary-table th {
  background: var(--bg-tint);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 0.45rem 0.65rem;
  text-align: left;
  border: 1px solid var(--rule-dark);
}

.summary-table td {
  padding: 0.52rem 0.65rem;
  border: 1px solid var(--rule);
  color: var(--ink-mid);
  vertical-align: top;
  line-height: 1.4;
}

.vbadge {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.14rem 0.4rem;
  white-space: nowrap;
}

.vb-red {
  background: color-mix(in srgb, var(--c-red) 18%, var(--bg));
  color: var(--c-red);
}

.vb-amber {
  background: color-mix(in srgb, var(--c-amber) 18%, var(--bg));
  color: var(--c-amber);
}

.vb-green {
  background: color-mix(in srgb, var(--c-green) 18%, var(--bg));
  color: var(--c-green);
}

.vb-grey {
  background: var(--bg-chip);
  color: var(--ink-light);
}

/* ── Methodology boxes ── */
.method-box {
  border: 1px solid var(--rule-dark);
  background: var(--bg-tint);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}

.method-box h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 0.6rem;
}

.method-box p {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-mid);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.method-box p:last-child {
  margin-bottom: 0;
}

.article code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-chip);
  padding: 0.1em 0.3em;
  color: var(--ink);
}

/* ── Bottom line ── */
.bottom-line {
  border-top: 2px solid var(--rule-strong);
  padding-top: 1.75rem;
  margin-top: 2.5rem;
}

.bottom-line h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.1rem;
  line-height: 1.28;
}

.bottom-line p {
  font-family: var(--serif);
  font-size: 0.94rem;
  color: var(--ink-mid);
  line-height: 1.76;
  margin-bottom: 0.9rem;
  max-width: none;
}

/* ── Article source footer ── */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

.article-footer p {
  margin: 0 0 0.5rem;
}

.article-footer a {
  color: var(--ink-light);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .article {
    padding: 1.5rem 1rem 3rem;
  }

  .stat-row {
    grid-template-columns: 1fr 1fr;
  }

  .prov-header {
    flex-direction: column;
  }
}

@media (max-width: 580px) {
  .pdf-compare {
    grid-template-columns: 1fr;
  }
}
