/* Africa Stablecoin Intelligence — Light / Dark / System.
   Light is the original look. Dark re-points the "page" palette; the dark bands (masthead, ticker, snapshot),
   footer and dark cards re-declare the original palette inside themselves, so they stay as designed. */

/* ---------- the switch ---------- */
.tc-theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-dark); border-radius: 999px; background: rgba(255,255,255,.04); }
.tc-theme-switch button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 999px; background: transparent; color: #b8b2a4; font: 500 .75rem var(--sans); cursor: pointer; line-height: 1; white-space: nowrap; }
.tc-theme-switch button svg { width: 14px; height: 14px; flex: none; }
.tc-theme-switch button:hover { color: #f3eee1; }
.tc-theme-switch button[aria-pressed="true"] { background: var(--brand); color: #1b1916; font-weight: 600; }
.tc-theme-switch.in-footer { margin-top: 14px; }

.tc-theme-cycle { display: none; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #b8b2a4; cursor: pointer; }
.tc-theme-cycle:hover { color: #f3eee1; background: var(--ink-2); }
.tc-theme-cycle svg { width: 18px; height: 18px; display: none; }
.tc-theme-cycle[data-mode="light"] .i-sun, .tc-theme-cycle[data-mode="dark"] .i-moon, .tc-theme-cycle[data-mode="system"] .i-auto { display: block; }

/* Header: the icon-only segmented switch from 761px; one cycling button on phones and small tablets. */
.mast-actions .tc-theme-switch button span { display: none; }
@media (min-width: 1280px) { .mast-actions .tc-theme-switch button span { display: inline; } }
@media (max-width: 760px) { .mast-actions .tc-theme-switch { display: none; } .tc-theme-cycle { display: grid; } }

/* ---------- dark palette ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f0e0c;
  --paper-deep: #1b1916;
  --ink: #f1ece0;
  --ink-soft: #b9b2a2;
  --line: #3a362e;
  --forest: #7fc29c;       /* links and accents on the dark page */
  --brand-ink: #ffa66b;    /* orange text on the dark page */
}
html[data-theme="light"] { color-scheme: light; }

/* Surfaces that are dark in both themes keep the original palette. */
html[data-theme="dark"] .dark-band,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .newsletter-box,
html[data-theme="dark"] .country-figure,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .story-body pre {
  --paper: #f3eee1; --paper-deep: #e8dfc7; --ink: #1b1916; --ink-2: #2a2723;
  --ink-soft: #5c574c; --line: #d7cba9; --forest: #2b5d45; --brand-ink: #a84d12;
}
/* ...but lift the cards a touch so they separate from the darker page. */
html[data-theme="dark"] .newsletter-box,
html[data-theme="dark"] .country-figure,
html[data-theme="dark"] .form-card { background: #1f1d19; border: 1px solid #34312b; }
html[data-theme="dark"] .site-footer { border-top: 1px solid #2a2723; }
html[data-theme="dark"] .dark-band.masthead { border-bottom: 1px solid #1f1d19; }

/* Hard-coded light colours on the page. */
html[data-theme="dark"] .country-tools input,
html[data-theme="dark"] .search-form input { background: #1b1916; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .search-form input { border-color: #5c574c; }
html[data-theme="dark"] .search-form input::placeholder, html[data-theme="dark"] .country-tools input::placeholder { color: #8b8577; }
html[data-theme="dark"] .status.in_force { background: #1f4a37; color: #d6f2e2; }
html[data-theme="dark"] .status.developing { color: #f1c879; }
html[data-theme="dark"] .correction strong { color: #f1c879; }
html[data-theme="dark"] .flag { box-shadow: 0 0 0 1px rgba(241, 236, 224, .25); }
html[data-theme="dark"] .story-body img, html[data-theme="dark"] .figure img { filter: brightness(.92); }
html[data-theme="dark"] .lead-story:hover h3, html[data-theme="dark"] .secondary-story:hover h3,
html[data-theme="dark"] .article a:hover, html[data-theme="dark"] .most-read a:hover,
html[data-theme="dark"] .section-lead:hover h2, html[data-theme="dark"] .related-card:hover h3,
html[data-theme="dark"] .issue-list a:hover, html[data-theme="dark"] .byline a:hover { color: var(--brand-ink); }
/* Buttons that use ink as their fill stay readable when the ink is light. */
html[data-theme="dark"] .button, html[data-theme="dark"] .result-card button, html[data-theme="dark"] .search-form button,
html[data-theme="dark"] .filter.on, html[data-theme="dark"] .load-more:hover { background: var(--ink); color: #1b1916; border-color: var(--ink); }
html[data-theme="dark"] .error-page .code { color: #d98a72; }
