/* ALT AFRIKANER — publication-wide readable contrast layer, 2026-10-21.
 * Loaded AFTER existing dossier themes. Applies only to the published
 * investigation pages; preserves data, diagrams and color-coded status labels.
 * WCAG AA target: body copy >= 4.5:1, large headings >= 3:1.
 */
body.aa-premium{
  --aa-on-paper:#253548;
  --aa-subtle-on-paper:#4d5c6a;
  --aa-on-ink:#f4eee5;
  --aa-subtle-on-ink:#dfd5c8;
  --aa-paper-field:#fffdfa;
  --aa-ink-field:#15253b;
}

/* Anchor contrast/keyboard navigation everywhere. */
body.aa-premium :is(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid #b78a42;outline-offset:3px;
}
body.aa-premium .aa-page-links,body.aa-premium .aa-page-links :is(p,small,span){
  color:var(--aa-on-paper);
}
body.aa-premium .aa-page-links a{color:#7b111b}

/* Shared *light* article and document regions. Limit to text-bearing
 * wrappers: a broad section p override would damage dark evidence panels. */
body.aa-premium :is(.ctx-card,.ctx-full,.provenance,.legal-box,.light-panel,.light-card,
  .dossier-wrap,.finding:not(.on-dark),.tl-ev .c,.gls,.src,.context-box.light,
  .prose-sec .prose,.section .intro,.section-lede,.section .lede)
  :is(p,li,td,blockquote,small){
  color:var(--aa-on-paper);
}
body.aa-premium :is(.ctx-card,.ctx-full,.provenance,.legal-box,.light-panel,.light-card,
  .dossier-wrap,.tl-ev .c,.gls,.src) :is(h2,h3,h4,strong){
  color:#172b44;
}
body.aa-premium :is(.ctx-card,.ctx-full,.provenance,.legal-box,.light-panel,.light-card,.src)
  :is(.sub,.desc,.muted,.caption,.role){color:var(--aa-subtle-on-paper)}

/* Dark information plates, charts and network modules: avoid using the
 * light-section rule on embedded diagram cards. */
body.aa-premium :is(.viz-panel,.network-wrap,.map-wrap,.map-3d .map-legend,.dash,
  .dark-panel,.dark-card,.dark-section,.figure.dark,.graph-panel,.finding-card,
  .entity-card,.pipe-node,.flow-node,.criterion-card,.concept-box,.method-card,
  .table-container,.legal-box.dark,.hero) :is(p,li,td,blockquote,small){
  color:var(--aa-on-ink);
}
body.aa-premium :is(.viz-panel,.network-wrap,.map-wrap,.dash,.dark-panel,.dark-card,
  .dark-section,.finding-card,.entity-card,.pipe-node,.flow-node,.criterion-card,
  .concept-box,.method-card,.table-container) :is(.desc,.sub,.caption,.muted,.role){
  color:var(--aa-subtle-on-ink);
}

/* REAL411: reproduce and correct the reported white-on-ivory table and
 * the IEC explainer. Original dark-theme table styles were being inherited
 * inside the new ivory editorial layout. */
body.aa-premium--real411 #whorunsit .data-table,
body.aa-premium--real411 #whorunsit .data-table tbody{
  background:#fffdfa;color:#253548;
}
body.aa-premium--real411 #whorunsit .data-table th{
  background:#1b2a4a!important;color:#fff2dc!important;
  border-bottom:2px solid #9a753a;font-weight:700;
}
body.aa-premium--real411 #whorunsit .data-table td,
body.aa-premium--real411 #whorunsit .data-table td:first-child,
body.aa-premium--real411 #whorunsit .data-table td.sv,
body.aa-premium--real411 #whorunsit .data-table td.su,
body.aa-premium--real411 #whorunsit .data-table td.sp{
  color:#23344a!important;background:#fffdfa!important;
  border-bottom:1px solid #c4bdaf;font-weight:500;
}
body.aa-premium--real411 #whorunsit .data-table tr:nth-child(even) td{
  background:#f0ece4!important;
}
body.aa-premium--real411 #whorunsit .data-table tbody tr:hover td{
  background:#e4ebf0!important;
}
body.aa-premium--real411 #whorunsit .data-table td:first-child{
  font-weight:700;color:#172c47!important;
}
body.aa-premium--real411 #whorunsit .iec-box{
  background:#fffdfa!important;border:1px solid #aaacb0!important;
  border-left:4px solid #8b0000!important;box-shadow:none;
}
body.aa-premium--real411 #whorunsit .iec-box :is(p,li,small),
body.aa-premium--real411 #whorunsit .iec-box p strong{
  color:#253548!important;
}
body.aa-premium--real411 #whorunsit .iec-box h3{
  color:#1b2a4a!important;
}
body.aa-premium--real411 #whorunsit > .container > p,
body.aa-premium--real411 #whorunsit > .container > h3{
  color:#253548!important;
}
body.aa-premium--real411 #whorunsit > .container > p strong{color:#142b45!important}

