/* Shared appearance controls for the public pages. */
:root { color-scheme: dark; }
body { transition: background-color .2s ease, color .2s ease; }
body:not([data-article-id]) { font-family: Inter, sans-serif; }
body:not([data-article-id]) :not([class*="mono"]) { font-family: Inter, sans-serif; }
.site-theme-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 1200;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  border: 1px solid rgba(201,168,76,.55); border-radius: 999px;
  background: #171717; color: #f0ece4; font: 600 12px Inter, sans-serif;
  box-shadow: 0 6px 24px rgba(0,0,0,.24); cursor: pointer;
}
.site-theme-toggle:hover { border-color: #c9a84c; }
body.theme-light { color-scheme: light; }

/* The article layouts share the same reading palette in both modes. */
body[data-article-id].theme-dark {
  --bg-color:#080808; --text-color:#f0ece4; --text-muted:#aaa;
  --accent-color:#d8b85e; --accent-light:rgba(201,168,76,.12);
  --border-color:rgba(255,255,255,.12); --threads-gray:#171717;
  background:var(--bg-color); color:var(--text-color);
}
body[data-article-id].theme-dark .main-header { background:rgba(8,8,8,.95); }
body[data-article-id].theme-dark .article-title,
body[data-article-id].theme-dark .article-body,
body[data-article-id].theme-dark .article-body h2,
body[data-article-id].theme-dark .article-body h3,
body[data-article-id].theme-dark .author-name,
body[data-article-id].theme-dark .threads-debate-title { color:var(--text-color); }
body[data-article-id].theme-dark .threads-sidebar,
body[data-article-id].theme-dark .threads-form,
body[data-article-id].theme-dark .math-block,
body[data-article-id].theme-dark .inline-q-response { background:#111; color:var(--text-color); border-color:var(--border-color); }
body[data-article-id].theme-dark .tag,
body[data-article-id].theme-dark .content-table th { background:#1c1c1c; color:var(--text-color); }
body[data-article-id].theme-dark .threads-textarea,
body[data-article-id].theme-dark .inline-q-input { color:var(--text-color); }
body[data-article-id].theme-dark .share-btn,
body[data-article-id].theme-dark .btn-kofi,
body[data-article-id].theme-dark .btn-yape { background:#171717; color:var(--text-color); border-color:var(--border-color); }
body[data-article-id].theme-dark .article-body h2 { border-color:var(--border-color); }

/* Normalize the two landing pages around one dark/light token set. */
body.theme-light:not([data-article-id]) {
  --text:#1a1a1a; --muted:#666; --border:rgba(0,0,0,.12);
  --bg:#f7f5f0; --bg2:#fff; --bg3:#f0ede6;
  --dark:#f7f5f0; --dark2:#fff; --dark3:#f0ede6;
  background:#f7f5f0 !important; color:#1a1a1a !important;
}
body.theme-light:not([data-article-id]) :is(h1,h2,h3,h4,p,li,label,.section-label,.section-sub,.stat-l,.footer-col-title) { color:#1a1a1a; }
body.theme-light:not([data-article-id]) :is(.nav,.footer,.auth-dropdown,.profile-modal-box,#agenda-drawer,.agenda-header) { background:#fff !important; color:#1a1a1a; }
body.theme-light:not([data-article-id]) :is(.nav-links a,.nav-logo,.auth-dropdown-name,.auth-dropdown-item,.profile-modal-title,.agenda-title) { color:#1a1a1a; }
body.theme-light:not([data-article-id]) :is(.product-item,.plan-card,.genre-card,.stat-card,.dec-card,.cont-stat,.dec-cta,.auth-dropdown,.profile-modal-box) { background:#fff !important; color:#1a1a1a; }
body.theme-light:not([data-article-id]) :is(section,.nav,.site-nav,.footer) { background-color:#f7f5f0 !important; color:#1a1a1a; }
body.theme-dark:not([data-article-id]) :is(section,.site-nav,.nav,.footer) { background-color:#0f0f0f; color:#f0ece4; }
body.theme-dark:not([data-article-id]) :is(.site-nav,.nav) { border-color:rgba(255,255,255,.12); }
body.theme-dark:not([data-article-id]) :is(.site-nav a,.nav a,.site-nav button,.nav button) { color:#f0ece4; }
body.theme-light:not([data-article-id]) :is(.site-nav,.nav) { border-color:rgba(0,0,0,.12); }
body.theme-light:not([data-article-id]) :is(.site-nav a,.nav a,.site-nav button,.nav button) { color:#1a1a1a; }
body.theme-light:not([data-article-id]) .hero,
body.theme-light:not([data-article-id]) .hero-as { background-color:#f7f5f0 !important; }
body.theme-light:not([data-article-id]) .hero :is(h1,h2,p,.hero-eyebrow,.hero-sub,.hero-tag,.hero-stat) { color:#1a1a1a !important; }
body.theme-light:not([data-article-id]) .hero-overlay-full { background:rgba(247,245,240,.82) !important; }
body.theme-dark:not([data-article-id]) { background:#080808; color:#f0ece4; }

body.norms-page.theme-light {
  --page:#f7f5f0; --surface:#fff; --surface2:#f0ede6; --line:rgba(0,0,0,.12); --ink:#1a1a1a; --muted:#666;
  background:var(--page); color:var(--ink);
}
body.norms-page.theme-light .norms-controls input,
body.norms-page.theme-light .norms-controls select,
body.norms-page.theme-light .norms-more { color:var(--ink); }

body.theme-light[data-article-id] {
  --bg-color:#fcfcfc; --text-color:#1a1a1a; --text-muted:#65676b;
  --accent-color:#004b87; --accent-light:#e6f0fa;
  --border-color:#e5e5e5; --threads-gray:#f0f2f5;
  background:var(--bg-color); color:var(--text-color);
}
body[data-article-id].theme-light .main-header { background:rgba(252,252,252,.95); }
body[data-article-id].theme-light .threads-sidebar,
body[data-article-id].theme-light .threads-form,
body[data-article-id].theme-light .math-block,
body[data-article-id].theme-light .inline-q-response { background:#fff; color:var(--text-color); }
body[data-article-id].theme-dark .article-body :is(p,h1,h2,h3,h4,li,blockquote),
body[data-article-id].theme-dark :is(.article-title,.author-name,.threads-debate-title,.inline-q-response) { color:#f0ece4 !important; }
body[data-article-id].theme-light .article-body :is(p,h1,h2,h3,h4,li,blockquote) { color:#1a1a1a; }