/* Editorial explanations on warm paper, without disturbing dark infographics. */
body.aa-premium--splc section:not(.hero):not(#map) > .container > :is(p,ul,ol),
body.aa-premium--real411 section:not(.hero) > .container > :is(p,ul,ol),
body.aa-premium--wits section:not(.hero) .prose,
body.aa-premium--constitution .section > p,
body.aa-premium--fwdeklerk article > p,
body.aa-premium--cws .section:not([style*="background:var(--navy)"]) .prose,
body.aa-premium--omidyar main .section > p,
body.aa-premium--funding-atlas section:not(.hero) > .section-inner > p{
  color:#27384a!important;
}
body.aa-premium--splc section:not(.hero):not(#map) > .container > p strong,
body.aa-premium--real411 section:not(.hero) > .container > p strong{
  color:#142940!important;
}

/* Original article-based dossiers: prose blocks should inherit legible
 * paper text even if original dark palette supplied low-contrast colors. */
body.aa-premium :is(.sec,.section,.ctx-section,.prose-sec,.article,.reading-section)
 > :is(p,.intro,.lede,.section-lede){
 color:#283b4e;
}

/* Keep native high-contrast and forced-color modes working. */
@media(forced-colors:active){
  body.aa-premium .data-table :is(td,th),
  body.aa-premium .iec-box :is(p,h3),
  body.aa-premium :is(.dark-card,.light-card) p{
    color:CanvasText!important;background:Canvas!important;
  }
}

/* Evidence-linked expansions: editorial paper, not inherited dark-text palette. */
body.aa-premium .aa-evidence-context{
 background:#f7f4ec!important;color:#26384a!important;
 border-block:2px solid #d6c9b8;padding:72px clamp(20px,4vw,50px);
 font:400 18px/1.83 'Source Sans 3',system-ui,sans-serif;
}
body.aa-premium .aa-evidence-inner{max-width:860px;margin:0 auto}
body.aa-premium .aa-evidence-context .aa-evidence-kicker{
 font:700 11px/1.5 'JetBrains Mono',monospace;letter-spacing:.13em;
 color:#8b0000!important;text-transform:uppercase;margin-bottom:15px;
}
body.aa-premium .aa-evidence-context h2{
 color:#1b2a4a!important;font:700 clamp(31px,3.5vw,46px)/1.19 'Playfair Display',Georgia,serif;
 letter-spacing:-.025em;margin:0 0 27px;
}
body.aa-premium .aa-evidence-context h3{
 color:#1b2a4a!important;font:700 clamp(22px,2.4vw,30px)/1.3 'Playfair Display',Georgia,serif;
 margin:37px 0 16px;
}
body.aa-premium .aa-evidence-context p{
 color:#293b4c!important;font:400 clamp(17px,1.5vw,19px)/1.85 'Source Sans 3',system-ui,sans-serif;
 margin:0 0 23px;max-width:860px;
}
body.aa-premium .aa-evidence-context p strong{color:#152b44!important}
body.aa-premium .aa-evidence-context a{color:#7b101a!important;text-underline-offset:3px;text-decoration:underline}
body.aa-premium .aa-evidence-context .aa-evidence-sources{
 background:#eee8dd;color:#34485a!important;border-left:4px solid #8b0000;
 padding:20px 24px;font:400 15px/1.75 'Source Sans 3',sans-serif;margin-top:35px
}
body.aa-premium .aa-evidence-context .aa-evidence-sources strong{color:#1b2a4a}
body.aa-premium .aa-evidence-status{
 max-width:1050px;padding:16px 21px;margin:0 0 26px;
 border-left:4px solid #8b0000;border:1px solid #b99791;border-left-width:4px;
 background:#fff9ee;color:#2c3a49!important;
 font:500 15px/1.65 'Source Sans 3',sans-serif;
}
body.aa-premium .aa-evidence-status strong{color:#78151d!important}
@media(max-width:650px){
 body.aa-premium .aa-evidence-context{padding:48px 19px}
 body.aa-premium .aa-evidence-context h2{font-size:32px}
 body.aa-premium .aa-evidence-context .aa-evidence-sources{padding:16px}
}

/* Date-stamped corrections: light, clearly legible, distinct from original archive text. */
body.aa-premium .aa-factual-update{
 background:#fffdfa!important;color:#253749!important;
 border:1px solid #d9c9b7;border-left:5px solid #8b0000;
 max-width:1140px;margin:38px auto;padding:clamp(25px,4vw,48px);
 box-shadow:0 8px 25px rgba(24,38,57,.055);
}
body.aa-premium .aa-update-inner{max-width:890px;margin:0 auto}
body.aa-premium .aa-update-kicker{
 color:#7b101b!important;font:700 11px/1.6 'JetBrains Mono',monospace;
 letter-spacing:.12em;text-transform:uppercase;margin-bottom:12px;
}
body.aa-premium .aa-factual-update h2,
body.aa-premium .aa-factual-update h3{
 color:#1b2a4a!important;font:700 clamp(24px,3vw,39px)/1.21 'Playfair Display',Georgia,serif;
 margin-bottom:22px;
}
body.aa-premium .aa-factual-update .aa-update-copy{
 color:#26384a!important;font:400 clamp(16px,1.4vw,18px)/1.82 'Source Sans 3',sans-serif;
 margin:0 0 21px;
}
body.aa-premium .aa-factual-update .aa-update-copy strong{color:#192d43!important}
body.aa-premium .aa-factual-update a{
 color:#83121c!important;text-decoration:underline;text-underline-offset:3px;
}
body.aa-premium--splc section.aa-factual-update{border-left:5px solid #8b0000!important}
@media(max-width:620px){body.aa-premium .aa-factual-update{margin:25px 14px;padding:24px 20px}}

body.aa-premium .aa-evidence-context .aa-evidence-copy{color:#293b4c!important;font:400 clamp(17px,1.5vw,19px)/1.85 'Source Sans 3',system-ui,sans-serif;margin:0 0 23px;max-width:860px}
body.aa-premium .aa-evidence-context .aa-evidence-copy strong{color:#152b44!important}


/* 2026-10-21: journalist 3D section sits on cream, not navy. */
body.aa-premium--journalists #map-section :is(.f-label,.ftxt,.ctxt){
 color:#253548!important;font-size:clamp(11px,1.1vw,13px);letter-spacing:.03em;
}
body.aa-premium--journalists #map-section .fbtn{
 color:#26364b!important;background:#fffdfa;border:1px solid #99886d;
 font-size:11px;letter-spacing:.06em;font-weight:700;min-height:36px;
}
body.aa-premium--journalists #map-section .fbtn.active{
 background:#1b2a4a;color:#fff!important;border-color:#1b2a4a;
}
body.aa-premium--journalists #map-section .fbtn:hover{
 background:#e6d9c5;color:#17263a!important;border-color:#6a5638;
}
body.aa-premium--journalists #map-section .filter-bar,
body.aa-premium--journalists #map-section .conn-legend{
 gap:10px 12px;row-gap:12px;
}
body.aa-premium--journalists #map-section .filter-legend{
 margin-left:0;gap:9px 14px;
}
body.aa-premium--journalists #map-section .fleg .fdot{
 border:1px solid #3f5062;width:11px;height:11px;
}
body.aa-premium--journalists #map-section .container p,
body.aa-premium--journalists #map-section > .container p{
 color:#304051!important;
}
body.aa-premium--journalists #map-section .nl .nm{
 color:#fff!important;text-shadow:0 1px 5px #000;
}
body.aa-premium--journalists #map-section .filter-bar{
 border-bottom:1px solid #c6b9a6;
}
@media(max-width:720px){
 body.aa-premium--journalists #map-section .fbtn{font-size:11px;padding:8px 10px}
 body.aa-premium--journalists #map-section .filter-legend{width:100%}
}


/* Contrast contract — 2026-10-23.
   These boxes inherit pale text intended for navy but are painted onto
   light editorial paper by the premium theme. Establish explicit foreground
   AND background pairs instead of attempting to brighten every muted token. */
body.aa-premium--funding-atlas :is(.cf-box,.stacked-box){
 background:#fffdfa!important;color:#253548!important;
 border:1px solid #cfc6b9!important;border-left-width:4px!important;
 box-shadow:0 4px 20px rgba(23,37,55,.06);
}
body.aa-premium--funding-atlas .cf-box{border-left-color:#1a6941!important}
body.aa-premium--funding-atlas .stacked-box{border-left-color:#6636a4!important}
body.aa-premium--funding-atlas .cf-box h3,
body.aa-premium--funding-atlas .cf-box strong{color:#175334!important}
body.aa-premium--funding-atlas .stacked-box h3,
body.aa-premium--funding-atlas .stacked-box strong{color:#58308b!important}
body.aa-premium--funding-atlas :is(.cf-box,.stacked-box) :is(p,li,small,span){
 color:#293a4b!important;
}
body.aa-premium--funding-atlas :is(.cf-box,.stacked-box) a{
 color:#79202a!important;text-decoration:underline;text-underline-offset:2px;
}
body.aa-premium--funding-atlas .cf-chain{
 background:#edf4ef!important;color:#123f2a!important;border:1px solid #b8cfc0;
 font-size:clamp(12px,1.1vw,14px);line-height:1.8;overflow-wrap:anywhere;
}
body.aa-premium--funding-atlas .stacked-example{
 background:#f1eaf7!important;color:#3f256a!important;border:1px solid #d2c1e6;
 font-size:clamp(12px,1.1vw,14px);line-height:1.8;overflow-wrap:anywhere;
}
body.aa-premium--funding-atlas :is(.cf-chain,.stacked-example) :is(span,strong,a){
 color:inherit!important;
}
body.aa-premium--funding-atlas :is(.cf-box,.stacked-box) [style*="color:#55aa77"]{
 color:#175334!important;
}
/* Common light-panel evidence and chart notes: enforce readable ink on light surfaces. */
body.aa-premium :is(.aa-factual-update,.aa-evidence-context,.aa-evidence-sources,.aa-page-links,.light-panel,.light-card)
 :is(pre,code,.caption,.note,.small,.sub,.meta){
 color:#27384b;
}
body.aa-premium :is(.aa-factual-update,.aa-evidence-context,.aa-evidence-sources,.light-panel,.light-card)
 :is(pre,code){background:#ede8de;overflow-wrap:anywhere;white-space:pre-wrap}
/* Explicit focus treatment for evidence links and interactive filters. */
body.aa-premium :is(a,button,input,select,textarea):focus-visible{
 outline:3px solid #97500b!important;outline-offset:3px;
}
@media(max-width:740px){
 body.aa-premium--funding-atlas :is(.cf-box,.stacked-box){padding:20px 16px}
}


/* Light OSF/Omidyar funding atlas: USAID note and section introductions. */
body.aa-premium--funding-atlas .usaid-note{
 background:#fffdfa!important;color:#253548!important;
 border:1px solid #c5d0dc!important;border-left:4px solid #285d91!important;
 font-size:clamp(15px,1.25vw,17px)!important;line-height:1.75!important;
}
body.aa-premium--funding-atlas .usaid-note :is(strong,b){
 color:#1b4879!important;
}
body.aa-premium--funding-atlas .usaid-note :is(a,.xlink){
 color:#7d2028!important;text-decoration:underline!important;text-underline-offset:3px;
}
body.aa-premium--funding-atlas #omidyar-orgs>.section-inner>p{
 color:#334456!important;font-size:clamp(16px,1.35vw,18px)!important;line-height:1.78;
}
body.aa-premium--funding-atlas #omidyar-orgs>.section-inner>p .xlink{
 color:#85202b!important;
}


/* Evidence-led whole-archive pass: legacy inline light labels on ivory sections. */
body.aa-premium--funding-atlas section:not(.hero) > .section-inner > p[style*="color:rgba(244,240,232"]{
 color:#304252!important;
 font-size:clamp(16px,1.3vw,18px);
 line-height:1.78;
}
body.aa-premium--funding-atlas section:not(.hero) > .section-inner > p[style*="color:rgba(244,240,232"] a{
 color:#79222a!important;text-decoration:underline;
}
body.aa-premium--funding-atlas section:not(.hero) :is(.usaid-note,.cf-box,.stacked-box) :is(.xlink,a):focus-visible{
 outline:3px solid #8b4215;outline-offset:3px;
}
/* Text in premium article information regions must not inherit dark-map white. */
body.aa-premium--funding-atlas :is(.cf-box,.stacked-box,.usaid-note) :is(code,pre){
 color:#203448!important;overflow-wrap:anywhere;white-space:pre-wrap;
}

/* Omidyar: ivory paper must never inherit the earlier dark-theme cream text.
   The primer had an inline pale text colour, overriding its redesigned panel. */
body.aa-premium--omidyar main #primer{
 background:#fffdf9!important;color:#263749!important;
}
body.aa-premium--omidyar main #primer > div:not(.dark-panel):not(.entity-card),
body.aa-premium--omidyar main #primer > div:not(.dark-panel):not(.entity-card) p,
body.aa-premium--omidyar main #primer > div:not(.dark-panel):not(.entity-card) li{
 color:#263749!important;font-size:clamp(16px,1.25vw,18px)!important;
 line-height:1.78!important;
}
body.aa-premium--omidyar main #primer .section-eyebrow,
body.aa-premium--omidyar main #primer p strong[style*="color:var(--gold)"]{
 color:#8b271b!important;
}
body.aa-premium--omidyar main #primer p strong:not([style*="color:var(--gold)"]){
 color:#172b44!important;
}
body.aa-premium--omidyar main #primer a{color:#802029!important;text-decoration:underline!important;text-underline-offset:3px}
body.aa-premium--omidyar main #primer a:visited{color:#66345f!important}
body.aa-premium--omidyar main #primer a:focus-visible{outline:3px solid #ad651a!important;outline-offset:3px}
body.aa-premium--omidyar .wrap > aside#toc a{color:#33485d!important}
body.aa-premium--omidyar .wrap > aside#toc a:hover{color:#812029!important}
/* All ivory dossier cards: subtle metadata and captions require legible ink. */
body.aa-premium--omidyar main .section:not(.dark-section)
 > :is(p,.intro,.section-eyebrow,small){color:#354657!important}
